bootstrap2-rails 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  == bootstrap2-rails gem
2
- This gem is under development and works only with Rails > 3.0.
2
+ This gem works only with Rails > 3.0.
3
3
 
4
4
  This gem replaces Rails default scaffold to create views based on Bootstrap 2, from Twitter (http://twitter.github.com/bootstrap). There is also a toast message feature using JQuery Toast Message plugin.
5
5
 
@@ -13,21 +13,11 @@ Include this line inside your Gemfile:
13
13
  Run the bundle command to install required gems in your Rails application:
14
14
  bundle
15
15
 
16
- === Generating view files
17
- After installing gem, run the views generator to copy some needed files (caution: it will override application.html.erb, but this action will be prompted to user). You can also modify the generated views as you need.
18
- rails generate bootstrap:views
16
+ === Updating files
17
+ After installing gem, run the install generator to update some needed files (caution: it will update application.html.erb)
18
+ rails generate bootstrap:install
19
19
 
20
- === Loading Bootstrap and JQuery Toast Message CSS files (required)
21
- Include these lines in your app/assets/stylesheets/application.css file to load required CSS files
22
- *= require bootstrap
23
- *= require jquery.toastmessage
24
-
25
- Important: Rails default scaffold.css file overrides some CSS styles. So delete scaffold.css file or clean it up to correct working of Bootstrap styles, otherwise you layout will be messy.
26
-
27
- === Loading Bootstrap and JQuery Toast Message javascript files (required)
28
- Include these lines in your app/assets/javascripts/application.js file to load required javascript files
29
- //= require bootstrap
30
- //= require jquery.toastmessage
20
+ Important: Rails default scaffold.css file overrides some CSS styles. So delete scaffold.css file or clean it up to correct working of Bootstrap stylesheets, otherwise you layout will be messy.
31
21
 
32
22
  === Toast messages
33
23
  Toast messages are notifications with an android-like visual. There are 4 types of toast messages: error, warning, notice and success.
@@ -22,4 +22,5 @@ Gem::Specification.new do |s|
22
22
  # s.add_development_dependency "rspec"
23
23
  # s.add_runtime_dependency "rest-client"
24
24
  s.add_dependency "will_paginate"
25
+ s.add_dependency "thor"
25
26
  end
@@ -1,3 +1,3 @@
1
1
  module BootstrapRails
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -0,0 +1,24 @@
1
+ module Bootstrap
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("../../templates", __FILE__)
5
+
6
+ desc "Update files needed for bootstrap2-rails"
7
+ def install
8
+ # Insert lines in application.js
9
+ inject_into_file "app/assets/javascripts/application.js",
10
+ "//= require bootstrap\n//= require jquery.toastmessage\n", :before => "//= require_tree"
11
+
12
+ # Insert lines in application.css
13
+ inject_into_file "app/assets/stylesheets/application.css",
14
+ " *= require bootstrap\n *= require jquery.toastmessage\n", :before => "*= require_self"
15
+
16
+ # Insert lines in application.html.erb
17
+ inject_into_file "app/views/layouts/application.html.erb",
18
+ "<%= menu_bar %>\n\n<div class='container-fluid' style='padding-top: 45px'>\n <% flash.each do |name, msg| %>\n <%= display_toast_message(msg, name) %>\n <% end %>\n ", :before => "<%= yield %>"
19
+
20
+ inject_into_file "app/views/layouts/application.html.erb", "\n</div>", :after => "<%= yield %>"
21
+ end
22
+ end
23
+ end
24
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap2-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-27 00:00:00.000000000 Z
12
+ date: 2012-03-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: will_paginate
16
- requirement: &71973290 !ruby/object:Gem::Requirement
16
+ requirement: &72954720 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,18 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *71973290
24
+ version_requirements: *72954720
25
+ - !ruby/object:Gem::Dependency
26
+ name: thor
27
+ requirement: &72954070 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *72954070
25
36
  description: This is a scaffold replacement with a Twitter Bootstrap look
26
37
  email:
27
38
  - stapait@gmail.com
@@ -42,7 +53,7 @@ files:
42
53
  - lib/bootstrap2-rails/bootstrap_helper.rb
43
54
  - lib/bootstrap2-rails/menu_creator.rb
44
55
  - lib/bootstrap2-rails/version.rb
45
- - lib/generators/bootstrap/views_generator.rb
56
+ - lib/generators/bootstrap/install_generator.rb
46
57
  - lib/templates/erb/scaffold/_form.html.erb
47
58
  - lib/templates/erb/scaffold/edit.html.erb
48
59
  - lib/templates/erb/scaffold/index.html.erb
@@ -82,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
93
  version: '0'
83
94
  requirements: []
84
95
  rubyforge_project: bootstrap2-rails
85
- rubygems_version: 1.8.15
96
+ rubygems_version: 1.8.17
86
97
  signing_key:
87
98
  specification_version: 3
88
99
  summary: This is a scaffold replacement with a Twitter Bootstrap look
@@ -1,23 +0,0 @@
1
- module Bootstrap
2
- module Generators
3
- class ViewsGenerator < Rails::Generators::Base
4
- source_root File.expand_path("../../templates", __FILE__)
5
-
6
- desc "Creates views needed for working with bootstrap2-rails"
7
-
8
- def generate_files
9
- source_folder = File.join(File.dirname(File.absolute_path(__FILE__)), "..", "..", "..", "app", "views", "shared")
10
- dest_folder = File.join("app", "views", "shared")
11
- Dir.entries(source_folder).each do |file|
12
- copy_file("#{source_folder}/#{file}", "#{dest_folder}/#{file}") unless File.directory? "#{source_folder}/#{file}"
13
- end
14
-
15
- source_folder = File.join(File.dirname(File.absolute_path(__FILE__)), "..", "..", "..", "app", "views", "layouts")
16
- dest_folder = File.join("app", "views", "layouts")
17
- Dir.entries(source_folder).each do |file|
18
- copy_file("#{source_folder}/#{file}", "#{dest_folder}/#{file}") unless File.directory? "#{source_folder}/#{file}"
19
- end
20
- end
21
- end
22
- end
23
- end