bootstrap-generators 3.1.1.2 → 3.1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -11
- data/lib/bootstrap/generators/version.rb +1 -1
- data/lib/generators/bootstrap/install/install_generator.rb +1 -0
- data/lib/generators/bootstrap/install/templates/layouts/starter.html.erb +7 -2
- data/lib/generators/bootstrap/install/templates/layouts/starter.html.haml +7 -2
- data/lib/generators/bootstrap/install/templates/layouts/starter.html.slim +7 -2
- data/readme-template.md.erb +19 -11
- data/test/dummy/config/environments/test.rb +6 -1
- data/test/generators/bootstrap/install_generator_test.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be32442583b5c9796a6564bed86183982985e2b5
|
4
|
+
data.tar.gz: 441520ca808310e9cc5e70e355140f6ef7afd630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56a2f75e6492d642a3c952a8fe25bdf9ecf4cc244ad04dbbe5559d987491d2ec30a25f9b920988a231779b58fe2f910a4b82976fd2a9e2c968294824804cd5ef
|
7
|
+
data.tar.gz: 042c5ddbf18386664b1a2ec155197076d63966d54e5e227c5bb798bbedfdf9271d3be4817776ebbb18313435305eea215d0ba5654896d288c5226c6e578f2707
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Bootstrap-generators provides [Twitter Bootstrap](http://getbootstrap.com/) gene
|
|
6
6
|
|
7
7
|
## Current Twitter Bootstrap version
|
8
8
|
|
9
|
-
The current version of Twitter Bootstrap is 3.1.1.
|
9
|
+
The current supported version of Twitter Bootstrap is 3.1.1.
|
10
10
|
|
11
11
|
## Installing Gem
|
12
12
|
|
@@ -40,19 +40,21 @@ You can easily customize colors, grid system, fonts, and much more by editing `b
|
|
40
40
|
|
41
41
|
To print the options and usage run the command `rails generate bootstrap:install --help`
|
42
42
|
|
43
|
-
|
43
|
+
Usage:
|
44
|
+
rails generate bootstrap:install [options]
|
44
45
|
|
45
46
|
Options:
|
46
|
-
-e, [--template-engine=TEMPLATE_ENGINE]
|
47
|
-
|
48
|
-
-se, [--stylesheet-engine=STYLESHEET_ENGINE]
|
49
|
-
|
47
|
+
-e, [--template-engine=TEMPLATE_ENGINE] # Indicates when to generate template engine
|
48
|
+
# Default: erb
|
49
|
+
-se, [--stylesheet-engine=STYLESHEET_ENGINE] # Indicates when to generate stylesheet engine
|
50
|
+
# Default: scss
|
51
|
+
[--skip-turbolinks], [--no-skip-turbolinks] # Indicates when to generate skip turbolinks
|
50
52
|
|
51
53
|
Runtime options:
|
52
|
-
-f, [--force]
|
53
|
-
-p, [--pretend] # Run but do not make any changes
|
54
|
-
-q, [--quiet]
|
55
|
-
-s, [--skip]
|
54
|
+
-f, [--force] # Overwrite files that already exist
|
55
|
+
-p, [--pretend], [--no-pretend] # Run but do not make any changes
|
56
|
+
-q, [--quiet], [--no-quiet] # Suppress status output
|
57
|
+
-s, [--skip], [--no-skip] # Skip files that already exist
|
56
58
|
|
57
59
|
Copy BootstrapGenerators default files
|
58
60
|
|
@@ -95,6 +97,8 @@ Supported stylesheet engines:
|
|
95
97
|
* SCSS
|
96
98
|
* LESS
|
97
99
|
|
100
|
+
##### SCSS
|
101
|
+
|
98
102
|
Make sure you have `sass-rails` dependency on your Gemfile:
|
99
103
|
|
100
104
|
gem 'sass-rails'
|
@@ -105,7 +109,7 @@ And then run:
|
|
105
109
|
|
106
110
|
Now you can customize the look and feel of Bootstrap.
|
107
111
|
|
108
|
-
|
112
|
+
##### LESS
|
109
113
|
|
110
114
|
Add the dependency on your Gemfile:
|
111
115
|
|
@@ -118,6 +122,10 @@ And then run:
|
|
118
122
|
|
119
123
|
Now you can customize the look and feel of Bootstrap.
|
120
124
|
|
125
|
+
#### Skip turbolinks
|
126
|
+
|
127
|
+
Run the generator with option `--skip-turbolinks` to remove turbolinks references from the generated layout.
|
128
|
+
|
121
129
|
## Assets
|
122
130
|
|
123
131
|
### Customize and extend Bootstrap
|
@@ -8,6 +8,7 @@ module Bootstrap
|
|
8
8
|
|
9
9
|
class_option :template_engine
|
10
10
|
class_option :stylesheet_engine
|
11
|
+
class_option :skip_turbolinks, :type => :boolean, :default => false, :desc => "Skip Turbolinks on assets"
|
11
12
|
|
12
13
|
def copy_lib
|
13
14
|
directory "lib/templates/#{options[:template_engine]}"
|
@@ -12,8 +12,13 @@
|
|
12
12
|
<%%= javascript_include_tag "https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js", "https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js" %>
|
13
13
|
<![endif]-->
|
14
14
|
|
15
|
-
|
16
|
-
<%%=
|
15
|
+
<%- if options[:skip_turbolinks] -%>
|
16
|
+
<%%= stylesheet_link_tag 'application', media: 'all' %>
|
17
|
+
<%%= javascript_include_tag 'application' %>
|
18
|
+
<%- else -%>
|
19
|
+
<%%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
20
|
+
<%%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
21
|
+
<%- end -%>
|
17
22
|
<%%= csrf_meta_tags %>
|
18
23
|
</head>
|
19
24
|
<body>
|
@@ -11,8 +11,13 @@
|
|
11
11
|
/[if lt IE 9]
|
12
12
|
= javascript_include_tag "https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js", "https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"
|
13
13
|
|
14
|
-
|
15
|
-
=
|
14
|
+
<%- if options[:skip_turbolinks] -%>
|
15
|
+
= stylesheet_link_tag 'application', media: 'all'
|
16
|
+
= javascript_include_tag 'application'
|
17
|
+
<%- else -%>
|
18
|
+
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
|
19
|
+
= javascript_include_tag 'application', 'data-turbolinks-track' => true
|
20
|
+
<%- end -%>
|
16
21
|
= csrf_meta_tags
|
17
22
|
%body
|
18
23
|
.navbar.navbar-inverse.navbar-fixed-top
|
@@ -10,8 +10,13 @@ html
|
|
10
10
|
/! HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries
|
11
11
|
/[if lt IE 9]
|
12
12
|
= javascript_include_tag "https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js", "https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"
|
13
|
-
|
14
|
-
=
|
13
|
+
<%- if options[:skip_turbolinks] -%>
|
14
|
+
= stylesheet_link_tag 'application', media: 'all'
|
15
|
+
= javascript_include_tag 'application'
|
16
|
+
<%- else -%>
|
17
|
+
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
|
18
|
+
= javascript_include_tag 'application', 'data-turbolinks-track' => true
|
19
|
+
<%- end -%>
|
15
20
|
= csrf_meta_tags
|
16
21
|
body
|
17
22
|
.navbar.navbar-inverse.navbar-fixed-top
|
data/readme-template.md.erb
CHANGED
@@ -6,7 +6,7 @@ Bootstrap-generators provides [Twitter Bootstrap](http://getbootstrap.com/) gene
|
|
6
6
|
|
7
7
|
## Current Twitter Bootstrap version
|
8
8
|
|
9
|
-
The current version of Twitter Bootstrap is <%= bootstrap_version %>.
|
9
|
+
The current supported version of Twitter Bootstrap is <%= bootstrap_version %>.
|
10
10
|
|
11
11
|
## Installing Gem
|
12
12
|
|
@@ -40,19 +40,21 @@ You can easily customize colors, grid system, fonts, and much more by editing `b
|
|
40
40
|
|
41
41
|
To print the options and usage run the command `rails generate bootstrap:install --help`
|
42
42
|
|
43
|
-
|
43
|
+
Usage:
|
44
|
+
rails generate bootstrap:install [options]
|
44
45
|
|
45
46
|
Options:
|
46
|
-
-e, [--template-engine=TEMPLATE_ENGINE]
|
47
|
-
|
48
|
-
-se, [--stylesheet-engine=STYLESHEET_ENGINE]
|
49
|
-
|
47
|
+
-e, [--template-engine=TEMPLATE_ENGINE] # Indicates when to generate template engine
|
48
|
+
# Default: erb
|
49
|
+
-se, [--stylesheet-engine=STYLESHEET_ENGINE] # Indicates when to generate stylesheet engine
|
50
|
+
# Default: scss
|
51
|
+
[--skip-turbolinks], [--no-skip-turbolinks] # Indicates when to generate skip turbolinks
|
50
52
|
|
51
53
|
Runtime options:
|
52
|
-
-f, [--force]
|
53
|
-
-p, [--pretend] # Run but do not make any changes
|
54
|
-
-q, [--quiet]
|
55
|
-
-s, [--skip]
|
54
|
+
-f, [--force] # Overwrite files that already exist
|
55
|
+
-p, [--pretend], [--no-pretend] # Run but do not make any changes
|
56
|
+
-q, [--quiet], [--no-quiet] # Suppress status output
|
57
|
+
-s, [--skip], [--no-skip] # Skip files that already exist
|
56
58
|
|
57
59
|
Copy BootstrapGenerators default files
|
58
60
|
|
@@ -95,6 +97,8 @@ Supported stylesheet engines:
|
|
95
97
|
* SCSS
|
96
98
|
* LESS
|
97
99
|
|
100
|
+
##### SCSS
|
101
|
+
|
98
102
|
Make sure you have `sass-rails` dependency on your Gemfile:
|
99
103
|
|
100
104
|
gem 'sass-rails'
|
@@ -105,7 +109,7 @@ And then run:
|
|
105
109
|
|
106
110
|
Now you can customize the look and feel of Bootstrap.
|
107
111
|
|
108
|
-
|
112
|
+
##### LESS
|
109
113
|
|
110
114
|
Add the dependency on your Gemfile:
|
111
115
|
|
@@ -118,6 +122,10 @@ And then run:
|
|
118
122
|
|
119
123
|
Now you can customize the look and feel of Bootstrap.
|
120
124
|
|
125
|
+
#### Skip turbolinks
|
126
|
+
|
127
|
+
Run the generator with option `--skip-turbolinks` to remove turbolinks references from the generated layout.
|
128
|
+
|
121
129
|
## Assets
|
122
130
|
|
123
131
|
### Customize and extend Bootstrap
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
5
5
|
# test suite. You never need to work with it otherwise. Remember that
|
@@ -7,6 +7,11 @@ Dummy::Application.configure do
|
|
7
7
|
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
13
|
+
config.eager_load = false
|
14
|
+
|
10
15
|
# Configure static asset server for tests with Cache-Control for performance
|
11
16
|
config.serve_static_assets = true
|
12
17
|
config.static_cache_control = 'public, max-age=3600'
|
@@ -46,6 +46,24 @@ class InstallGeneratorTest < Rails::Generators::TestCase
|
|
46
46
|
|
47
47
|
assert_file "app/views/layouts/application.html.#{templating_system}"
|
48
48
|
end
|
49
|
+
|
50
|
+
test "should not skip turbolinks by default (#{templating_system} layout)" do
|
51
|
+
run_generator %W(-f --template-engine #{templating_system})
|
52
|
+
|
53
|
+
assert_file "app/views/layouts/application.html.#{templating_system}" do |contents|
|
54
|
+
assert_match(/stylesheet_link_tag\s+'application', media: 'all', 'data-turbolinks-track' => true/, contents)
|
55
|
+
assert_match(/javascript_include_tag\s+'application', 'data-turbolinks-track' => true/, contents)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
test "should skip turbolinks (#{templating_system} layout)" do
|
60
|
+
run_generator %W(-f --template-engine #{templating_system} --skip-turbolinks)
|
61
|
+
|
62
|
+
assert_file "app/views/layouts/application.html.#{templating_system}" do |contents|
|
63
|
+
assert_no_match(/stylesheet_link_tag\s+'application', media: 'all', 'data-turbolinks-track' => true/, contents)
|
64
|
+
assert_no_match(/javascript_include_tag\s+'application', 'data-turbolinks-track' => true/, contents)
|
65
|
+
end
|
66
|
+
end
|
49
67
|
end
|
50
68
|
|
51
69
|
test 'should copy css files' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.1.
|
4
|
+
version: 3.1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Décio Ferreira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|