bootstrap-sass 3.1.1.1 → 3.2.0.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bootstrap-sass might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +6 -2
- data/CHANGELOG.md +19 -0
- data/Gemfile +5 -10
- data/README.md +140 -75
- data/Rakefile +4 -5
- data/{vendor/assets → assets}/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
- data/{vendor/assets → assets}/fonts/bootstrap/glyphicons-halflings-regular.svg +0 -0
- data/{vendor/assets → assets}/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
- data/{vendor/assets → assets}/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
- data/assets/images/.keep +0 -0
- data/assets/javascripts/bootstrap-sprockets.js +12 -0
- data/assets/javascripts/bootstrap.js +2107 -0
- data/{vendor/assets → assets}/javascripts/bootstrap/affix.js +18 -11
- data/{vendor/assets → assets}/javascripts/bootstrap/alert.js +10 -6
- data/{vendor/assets → assets}/javascripts/bootstrap/button.js +11 -8
- data/{vendor/assets → assets}/javascripts/bootstrap/carousel.js +49 -31
- data/{vendor/assets → assets}/javascripts/bootstrap/collapse.js +19 -24
- data/{vendor/assets → assets}/javascripts/bootstrap/dropdown.js +9 -5
- data/{vendor/assets → assets}/javascripts/bootstrap/modal.js +25 -16
- data/{vendor/assets → assets}/javascripts/bootstrap/popover.js +9 -6
- data/{vendor/assets → assets}/javascripts/bootstrap/scrollspy.js +37 -21
- data/{vendor/assets → assets}/javascripts/bootstrap/tab.js +11 -8
- data/{vendor/assets → assets}/javascripts/bootstrap/tooltip.js +52 -17
- data/{vendor/assets → assets}/javascripts/bootstrap/transition.js +14 -3
- data/assets/stylesheets/_bootstrap-compass.scss +7 -0
- data/{vendor/assets → assets}/stylesheets/_bootstrap-mincer.scss +0 -0
- data/assets/stylesheets/_bootstrap-sprockets.scss +7 -0
- data/{vendor/assets/stylesheets/bootstrap.scss → assets/stylesheets/_bootstrap.scss} +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_alerts.scss +4 -3
- data/{vendor/assets → assets}/stylesheets/bootstrap/_badges.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_breadcrumbs.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_button-groups.scss +5 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/_buttons.scss +0 -2
- data/{vendor/assets → assets}/stylesheets/bootstrap/_carousel.scss +3 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/_close.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_code.scss +6 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_component-animations.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_dropdowns.scss +1 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_forms.scss +82 -22
- data/{vendor/assets → assets}/stylesheets/bootstrap/_glyphicons.scss +4 -4
- data/{vendor/assets → assets}/stylesheets/bootstrap/_grid.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_input-groups.scss +6 -2
- data/{vendor/assets → assets}/stylesheets/bootstrap/_jumbotron.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_labels.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_list-group.scss +3 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/_media.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_mixins.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_modals.scss +7 -4
- data/{vendor/assets → assets}/stylesheets/bootstrap/_navbar.scss +1 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_navs.scss +1 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/_normalize.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_pager.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_pagination.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_panels.scss +6 -3
- data/{vendor/assets → assets}/stylesheets/bootstrap/_popovers.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_print.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_progress-bars.scss +18 -2
- data/{vendor/assets → assets}/stylesheets/bootstrap/_responsive-embed.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_responsive-utilities.scss +2 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/_scaffolding.scss +1 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/_tables.scss +2 -2
- data/{vendor/assets → assets}/stylesheets/bootstrap/_theme.scss +11 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_thumbnails.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_tooltip.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_type.scss +16 -6
- data/{vendor/assets → assets}/stylesheets/bootstrap/_utilities.scss +1 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/_variables.scss +25 -20
- data/{vendor/assets → assets}/stylesheets/bootstrap/_wells.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_alerts.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_background-variant.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_border-radius.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_buttons.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_center-block.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_clearfix.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_forms.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_gradients.scss +1 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_grid-framework.scss +2 -8
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_grid.scss +3 -3
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_hide-text.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_image.scss +1 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_labels.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_list-group.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_opacity.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_pagination.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_panels.scss +4 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_progress-bar.scss +2 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_reset-filter.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_resize.scss +1 -1
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_responsive-visibility.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_size.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_tab-focus.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_table-row.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_text-overflow.scss +0 -0
- data/{vendor/assets → assets}/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +5 -10
- data/bootstrap-sass.gemspec +11 -6
- data/bower.json +22 -90
- data/composer.json +1 -1
- data/lib/bootstrap-sass.rb +3 -2
- data/lib/bootstrap-sass/engine.rb +4 -1
- data/lib/bootstrap-sass/version.rb +2 -2
- data/package.json +6 -1
- data/sache.json +5 -0
- data/tasks/bower.rake +6 -5
- data/tasks/converter.rb +3 -3
- data/tasks/converter/js_conversion.rb +11 -5
- data/tasks/converter/less_conversion.rb +30 -21
- data/tasks/converter/logger.rb +1 -0
- data/tasks/converter/network.rb +14 -16
- data/templates/project/{_variables.sass.erb → _bootstrap-variables.sass.erb} +0 -2
- data/templates/project/manifest.rb +17 -16
- data/templates/project/styles.sass +2 -2
- data/test/compass_test.rb +5 -4
- data/test/compilation_test.rb +10 -9
- data/test/dummy_node_mincer/manifest.js +2 -2
- data/test/dummy_rails/README.rdoc +1 -1
- data/test/dummy_rails/app/assets/javascripts/application.js +1 -1
- data/test/dummy_rails/app/assets/stylesheets/application.css.sass +2 -1
- data/test/dummy_rails/app/views/pages/root.html.slim +1 -1
- data/test/dummy_rails/config/application.rb +19 -3
- data/test/dummy_sass_only/compile.rb +4 -4
- data/test/gemfiles/sass_3_2.gemfile +1 -11
- data/test/gemfiles/sass_3_3.gemfile +2 -13
- data/test/gemfiles/sass_3_4.gemfile +7 -0
- data/test/gemfiles/sass_head.gemfile +2 -13
- data/test/node_mincer_test.rb +6 -5
- data/test/node_sass_test.rb +7 -6
- data/test/pages_test.rb +3 -3
- data/test/sass_test.rb +9 -6
- data/test/sprockets_rails_test.rb +11 -5
- data/test/support/dummy_rails_integration.rb +22 -0
- data/test/support/integration_test.rb +4 -11
- data/test/support/reporting.rb +17 -0
- data/test/test_helper.rb +22 -18
- data/test/test_helper_rails.rb +6 -0
- metadata +231 -151
- data/lib/bootstrap-sass/sass_functions.rb +0 -50
- data/vendor/assets/javascripts/bootstrap.js +0 -12
- data/vendor/assets/stylesheets/bootstrap/bootstrap.scss +0 -50
data/bootstrap-sass.gemspec
CHANGED
@@ -13,16 +13,21 @@ Gem::Specification.new do |s|
|
|
13
13
|
|
14
14
|
s.add_runtime_dependency 'sass', '~> 3.2'
|
15
15
|
|
16
|
+
# Testing dependencies
|
17
|
+
s.add_development_dependency 'minitest', '~> 5.4.0'
|
18
|
+
s.add_development_dependency 'minitest-reporters', '~> 1.0.5'
|
19
|
+
# Integration testing
|
20
|
+
s.add_development_dependency 'capybara'
|
21
|
+
s.add_development_dependency 'poltergeist'
|
16
22
|
# Dummy Rails app dependencies
|
17
|
-
s.add_development_dependency '
|
23
|
+
s.add_development_dependency 'actionpack', '>= 4.1.5'
|
24
|
+
s.add_development_dependency 'activesupport', '>= 4.1.5'
|
25
|
+
s.add_development_dependency 'json', '>= 1.8.1'
|
26
|
+
s.add_development_dependency 'sprockets-rails', '>= 2.1.3'
|
27
|
+
s.add_development_dependency 'autoprefixer-rails', '~> 1.1'
|
18
28
|
s.add_development_dependency 'jquery-rails', '>= 3.1.0'
|
19
29
|
s.add_development_dependency 'slim-rails'
|
20
30
|
s.add_development_dependency 'uglifier'
|
21
|
-
# Compass dummy app
|
22
|
-
s.add_development_dependency 'compass'
|
23
|
-
# Integration testing
|
24
|
-
s.add_development_dependency 'capybara'
|
25
|
-
s.add_development_dependency 'poltergeist'
|
26
31
|
# Converter
|
27
32
|
s.add_development_dependency 'term-ansicolor'
|
28
33
|
|
data/bower.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "bootstrap-sass",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.2.0",
|
4
4
|
"homepage": "https://github.com/twbs/bootstrap-sass",
|
5
5
|
"authors": [
|
6
6
|
"Thomas McDonald",
|
@@ -10,94 +10,23 @@
|
|
10
10
|
],
|
11
11
|
"description": "bootstrap-sass is a Sass-powered version of Bootstrap, ready to drop right into your Sass powered applications.",
|
12
12
|
"main": [
|
13
|
-
"
|
14
|
-
"
|
15
|
-
"
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"
|
30
|
-
"vendor/assets/stylesheets/bootstrap/_list-group.scss",
|
31
|
-
"vendor/assets/stylesheets/bootstrap/_media.scss",
|
32
|
-
"vendor/assets/stylesheets/bootstrap/_mixins.scss",
|
33
|
-
"vendor/assets/stylesheets/bootstrap/_modals.scss",
|
34
|
-
"vendor/assets/stylesheets/bootstrap/_navbar.scss",
|
35
|
-
"vendor/assets/stylesheets/bootstrap/_navs.scss",
|
36
|
-
"vendor/assets/stylesheets/bootstrap/_normalize.scss",
|
37
|
-
"vendor/assets/stylesheets/bootstrap/_pager.scss",
|
38
|
-
"vendor/assets/stylesheets/bootstrap/_pagination.scss",
|
39
|
-
"vendor/assets/stylesheets/bootstrap/_panels.scss",
|
40
|
-
"vendor/assets/stylesheets/bootstrap/_popovers.scss",
|
41
|
-
"vendor/assets/stylesheets/bootstrap/_print.scss",
|
42
|
-
"vendor/assets/stylesheets/bootstrap/_progress-bars.scss",
|
43
|
-
"vendor/assets/stylesheets/bootstrap/_responsive-embed.scss",
|
44
|
-
"vendor/assets/stylesheets/bootstrap/_responsive-utilities.scss",
|
45
|
-
"vendor/assets/stylesheets/bootstrap/_scaffolding.scss",
|
46
|
-
"vendor/assets/stylesheets/bootstrap/_tables.scss",
|
47
|
-
"vendor/assets/stylesheets/bootstrap/_theme.scss",
|
48
|
-
"vendor/assets/stylesheets/bootstrap/_thumbnails.scss",
|
49
|
-
"vendor/assets/stylesheets/bootstrap/_tooltip.scss",
|
50
|
-
"vendor/assets/stylesheets/bootstrap/_type.scss",
|
51
|
-
"vendor/assets/stylesheets/bootstrap/_utilities.scss",
|
52
|
-
"vendor/assets/stylesheets/bootstrap/_variables.scss",
|
53
|
-
"vendor/assets/stylesheets/bootstrap/_wells.scss",
|
54
|
-
"vendor/assets/stylesheets/bootstrap/bootstrap.scss",
|
55
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_alerts.scss",
|
56
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_background-variant.scss",
|
57
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_border-radius.scss",
|
58
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_buttons.scss",
|
59
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_center-block.scss",
|
60
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_clearfix.scss",
|
61
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_forms.scss",
|
62
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_gradients.scss",
|
63
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_grid-framework.scss",
|
64
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_grid.scss",
|
65
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_hide-text.scss",
|
66
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_image.scss",
|
67
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_labels.scss",
|
68
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_list-group.scss",
|
69
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_nav-divider.scss",
|
70
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss",
|
71
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_opacity.scss",
|
72
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_pagination.scss",
|
73
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_panels.scss",
|
74
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_progress-bar.scss",
|
75
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_reset-filter.scss",
|
76
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_resize.scss",
|
77
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss",
|
78
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_size.scss",
|
79
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_tab-focus.scss",
|
80
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_table-row.scss",
|
81
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss",
|
82
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_text-overflow.scss",
|
83
|
-
"vendor/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss",
|
84
|
-
"vendor/assets/stylesheets/bootstrap.scss",
|
85
|
-
"vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.eot",
|
86
|
-
"vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.svg",
|
87
|
-
"vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf",
|
88
|
-
"vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff",
|
89
|
-
"vendor/assets/javascripts/bootstrap/affix.js",
|
90
|
-
"vendor/assets/javascripts/bootstrap/alert.js",
|
91
|
-
"vendor/assets/javascripts/bootstrap/button.js",
|
92
|
-
"vendor/assets/javascripts/bootstrap/carousel.js",
|
93
|
-
"vendor/assets/javascripts/bootstrap/collapse.js",
|
94
|
-
"vendor/assets/javascripts/bootstrap/dropdown.js",
|
95
|
-
"vendor/assets/javascripts/bootstrap/tab.js",
|
96
|
-
"vendor/assets/javascripts/bootstrap/transition.js",
|
97
|
-
"vendor/assets/javascripts/bootstrap/scrollspy.js",
|
98
|
-
"vendor/assets/javascripts/bootstrap/modal.js",
|
99
|
-
"vendor/assets/javascripts/bootstrap/tooltip.js",
|
100
|
-
"vendor/assets/javascripts/bootstrap/popover.js"
|
13
|
+
"assets/stylesheets/_bootstrap.scss",
|
14
|
+
"assets/fonts/bootstrap/glyphicons-halflings-regular.eot",
|
15
|
+
"assets/fonts/bootstrap/glyphicons-halflings-regular.svg",
|
16
|
+
"assets/fonts/bootstrap/glyphicons-halflings-regular.ttf",
|
17
|
+
"assets/fonts/bootstrap/glyphicons-halflings-regular.woff",
|
18
|
+
"assets/javascripts/bootstrap/affix.js",
|
19
|
+
"assets/javascripts/bootstrap/alert.js",
|
20
|
+
"assets/javascripts/bootstrap/button.js",
|
21
|
+
"assets/javascripts/bootstrap/carousel.js",
|
22
|
+
"assets/javascripts/bootstrap/collapse.js",
|
23
|
+
"assets/javascripts/bootstrap/dropdown.js",
|
24
|
+
"assets/javascripts/bootstrap/tab.js",
|
25
|
+
"assets/javascripts/bootstrap/transition.js",
|
26
|
+
"assets/javascripts/bootstrap/scrollspy.js",
|
27
|
+
"assets/javascripts/bootstrap/modal.js",
|
28
|
+
"assets/javascripts/bootstrap/tooltip.js",
|
29
|
+
"assets/javascripts/bootstrap/popover.js"
|
101
30
|
],
|
102
31
|
"keywords": [
|
103
32
|
"twbs",
|
@@ -114,5 +43,8 @@
|
|
114
43
|
"*.gemspec",
|
115
44
|
"Rakefile",
|
116
45
|
"Gemfile"
|
117
|
-
]
|
46
|
+
],
|
47
|
+
"dependencies": {
|
48
|
+
"jquery": ">= 1.9.0"
|
49
|
+
}
|
118
50
|
}
|
data/composer.json
CHANGED
data/lib/bootstrap-sass.rb
CHANGED
@@ -2,7 +2,6 @@ module Bootstrap
|
|
2
2
|
class << self
|
3
3
|
# Inspired by Kaminari
|
4
4
|
def load!
|
5
|
-
require 'bootstrap-sass/sass_functions'
|
6
5
|
register_compass_extension if compass?
|
7
6
|
|
8
7
|
if rails?
|
@@ -30,7 +29,7 @@ module Bootstrap
|
|
30
29
|
end
|
31
30
|
|
32
31
|
def assets_path
|
33
|
-
@assets_path ||= File.join gem_path, '
|
32
|
+
@assets_path ||= File.join gem_path, 'assets'
|
34
33
|
end
|
35
34
|
|
36
35
|
# Environment detection helpers
|
@@ -49,6 +48,8 @@ module Bootstrap
|
|
49
48
|
private
|
50
49
|
|
51
50
|
def configure_sass
|
51
|
+
require 'sass'
|
52
|
+
|
52
53
|
::Sass.load_paths << stylesheets_path
|
53
54
|
|
54
55
|
# bootstrap requires minimum precision of 10, see https://github.com/twbs/bootstrap-sass/issues/409
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module Bootstrap
|
2
2
|
module Rails
|
3
3
|
class Engine < ::Rails::Engine
|
4
|
-
initializer
|
4
|
+
initializer 'bootstrap-sass.assets.precompile' do |app|
|
5
|
+
%w(stylesheets javascripts fonts images).each do |sub|
|
6
|
+
app.config.assets.paths << root.join('assets', sub)
|
7
|
+
end
|
5
8
|
app.config.assets.precompile << %r(bootstrap/glyphicons-halflings-regular\.(?:eot|svg|ttf|woff)$)
|
6
9
|
end
|
7
10
|
end
|
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "bootstrap-sass",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.2.0",
|
4
4
|
"description": "bootstrap-sass is a Sass-powered version of Bootstrap, ready to drop right into your Sass powered applications.",
|
5
5
|
"main": "index.js",
|
6
6
|
"repository": {
|
@@ -21,5 +21,10 @@
|
|
21
21
|
"license": "MIT",
|
22
22
|
"bugs": {
|
23
23
|
"url": "https://github.com/twbs/bootstrap-sass/issues"
|
24
|
+
},
|
25
|
+
"devDependencies": {
|
26
|
+
"node-sass": "*",
|
27
|
+
"mincer": "*",
|
28
|
+
"ejs": "*"
|
24
29
|
}
|
25
30
|
}
|
data/sache.json
ADDED
data/tasks/bower.rake
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'find'
|
2
|
-
require 'bootstrap-sass'
|
3
2
|
require 'json'
|
4
3
|
require 'pathname'
|
5
4
|
|
@@ -12,14 +11,16 @@ namespace :bower do
|
|
12
11
|
}
|
13
12
|
|
14
13
|
desc 'update main and version in bower.json'
|
15
|
-
task :
|
14
|
+
task :generate do
|
15
|
+
require 'bootstrap-sass'
|
16
16
|
Dir.chdir Bootstrap.gem_path do
|
17
17
|
spec = JSON.parse(File.read 'bower.json')
|
18
|
-
js_paths = File.read(File.join Bootstrap.javascripts_path, 'bootstrap.js').lines.map do |line|
|
19
|
-
line.strip if line.sub!(%r(//\s*=\s*require\s*(.*)\s*), '
|
18
|
+
js_paths = File.read(File.join Bootstrap.javascripts_path, 'bootstrap-sprockets.js').lines.map do |line|
|
19
|
+
line.strip if line.sub!(%r(//\s*=\s*require\s*(?:./)?(.*)\s*), 'assets/javascripts/\1.js')
|
20
20
|
end.compact
|
21
21
|
|
22
|
-
spec['main'] =
|
22
|
+
spec['main'] =
|
23
|
+
find_files.(File.join(Bootstrap.stylesheets_path, '_bootstrap.scss')) +
|
23
24
|
find_files.(Bootstrap.fonts_path) +
|
24
25
|
js_paths
|
25
26
|
|
data/tasks/converter.rb
CHANGED
@@ -42,9 +42,9 @@ class Converter
|
|
42
42
|
@cache_path = cache_path
|
43
43
|
@repo_url = "https://github.com/#@repo"
|
44
44
|
@save_to = {
|
45
|
-
js: '
|
46
|
-
scss: '
|
47
|
-
fonts: '
|
45
|
+
js: 'assets/javascripts/bootstrap',
|
46
|
+
scss: 'assets/stylesheets/bootstrap',
|
47
|
+
fonts: 'assets/fonts/bootstrap'}.merge(save_to)
|
48
48
|
end
|
49
49
|
|
50
50
|
def_delegators :@logger, :log, :log_status, :log_processing, :log_transform, :log_file_info, :log_processed, :log_http_get_file, :log_http_get_files, :silence_log
|
@@ -3,20 +3,26 @@ class Converter
|
|
3
3
|
def process_javascript_assets
|
4
4
|
log_status 'Processing javascripts...'
|
5
5
|
save_to = @save_to[:js]
|
6
|
+
contents = {}
|
6
7
|
read_files('js', bootstrap_js_files).each do |name, file|
|
8
|
+
contents[name] = file
|
7
9
|
save_file("#{save_to}/#{name}", file)
|
8
10
|
end
|
9
11
|
log_processed "#{bootstrap_js_files * ' '}"
|
10
12
|
|
11
13
|
log_status 'Updating javascript manifest'
|
12
|
-
|
14
|
+
manifest = ''
|
15
|
+
cat = ''
|
13
16
|
bootstrap_js_files.each do |name|
|
17
|
+
cat << contents[name] + "\n"
|
14
18
|
name = name.gsub(/\.js$/, '')
|
15
|
-
|
19
|
+
manifest << "//= require ./bootstrap/#{name}\n"
|
20
|
+
end
|
21
|
+
{'assets/javascripts/bootstrap-sprockets.js' => manifest,
|
22
|
+
'assets/javascripts/bootstrap.js' => cat}.each do |path, content|
|
23
|
+
save_file path, content
|
24
|
+
log_processed path
|
16
25
|
end
|
17
|
-
path = 'vendor/assets/javascripts/bootstrap.js'
|
18
|
-
save_file(path, content)
|
19
|
-
log_processed path
|
20
26
|
end
|
21
27
|
|
22
28
|
def bootstrap_js_files
|
@@ -79,7 +79,7 @@ class Converter
|
|
79
79
|
file = deinterpolate_vararg_mixins(file)
|
80
80
|
when 'mixins/vendor-prefixes.less'
|
81
81
|
# remove second scale mixins as this is handled via vararg in the first one
|
82
|
-
file = replace_rules(file, '
|
82
|
+
file = replace_rules(file, Regexp.escape('@mixin scale($ratioX, $ratioY...)')) { '' }
|
83
83
|
when 'mixins/grid-framework.less'
|
84
84
|
file = convert_grid_mixins file
|
85
85
|
when 'component-animations.less'
|
@@ -88,13 +88,16 @@ class Converter
|
|
88
88
|
file = apply_mixin_parent_selector file, '\.(?:visible|hidden)'
|
89
89
|
when 'variables.less'
|
90
90
|
file = insert_default_vars(file)
|
91
|
-
file = unindent <<-SCSS + file, 14
|
92
|
-
//
|
93
|
-
//
|
94
|
-
// in Sass 3.3
|
95
|
-
$bootstrap-sass-asset-helper: (
|
91
|
+
file = unindent <<-SCSS + "\n" + file, 14
|
92
|
+
// When true, asset path helpers are used, otherwise the regular CSS `url()` is used.
|
93
|
+
// When there no function is defined, `fn('')` is parsed as string that equals the right hand side
|
94
|
+
// NB: in Sass 3.3 there is a native function: function-exists(twbs-font-path)
|
95
|
+
$bootstrap-sass-asset-helper: #{sass_fn_exists('twbs-font-path')} !default;
|
96
|
+
SCSS
|
97
|
+
file = replace_all file, %r{(\$icon-font-path): \s*"(.*)" (!default);}, "\n" + unindent(<<-SCSS, 14)
|
98
|
+
// [converter] Asset helpers such as Sprockets and Node.js Mincer do not resolve relative paths
|
99
|
+
\\1: if($bootstrap-sass-asset-helper, "bootstrap/", "\\2bootstrap/") \\3;
|
96
100
|
SCSS
|
97
|
-
file = replace_all file, /(\$icon-font-path:).*(!default)/, '\1 "bootstrap/" \2'
|
98
101
|
when 'close.less'
|
99
102
|
# extract .close { button& {...} } rule
|
100
103
|
file = extract_nested_rule file, 'button&'
|
@@ -111,8 +114,7 @@ class Converter
|
|
111
114
|
when 'thumbnails.less', 'labels.less', 'badges.less'
|
112
115
|
file = extract_nested_rule file, 'a&'
|
113
116
|
when 'glyphicons.less'
|
114
|
-
file = bootstrap_font_files.map { |p| %Q(//=
|
115
|
-
file = replace_all file, /\#\{(url\(.*?\))}/, '\1'
|
117
|
+
file = bootstrap_font_files.map { |p| %Q(//= depend_on "bootstrap/#{File.basename(p)}") } * "\n" + "\n" + file
|
116
118
|
file = replace_rules(file, '@font-face') { |rule|
|
117
119
|
rule = replace_all rule, /(\$icon-font(?:-\w+)+)/, '#{\1}'
|
118
120
|
replace_asset_url rule, :font
|
@@ -123,18 +125,17 @@ class Converter
|
|
123
125
|
file = replace_all(file, " @include bg-variant($brand-primary);\n}", "}\n@include bg-variant('.bg-primary', $brand-primary);")
|
124
126
|
end
|
125
127
|
|
126
|
-
|
127
|
-
path
|
128
|
-
unless name == 'bootstrap.scss'
|
129
|
-
path = File.join File.dirname(path), '_' + File.basename(path)
|
130
|
-
end
|
128
|
+
path = File.join save_to, name.sub(/\.less$/, '.scss')
|
129
|
+
path = File.join File.dirname(path), '_' + File.basename(path)
|
131
130
|
save_file(path, file)
|
132
131
|
log_processed File.basename(path)
|
133
132
|
end
|
134
133
|
|
135
|
-
#
|
136
|
-
|
137
|
-
|
134
|
+
# move bootstrap/_bootstrap.scss to _bootstrap.scss adjusting import paths
|
135
|
+
main_from = "#{save_to}/_bootstrap.scss"
|
136
|
+
main_to = File.expand_path("#{save_to}/../_bootstrap.scss")
|
137
|
+
save_file main_to, File.read(main_from).gsub(/ "/, ' "bootstrap/')
|
138
|
+
File.delete(main_from)
|
138
139
|
end
|
139
140
|
|
140
141
|
def bootstrap_less_files
|
@@ -161,6 +162,10 @@ class Converter
|
|
161
162
|
file
|
162
163
|
end
|
163
164
|
|
165
|
+
def sass_fn_exists(fn)
|
166
|
+
%Q{(#{fn}("") != unquote('#{fn}("")'))}
|
167
|
+
end
|
168
|
+
|
164
169
|
def replace_asset_url(rule, type)
|
165
170
|
replace_all rule, /url\((.*?)\)/, "url(if($bootstrap-sass-asset-helper, twbs-#{type}-path(\\1), \\1))"
|
166
171
|
end
|
@@ -168,13 +173,17 @@ class Converter
|
|
168
173
|
# convert recursively evaluated selector $list to @for loop
|
169
174
|
def mixin_all_grid_columns(css, selector: raise('pass class'), from: 1, to: raise('pass to'))
|
170
175
|
mxn_def = css.each_line.first.strip
|
176
|
+
# inject local variables as default arguments
|
177
|
+
# this is to avoid overwriting outer variables with the same name with Sass <= 3.3
|
178
|
+
# see also: https://github.com/twbs/bootstrap-sass/issues/636
|
179
|
+
locals = <<-SASS.strip
|
180
|
+
$i: #{from}, $list: "#{selector}"
|
181
|
+
SASS
|
182
|
+
mxn_def.sub!(/(\(?)(\)\s*\{)/) { "#{$1}#{', ' if $1.empty?}#{locals}#{$2}" }
|
171
183
|
step_body = (css =~ /\$list \{\n(.*?)\n[ ]*\}/m) && $1
|
172
184
|
<<-SASS
|
173
185
|
// [converter] This is defined recursively in LESS, but Sass supports real loops
|
174
186
|
#{mxn_def}
|
175
|
-
$list: '';
|
176
|
-
$i: #{from};
|
177
|
-
$list: "#{selector}";
|
178
187
|
@for $i from (#{from} + 1) through #{to} {
|
179
188
|
$list: "\#{$list}, #{selector}";
|
180
189
|
}
|
@@ -452,7 +461,7 @@ SASS
|
|
452
461
|
end
|
453
462
|
|
454
463
|
def replace_fadein(less)
|
455
|
-
less.gsub(/(?![\-$@.])fadein\((.*?),\s*(.*?)%\)/) { "
|
464
|
+
less.gsub(/(?![\-$@.])fadein\((.*?),\s*(.*?)%\)/) { "fade_in(#{$1}, #{$2.to_i / 100.0})" }
|
456
465
|
end
|
457
466
|
|
458
467
|
def replace_image_urls(less)
|
data/tasks/converter/logger.rb
CHANGED
data/tasks/converter/network.rb
CHANGED
@@ -7,20 +7,17 @@ class Converter
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def read_files(path, files)
|
10
|
-
full_path = "https://raw.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end.each(&:join)
|
22
|
-
write_cached_files path, contents
|
23
|
-
end
|
10
|
+
full_path = "https://raw.githubusercontent.com/#@repo/#@branch_sha/#{path}"
|
11
|
+
contents = read_cached_files(path, files)
|
12
|
+
log_http_get_files contents.keys, full_path, true if contents.keys
|
13
|
+
files -= contents.keys
|
14
|
+
log_http_get_files files, full_path, false
|
15
|
+
files.map do |name|
|
16
|
+
Thread.start {
|
17
|
+
contents[name] = open("#{full_path}/#{name}").read
|
18
|
+
Thread.exclusive { write_cached_files path, name => contents[name] }
|
19
|
+
}
|
20
|
+
end.each(&:join)
|
24
21
|
contents
|
25
22
|
end
|
26
23
|
|
@@ -29,10 +26,11 @@ class Converter
|
|
29
26
|
contents = {}
|
30
27
|
if File.directory?(full_path)
|
31
28
|
files.each do |name|
|
32
|
-
|
29
|
+
path = "#{full_path}/#{name}"
|
30
|
+
contents[name] = File.read(path, mode: 'rb') if File.exists?(path)
|
33
31
|
end
|
34
|
-
contents
|
35
32
|
end
|
33
|
+
contents
|
36
34
|
end
|
37
35
|
|
38
36
|
def write_cached_files(path, files)
|