bootstrap-generators 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +10 -0
- data/lib/bootstrap/generators/version.rb +1 -1
- data/lib/generators/bootstrap/install/install_generator.rb +12 -2
- data/lib/generators/bootstrap/install/templates/{bootstrap-generators.js → assets/javascripts/bootstrap-generators.js} +0 -0
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/container-app.css +54 -0
- data/lib/generators/bootstrap/install/templates/{layouts → assets/stylesheets}/container-app.css.scss +0 -0
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css +20 -0
- data/lib/generators/bootstrap/install/templates/{layouts → assets/stylesheets}/fluid.css.scss +1 -0
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css +20 -0
- data/lib/generators/bootstrap/install/templates/{layouts → assets/stylesheets}/hero.css.scss +1 -0
- data/test/lib/generators/bootstrap/install_generator_test.rb +13 -2
- metadata +17 -14
data/README.md
CHANGED
@@ -28,3 +28,13 @@ Once you've done that, any time you generate a controller or scaffold, you'll ge
|
|
28
28
|
|
29
29
|
`rails generate bootstrap:install --form_builder=simple_form`
|
30
30
|
|
31
|
+
## Layouts
|
32
|
+
|
33
|
+
There are three layouts available, based on the quick-start examples:
|
34
|
+
|
35
|
+
* hero (default; based on [this template](http://twitter.github.com/bootstrap/examples/hero.html))
|
36
|
+
* fluid (based on [this template](http://twitter.github.com/bootstrap/examples/fluid.html))
|
37
|
+
* container-app (based on [this template](http://twitter.github.com/bootstrap/examples/container-app.html))
|
38
|
+
|
39
|
+
To select one of these layouts just pass the option '--layout=LAYOUT' to the install generator.
|
40
|
+
|
@@ -9,6 +9,7 @@ module Bootstrap
|
|
9
9
|
class_option :form_builder, :desc => "Select your form builder (form_builder or simple_form)", :default => "simple_form", :type => :string
|
10
10
|
|
11
11
|
class_option :template_engine
|
12
|
+
class_option :stylesheet_engine
|
12
13
|
|
13
14
|
def copy_lib
|
14
15
|
directory "lib/templates/#{options[:template_engine]}"
|
@@ -36,8 +37,17 @@ module Bootstrap
|
|
36
37
|
|
37
38
|
def create_layout
|
38
39
|
template "layouts/#{options[:layout]}.html.#{options[:template_engine]}", "app/views/layouts/application.html.#{options[:template_engine]}"
|
39
|
-
|
40
|
-
|
40
|
+
end
|
41
|
+
|
42
|
+
def create_assets
|
43
|
+
if options[:stylesheet_engine].intern == :css
|
44
|
+
stylesheet_extension = 'css'
|
45
|
+
else
|
46
|
+
stylesheet_extension = "css.#{options[:stylesheet_engine]}"
|
47
|
+
end
|
48
|
+
|
49
|
+
copy_file "assets/stylesheets/#{options[:layout]}.#{stylesheet_extension}", "app/assets/stylesheets/bootstrap-generators.#{stylesheet_extension}"
|
50
|
+
copy_file "assets/javascripts/bootstrap-generators.js", "app/assets/javascripts/bootstrap-generators.js"
|
41
51
|
end
|
42
52
|
end
|
43
53
|
end
|
File without changes
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/*
|
2
|
+
*= require bootstrap
|
3
|
+
*/
|
4
|
+
|
5
|
+
.page-header a.btn {
|
6
|
+
float: right;
|
7
|
+
}
|
8
|
+
|
9
|
+
.page-header a.btn + a.btn {
|
10
|
+
margin-right: 8px;
|
11
|
+
}
|
12
|
+
|
13
|
+
.form-stacked div.alert-message {
|
14
|
+
margin-left: -10px;
|
15
|
+
}
|
16
|
+
|
17
|
+
/* Override some defaults */
|
18
|
+
html, body {
|
19
|
+
background-color: #eee;
|
20
|
+
}
|
21
|
+
body {
|
22
|
+
padding-top: 40px; /* 40px to make the container go all the way to the bottom of the topbar */
|
23
|
+
}
|
24
|
+
.container > footer p {
|
25
|
+
text-align: center; /* center align it with the container */
|
26
|
+
}
|
27
|
+
.container {
|
28
|
+
width: 820px; /* downsize our container to make the content feel a bit tighter and more cohesive. NOTE: this removes two full columns from the grid, meaning you only go to 14 columns and not 16. */
|
29
|
+
}
|
30
|
+
|
31
|
+
/* The white background content wrapper */
|
32
|
+
.content {
|
33
|
+
background-color: #fff;
|
34
|
+
padding: 20px;
|
35
|
+
margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
|
36
|
+
-webkit-border-radius: 0 0 6px 6px;
|
37
|
+
-moz-border-radius: 0 0 6px 6px;
|
38
|
+
border-radius: 0 0 6px 6px;
|
39
|
+
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
40
|
+
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
41
|
+
box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
42
|
+
}
|
43
|
+
|
44
|
+
/* Page header tweaks */
|
45
|
+
.content > .page-header {
|
46
|
+
background-color: #f5f5f5;
|
47
|
+
padding: 20px 20px 10px;
|
48
|
+
margin: -20px -20px 20px;
|
49
|
+
}
|
50
|
+
|
51
|
+
.topbar .btn {
|
52
|
+
border: 0;
|
53
|
+
}
|
54
|
+
|
File without changes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/*
|
2
|
+
*= require bootstrap
|
3
|
+
*/
|
4
|
+
|
5
|
+
body {
|
6
|
+
padding-top: 60px;
|
7
|
+
}
|
8
|
+
|
9
|
+
.page-header a.btn {
|
10
|
+
float: right;
|
11
|
+
}
|
12
|
+
|
13
|
+
.page-header a.btn + a.btn {
|
14
|
+
margin-right: 8px;
|
15
|
+
}
|
16
|
+
|
17
|
+
.form-stacked div.alert-message {
|
18
|
+
margin-left: -10px;
|
19
|
+
}
|
20
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/*
|
2
|
+
*= require bootstrap
|
3
|
+
*/
|
4
|
+
|
5
|
+
body {
|
6
|
+
padding-top: 60px;
|
7
|
+
}
|
8
|
+
|
9
|
+
.page-header a.btn {
|
10
|
+
float: right;
|
11
|
+
}
|
12
|
+
|
13
|
+
.page-header a.btn + a.btn {
|
14
|
+
margin-right: 8px;
|
15
|
+
}
|
16
|
+
|
17
|
+
.form-stacked div.alert-message {
|
18
|
+
margin-left: -10px;
|
19
|
+
}
|
20
|
+
|
@@ -40,13 +40,24 @@ class Bootstrap::Generators::InstallGeneratorTest < ::Rails::Generators::TestCas
|
|
40
40
|
}
|
41
41
|
end
|
42
42
|
|
43
|
-
test "should copy
|
43
|
+
test "should copy javascript files" do
|
44
44
|
run_generator
|
45
45
|
|
46
|
-
assert_file "app/assets/stylesheets/bootstrap-generators.css.scss"
|
47
46
|
assert_file "app/assets/javascripts/bootstrap-generators.js"
|
48
47
|
end
|
49
48
|
|
49
|
+
test "should copy css files" do
|
50
|
+
run_generator %w(--stylesheet-engine css)
|
51
|
+
|
52
|
+
assert_file "app/assets/stylesheets/bootstrap-generators.css"
|
53
|
+
end
|
54
|
+
|
55
|
+
test "should copy scss files" do
|
56
|
+
run_generator %w(--stylesheet-engine scss)
|
57
|
+
|
58
|
+
assert_file "app/assets/stylesheets/bootstrap-generators.css.scss"
|
59
|
+
end
|
60
|
+
|
50
61
|
test "should create erb layout" do
|
51
62
|
run_generator
|
52
63
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
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: 2011-10-
|
12
|
+
date: 2011-10-28 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &2152487860 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.0.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2152487860
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: test-unit
|
27
|
-
requirement: &
|
27
|
+
requirement: &2152487300 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2152487300
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rails
|
38
|
-
requirement: &
|
38
|
+
requirement: &2152486480 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '3.0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2152486480
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: railties
|
49
|
-
requirement: &
|
49
|
+
requirement: &2152485720 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '3.0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2152485720
|
58
58
|
description: Bootstrap-generators provides Twitter Bootstrap generators for Rails
|
59
59
|
3. Bootstrap is a toolkit from Twitter designed to kickstart development of webapps
|
60
60
|
and sites. Checkout http://twitter.github.com/bootstrap.
|
@@ -83,19 +83,22 @@ files:
|
|
83
83
|
- lib/generators/bootstrap/install/templates/app/inputs/password_input.rb
|
84
84
|
- lib/generators/bootstrap/install/templates/app/inputs/string_input.rb
|
85
85
|
- lib/generators/bootstrap/install/templates/app/inputs/text_input.rb
|
86
|
-
- lib/generators/bootstrap/install/templates/bootstrap-generators.js
|
86
|
+
- lib/generators/bootstrap/install/templates/assets/javascripts/bootstrap-generators.js
|
87
|
+
- lib/generators/bootstrap/install/templates/assets/stylesheets/container-app.css
|
88
|
+
- lib/generators/bootstrap/install/templates/assets/stylesheets/container-app.css.scss
|
89
|
+
- lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css
|
90
|
+
- lib/generators/bootstrap/install/templates/assets/stylesheets/fluid.css.scss
|
91
|
+
- lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css
|
92
|
+
- lib/generators/bootstrap/install/templates/assets/stylesheets/hero.css.scss
|
87
93
|
- lib/generators/bootstrap/install/templates/config/initializers/simple_form.rb
|
88
94
|
- lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.erb
|
89
95
|
- lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.haml
|
90
96
|
- lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.erb
|
91
97
|
- lib/generators/bootstrap/install/templates/form_builders/simple_form/_form.html.haml
|
92
|
-
- lib/generators/bootstrap/install/templates/layouts/container-app.css.scss
|
93
98
|
- lib/generators/bootstrap/install/templates/layouts/container-app.html.erb
|
94
99
|
- lib/generators/bootstrap/install/templates/layouts/container-app.html.haml
|
95
|
-
- lib/generators/bootstrap/install/templates/layouts/fluid.css.scss
|
96
100
|
- lib/generators/bootstrap/install/templates/layouts/fluid.html.erb
|
97
101
|
- lib/generators/bootstrap/install/templates/layouts/fluid.html.haml
|
98
|
-
- lib/generators/bootstrap/install/templates/layouts/hero.css.scss
|
99
102
|
- lib/generators/bootstrap/install/templates/layouts/hero.html.erb
|
100
103
|
- lib/generators/bootstrap/install/templates/layouts/hero.html.haml
|
101
104
|
- lib/generators/bootstrap/install/templates/lib/templates/erb/controller/view.html.erb
|