mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Create a Ruby on Rails gem
This commit is contained in:
committed by
David Morse
co-authored by
David Morse
parent
aa2053b6c6
commit
b399504cd4
+3
-1
@@ -4,4 +4,6 @@ gh-pages/
|
||||
demo/
|
||||
.idea
|
||||
.DS_Store
|
||||
*.iml
|
||||
*.iml
|
||||
vendor
|
||||
*.gem
|
||||
|
||||
+43
-4
@@ -86,6 +86,16 @@ module.exports = function(grunt) {
|
||||
}
|
||||
}
|
||||
},
|
||||
replace: {
|
||||
'rails-version': {
|
||||
src: ['lib/gridster.js-rails/version.rb'],
|
||||
dest: 'lib/gridster.js-rails/version.rb',
|
||||
replacements: [{
|
||||
from: /(\S*)(VERSION = ).*/g,
|
||||
to: '$1$2"<%= pkg.version %>"'
|
||||
}]
|
||||
}
|
||||
},
|
||||
copy: {
|
||||
dist: {
|
||||
files: [{
|
||||
@@ -93,6 +103,27 @@ module.exports = function(grunt) {
|
||||
dest: 'gh-pages/',
|
||||
src: ['dist/*', 'demos/**']
|
||||
}]
|
||||
},
|
||||
rails: {
|
||||
files: [{
|
||||
expand: true,
|
||||
flatten: true,
|
||||
dest: 'vendor/assets/javascripts/',
|
||||
src: ['dist/*.js']
|
||||
}, {
|
||||
expand: true,
|
||||
flatten: true,
|
||||
dest: 'vendor/assets/stylesheets/',
|
||||
src: ['dist/*.css']
|
||||
}]
|
||||
}
|
||||
},
|
||||
shell: {
|
||||
'build-rails-gem': {
|
||||
command: 'gem build gridster.js-rails.gemspec'
|
||||
},
|
||||
'publish-rails-gem': {
|
||||
command: 'gem push gridster.js-rails-<%= pkg.version %>'
|
||||
}
|
||||
},
|
||||
'gh-pages': {
|
||||
@@ -152,17 +183,25 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-bump');
|
||||
grunt.loadNpmTasks('grunt-conventional-changelog');
|
||||
grunt.loadNpmTasks('grunt-gh-pages');
|
||||
grunt.loadNpmTasks('grunt-text-replace');
|
||||
grunt.loadNpmTasks('grunt-shell');
|
||||
|
||||
// Default task.
|
||||
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'cssmin']);
|
||||
grunt.registerTask('build', ['default', 'qunit']);
|
||||
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'cssmin', 'replace:rails-version', 'copy:rails']);
|
||||
grunt.registerTask('build', ['default', 'qunit', 'shell:build-rails-gem']);
|
||||
grunt.registerTask('test', ['jshint','qunit']);
|
||||
grunt.registerTask('docs', ['clean', 'build', 'yuidoc', 'copy:dist', 'gh-pages']);
|
||||
|
||||
//builds and releases the gem files
|
||||
grunt.registerTask('rails:publish', ['shell:build-rails-gem', 'shell:publish-rails-gem']);
|
||||
|
||||
//use one of the four release tasks to build the artifacts for the release (it will push the docs pages only)
|
||||
grunt.registerTask('release:patch', ['build', 'bump-only:patch', 'build', 'docs', 'changelog']);
|
||||
grunt.registerTask('release:minor', ['build', 'bump-only:minor', 'build', 'docs', 'changelog']);
|
||||
grunt.registerTask('release:major', ['build', 'bump-only:major', 'build', 'docs', 'changelog']);
|
||||
grunt.registerTask('release:git', ['build', 'bump-only:git', 'build', 'docs', 'changelog', 'bump-commit']);
|
||||
grunt.registerTask('release:commit', ['bump-commit']);
|
||||
grunt.registerTask('release:git', ['build', 'bump-only:git', 'build', 'docs', 'changelog']);
|
||||
|
||||
//use this task to publish the release artifacts
|
||||
grunt.registerTask('release:commit', ['bump-commit', 'shell:publish-rails-gem']);
|
||||
|
||||
};
|
||||
|
||||
@@ -25,6 +25,31 @@ As of result of the inactivity over the last year in the [Ducksboard](https://gi
|
||||
for current support. He will GLADLY accept pull requests, and will be working to merge existing
|
||||
Pull Requests from Ducksboard repo.
|
||||
|
||||
## Ruby on Rails integration
|
||||
|
||||
This artifact is published to [rubygems.org](https://rubygems.org/gems/gridster.js-rails) to be consumed by ruby on rails applications.
|
||||
|
||||
Include gridster.js-rails in Gemfile;
|
||||
|
||||
``` ruby
|
||||
gem 'gridster.js-rails'
|
||||
```
|
||||
|
||||
and run bundle install.
|
||||
|
||||
### Configuration
|
||||
|
||||
Add this line to app/assets/stylesheets/application.css
|
||||
|
||||
``` css
|
||||
*= require jquery.gridster
|
||||
```
|
||||
|
||||
Add this line to app/assets/javascripts/application.js
|
||||
|
||||
``` javascript
|
||||
//= require jquery.gridster
|
||||
```
|
||||
|
||||
## Contributing to this project
|
||||
|
||||
|
||||
+5
-1
@@ -20,6 +20,10 @@
|
||||
"CONTRIBUTING.md",
|
||||
"Gruntfile.js",
|
||||
"package.json",
|
||||
"test/"
|
||||
"test/",
|
||||
"gridster.js-rails.gemspec",
|
||||
"Gemfile",
|
||||
"Gemfile.lock",
|
||||
"lib"
|
||||
]
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*! gridster.js - v0.6.8 - 2015-05-26
|
||||
/*! gridster.js - v0.6.8 - 2015-05-27
|
||||
* http://gridster.net/
|
||||
* Copyright (c) 2015 ducksboard; Licensed MIT */
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*! gridster.js - v0.6.8 - 2015-05-26
|
||||
/*! gridster.js - v0.6.8 - 2015-05-27
|
||||
* http://gridster.net/
|
||||
* Copyright (c) 2015 ducksboard; Licensed MIT */
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
/*! gridster.js - v0.6.8 - 2015-05-26 - * http://gridster.net/ - Copyright (c) 2015 ducksboard; Licensed MIT */
|
||||
/*! gridster.js - v0.6.8 - 2015-05-27 - * http://gridster.net/ - Copyright (c) 2015 ducksboard; Licensed MIT */
|
||||
.gridster{position:relative}.gridster>*{-webkit-transition:height .4s,width .4s;-moz-transition:height .4s,width .4s;-o-transition:height .4s,width .4s;-ms-transition:height .4s,width .4s;transition:height .4s,width .4s}.gridster .gs-w{z-index:2;position:absolute}.gridster.collapsed{height:auto!important}.gridster.collapsed .gs-w{position:static!important}.ready .gs-w:not(.preview-holder),.ready .resize-preview-holder{-webkit-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-moz-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-o-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;transition:opacity .3s,left .3s,top .3s,width .3s,height .3s}.gridster .preview-holder{z-index:1;position:absolute;background-color:#fff;border-color:#fff;opacity:.3}.gridster .player-revert{z-index:10!important;-webkit-transition:left .3s,top .3s!important;-moz-transition:left .3s,top .3s!important;-o-transition:left .3s,top .3s!important;transition:left .3s,top .3s!important}.gridster .dragging,.gridster .resizing{z-index:10!important;-webkit-transition:all 0s!important;-moz-transition:all 0s!important;-o-transition:all 0s!important;transition:all 0s!important}.gs-resize-handle{position:absolute;z-index:1}.gs-resize-handle-both{width:20px;height:20px;bottom:-8px;right:-8px;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=);background-position:top left;background-repeat:no-repeat;cursor:se-resize;z-index:20}.gs-resize-handle-x{top:0;bottom:13px;right:-5px;width:10px;cursor:e-resize}.gs-resize-handle-y{left:0;right:13px;bottom:-5px;height:10px;cursor:s-resize}.gs-w:hover .gs-resize-handle,.resizing .gs-resize-handle{opacity:1}.gs-resize-handle,.gs-w.dragging .gs-resize-handle{opacity:0}.gs-resize-disabled .gs-resize-handle,[data-max-sizex="1"] .gs-resize-handle-x,[data-max-sizey="1"] .gs-resize-handle-y,[data-max-sizey="1"][data-max-sizex="1"] .gs-resize-handle{display:none!important}
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
/*! gridster.js - v0.6.8 - 2015-05-26
|
||||
/*! gridster.js - v0.6.8 - 2015-05-27
|
||||
* http://gridster.net/
|
||||
* Copyright (c) 2015 ducksboard; Licensed MIT */
|
||||
|
||||
@@ -5068,7 +5068,7 @@
|
||||
;(function(root, factory) {
|
||||
'use strict';
|
||||
if(typeof exports === 'object') {
|
||||
module.exports = factory(require('jquery'), require('./jquery-gridster.js'));
|
||||
module.exports = factory(require('jquery'), require('./jquery.gridster.js'));
|
||||
}
|
||||
else if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery', 'gridster'], factory);
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -0,0 +1,23 @@
|
||||
# coding: utf-8
|
||||
require File.expand_path('../lib/gridster.js-rails/version', __FILE__)
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = "gridster.js-rails"
|
||||
spec.version = Gridster::Rails::VERSION
|
||||
spec.authors = ["dsmorse"]
|
||||
spec.email = ['https://github.com/dsmorse']
|
||||
|
||||
spec.summary = %q{jQuery plugin for draggable grid layouts}
|
||||
spec.description = %q{Gridster is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns. You can even dynamically add and remove elements from the grid.}
|
||||
spec.homepage = "https://github.com/dsmorse/gridster.js"
|
||||
spec.licenses = ['MIT']
|
||||
|
||||
spec.files = `git ls-files -z`.split("\x0").reject { |f|
|
||||
f.match(%r{^(test|spec|features|dist|demos|node_modules|src|\.bowerrc|\.jshintrc|Gruntfile\.js|bower\.json|package\.json)})
|
||||
}
|
||||
|
||||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_development_dependency "bundler", "~> 1.9"
|
||||
spec.add_development_dependency "rake", "~> 10.0"
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
module Gridster
|
||||
module Rails
|
||||
VERSION = "0.6.8"
|
||||
end
|
||||
end
|
||||
+4
-2
@@ -36,9 +36,11 @@
|
||||
"grunt-contrib-yuidoc": "~0.7.0",
|
||||
"grunt-conventional-changelog": "~1.0.0",
|
||||
"grunt-gh-pages": "^0.10.0",
|
||||
"grunt-shell": "^1.1.2",
|
||||
"grunt-text-replace": "^0.4.0",
|
||||
"jshint-stylish": "^1.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "grunt test"
|
||||
}
|
||||
"test": "grunt test"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user