ratchet-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/CHANGES +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +38 -0
- data/Rakefile +1 -0
- data/lib/generators/ratchet/install/install_generator.rb +36 -0
- data/lib/generators/ratchet/install/templates/application.css +7 -0
- data/lib/generators/ratchet/install/templates/application.js +9 -0
- data/lib/generators/ratchet/install/templates/ratchet.css +1260 -0
- data/lib/generators/ratchet/install/templates/ratchet.js +741 -0
- data/lib/ratchet/rails/engine.rb +14 -0
- data/lib/ratchet/rails/version.rb +6 -0
- data/lib/ratchet-rails.rb +7 -0
- data/ratchet-rails.gemspec +23 -0
- metadata +108 -0
data/.gitignore
ADDED
data/CHANGES
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Toshihiro Morimoto
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# Ratchet Rails for Rails 3.1 Asset Pipeline
|
2
|
+
|
3
|
+
[Ratchet][1] is prototype mobile apps with simple HTML, CSS and JS components.
|
4
|
+
|
5
|
+
ratchet-rails project integrates Ratchet Rails for Rails 3.1 Asset Pipeline
|
6
|
+
|
7
|
+
I have made reference to the [twitter-bootstrap-rails][2].
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
gem 'ratchet-rails'
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install ratchet-rails
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
You can run following generators to get started with Ratchet quickly.
|
26
|
+
|
27
|
+
$ rails g ratchet:install
|
28
|
+
|
29
|
+
## Contributing
|
30
|
+
|
31
|
+
1. Fork it
|
32
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
33
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
34
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
35
|
+
5. Create new Pull Request
|
36
|
+
|
37
|
+
[1]: https://github.com/maker/ratchet
|
38
|
+
[2]: https://github.com/seyhunak/twitter-bootstrap-rails
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Ratchet
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < ::Rails::Generators::Base
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
desc "This generator installs Ratchet #{Ratchet::Rails::RATCHET_VERSION} to Asset Pipeline"
|
8
|
+
|
9
|
+
def add_assets
|
10
|
+
if File.exist?('app/assets/javascripts/application.js')
|
11
|
+
insert_into_file "app/assets/javascripts/application.js", "//= require ratchet\n", :after => "//= require jquery_ujs\n"
|
12
|
+
else
|
13
|
+
copy_file "application.js", "app/assets/javascripts/application.js"
|
14
|
+
end
|
15
|
+
|
16
|
+
if File.exist?('app/assets/stylesheets/application.css')
|
17
|
+
# Add our own require:
|
18
|
+
content = File.read("app/assets/stylesheets/application.css")
|
19
|
+
if content.match(/require_tree\s+\.\s*$/)
|
20
|
+
# Good enough - that'll include our ratchet.css.less
|
21
|
+
else
|
22
|
+
style_require_block = " *= require ratchet\n"
|
23
|
+
insert_into_file "app/assets/stylesheets/application.css", style_require_block, :after => "require_self\n"
|
24
|
+
end
|
25
|
+
else
|
26
|
+
copy_file "application.css", "app/assets/stylesheets/application.css"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def add_ratchet
|
31
|
+
copy_file "ratchet.js", "app/assets/javascripts/ratchet.js"
|
32
|
+
copy_file "ratchet.css", "app/assets/stylesheets/ratchet.css"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require_tree .
|
7
|
+
*/
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require_self
|
8
|
+
//= require ratchet
|
9
|
+
//= require_tree .
|