rocky 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/lib/generators/rocky/install/install_generator.rb +33 -0
- data/lib/generators/rocky/install/templates/app.coffee +8 -0
- data/lib/generators/rocky/resource_helpers.rb +22 -0
- data/lib/rocky/version.rb +3 -0
- data/lib/rocky.rb +7 -0
- data/vendor/assets/javascripts/backbone.js +1487 -0
- data/vendor/assets/javascripts/middleware/component/modal.js.coffee +10 -0
- data/vendor/assets/javascripts/middleware/component/puppet.js.coffee +14 -0
- data/vendor/assets/javascripts/middleware/system/base.js.coffee +16 -0
- data/vendor/assets/javascripts/middleware.js.coffee +8 -0
- data/vendor/assets/javascripts/underscore.js +1227 -0
- metadata +107 -0
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Rocky
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'rocky'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install rocky
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "generators/rocky/resource_helpers"
|
2
|
+
|
3
|
+
module Rocky
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
include Rocky::Generators::ResourceHelpers
|
7
|
+
|
8
|
+
source_root File.expand_path("../templates", __FILE__)
|
9
|
+
|
10
|
+
desc "This generator installs Rocky Middleware in app/assets/javascripts/application"
|
11
|
+
|
12
|
+
class_option :skip_git, :type => :boolean, :aliases => "-G", :default => false,
|
13
|
+
:desc => "Skip Git ignores and keeps"
|
14
|
+
|
15
|
+
def inject_middleware
|
16
|
+
inject_into_file "app/assets/javascripts/application.js", :after => "//= require jquery_ujs" do
|
17
|
+
"\n//= require underscore\n//= require backbone\n//= require middleware\n//= require application/#{application_name.underscore}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def create_dir_layout
|
22
|
+
%W{models views}.each do |dir|
|
23
|
+
empty_directory "app/assets/javascripts/application/#{dir}"
|
24
|
+
create_file "app/assets/javascripts/application/#{dir}/.gitkeep" unless options[:skip_git]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def create_app_file
|
29
|
+
template "app.coffee", "app/assets/javascripts/application/#{application_name.underscore}.js.coffee"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Rocky
|
2
|
+
module Generators
|
3
|
+
module ResourceHelpers
|
4
|
+
|
5
|
+
def rocky_path
|
6
|
+
"app/assets/javascripts/application"
|
7
|
+
end
|
8
|
+
|
9
|
+
def js_app_name
|
10
|
+
application_name.camelize
|
11
|
+
end
|
12
|
+
|
13
|
+
def application_name
|
14
|
+
if defined?(Rails) && Rails.application
|
15
|
+
Rails.application.class.name.split('::').first
|
16
|
+
else
|
17
|
+
"application"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|