bootstrap-sass 3.3.5 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +8 -12
- data/CHANGELOG.md +20 -0
- data/Gemfile +1 -4
- data/LICENSE +2 -1
- data/README.md +79 -74
- data/Rakefile +46 -11
- data/assets/javascripts/bootstrap/affix.js +7 -5
- data/assets/javascripts/bootstrap/alert.js +6 -5
- data/assets/javascripts/bootstrap/button.js +14 -9
- data/assets/javascripts/bootstrap/carousel.js +16 -7
- data/assets/javascripts/bootstrap/collapse.js +7 -6
- data/assets/javascripts/bootstrap/dropdown.js +7 -7
- data/assets/javascripts/bootstrap/modal.js +44 -23
- data/assets/javascripts/bootstrap/popover.js +25 -10
- data/assets/javascripts/bootstrap/scrollspy.js +4 -4
- data/assets/javascripts/bootstrap/tab.js +10 -10
- data/assets/javascripts/bootstrap/tooltip.js +177 -14
- data/assets/javascripts/bootstrap/transition.js +5 -5
- data/assets/javascripts/bootstrap-sprockets.js +2 -2
- data/assets/javascripts/bootstrap.js +326 -109
- data/assets/javascripts/bootstrap.min.js +3 -4
- data/assets/stylesheets/_bootstrap-mincer.scss +2 -2
- data/assets/stylesheets/_bootstrap.scss +2 -2
- data/assets/stylesheets/bootstrap/_alerts.scss +3 -3
- data/assets/stylesheets/bootstrap/_badges.scss +3 -3
- data/assets/stylesheets/bootstrap/_breadcrumbs.scss +3 -1
- data/assets/stylesheets/bootstrap/_button-groups.scss +8 -8
- data/assets/stylesheets/bootstrap/_buttons.scss +4 -4
- data/assets/stylesheets/bootstrap/_carousel.scss +33 -31
- data/assets/stylesheets/bootstrap/_close.scss +1 -0
- data/assets/stylesheets/bootstrap/_code.scss +3 -3
- data/assets/stylesheets/bootstrap/_component-animations.scss +1 -0
- data/assets/stylesheets/bootstrap/_dropdowns.scss +20 -23
- data/assets/stylesheets/bootstrap/_forms.scss +56 -60
- data/assets/stylesheets/bootstrap/_glyphicons.scss +11 -11
- data/assets/stylesheets/bootstrap/_grid.scss +10 -0
- data/assets/stylesheets/bootstrap/_input-groups.scss +9 -5
- data/assets/stylesheets/bootstrap/_jumbotron.scss +5 -3
- data/assets/stylesheets/bootstrap/_labels.scss +1 -1
- data/assets/stylesheets/bootstrap/_list-group.scss +30 -32
- data/assets/stylesheets/bootstrap/_media.scss +1 -1
- data/assets/stylesheets/bootstrap/_modals.scss +8 -8
- data/assets/stylesheets/bootstrap/_navbar.scss +75 -81
- data/assets/stylesheets/bootstrap/_navs.scss +4 -4
- data/assets/stylesheets/bootstrap/_normalize.scss +5 -2
- data/assets/stylesheets/bootstrap/_pager.scss +2 -2
- data/assets/stylesheets/bootstrap/_pagination.scss +13 -16
- data/assets/stylesheets/bootstrap/_panels.scss +5 -5
- data/assets/stylesheets/bootstrap/_popovers.scss +47 -52
- data/assets/stylesheets/bootstrap/_print.scss +90 -92
- data/assets/stylesheets/bootstrap/_progress-bars.scss +3 -3
- data/assets/stylesheets/bootstrap/_responsive-embed.scss +2 -2
- data/assets/stylesheets/bootstrap/_responsive-utilities.scss +3 -3
- data/assets/stylesheets/bootstrap/_scaffolding.scss +7 -7
- data/assets/stylesheets/bootstrap/_tables.scss +23 -23
- data/assets/stylesheets/bootstrap/_theme.scss +21 -17
- data/assets/stylesheets/bootstrap/_thumbnails.scss +1 -1
- data/assets/stylesheets/bootstrap/_tooltip.scss +38 -27
- data/assets/stylesheets/bootstrap/_type.scss +11 -11
- data/assets/stylesheets/bootstrap/_variables.scss +9 -7
- data/assets/stylesheets/bootstrap/_wells.scss +2 -2
- data/assets/stylesheets/bootstrap/mixins/_alerts.scss +2 -1
- data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +4 -4
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +7 -14
- data/assets/stylesheets/bootstrap/mixins/_center-block.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +4 -4
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +6 -8
- data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +7 -7
- data/assets/stylesheets/bootstrap/mixins/_hide-text.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_image.scss +5 -10
- data/assets/stylesheets/bootstrap/mixins/_opacity.scss +2 -3
- data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +4 -4
- data/assets/stylesheets/bootstrap/mixins/_resize.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +0 -4
- data/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +3 -3
- data/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +3 -3
- data/bootstrap-sass.gemspec +10 -9
- data/bower.json +4 -3
- data/composer.json +2 -2
- data/eyeglass-exports.js +7 -0
- data/lib/bootstrap-sass/engine.rb +6 -1
- data/lib/bootstrap-sass/version.rb +2 -2
- data/lib/bootstrap-sass.rb +17 -10
- data/package-lock.json +1611 -0
- data/package.json +20 -6
- data/sache.json +1 -1
- data/tasks/converter/less_conversion.rb +12 -8
- data/tasks/converter/network.rb +2 -2
- data/templates/project/_bootstrap-variables.sass +10 -8
- data/test/compilation_test.rb +24 -12
- data/test/dummy_rails/config/application.rb +2 -1
- data/test/dummy_rails/config/boot.rb +1 -1
- data/test/dummy_sass_only/Gemfile +1 -1
- data/test/dummy_sass_only/compile.rb +14 -7
- data/test/dummy_sass_only/import_all.scss +2 -0
- data/test/gemfiles/default.gemfile +3 -0
- data/test/node_mincer_test.rb +2 -3
- data/test/node_sass_compile_test.sh +4 -3
- data/test/sass_test.rb +10 -7
- data/test/sprockets_rails_test.rb +12 -8
- data/test/support/dummy_rails_integration.rb +1 -1
- data/test/support/reporting.rb +10 -0
- data/test/test_helper.rb +3 -2
- metadata +37 -28
- data/test/compass_test.rb +0 -9
- data/test/dummy_sass_only/import_all.sass +0 -2
- data/test/gemfiles/sass_3_2.gemfile +0 -6
- data/test/gemfiles/sass_3_3.gemfile +0 -6
- data/test/gemfiles/sass_3_4.gemfile +0 -7
- data/test/gemfiles/sass_head.gemfile +0 -6
data/package.json
CHANGED
@@ -1,8 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"name": "bootstrap-sass",
|
3
|
-
"version": "3.
|
4
|
-
"description": "bootstrap-sass is a Sass-powered version of Bootstrap, ready to drop right into your Sass powered applications.",
|
3
|
+
"version": "3.4.1",
|
4
|
+
"description": "bootstrap-sass is a Sass-powered version of Bootstrap 3, ready to drop right into your Sass powered applications.",
|
5
5
|
"main": "assets/javascripts/bootstrap.js",
|
6
|
+
"style": "assets/stylesheets/_bootstrap.scss",
|
7
|
+
"sass": "assets/stylesheets/_bootstrap.scss",
|
8
|
+
"files": [
|
9
|
+
"assets",
|
10
|
+
"eyeglass-exports.js",
|
11
|
+
"CHANGELOG.md",
|
12
|
+
"LICENSE",
|
13
|
+
"README.md"
|
14
|
+
],
|
6
15
|
"repository": {
|
7
16
|
"type": "git",
|
8
17
|
"url": "git://github.com/twbs/bootstrap-sass"
|
@@ -10,7 +19,8 @@
|
|
10
19
|
"keywords": [
|
11
20
|
"bootstrap",
|
12
21
|
"sass",
|
13
|
-
"css"
|
22
|
+
"css",
|
23
|
+
"eyeglass-module"
|
14
24
|
],
|
15
25
|
"contributors": [
|
16
26
|
"Thomas McDonald",
|
@@ -23,8 +33,12 @@
|
|
23
33
|
"url": "https://github.com/twbs/bootstrap-sass/issues"
|
24
34
|
},
|
25
35
|
"devDependencies": {
|
26
|
-
"node-sass": "
|
27
|
-
"mincer": "~1.
|
28
|
-
"ejs": "~1
|
36
|
+
"node-sass": "^4.9.3",
|
37
|
+
"mincer": "~1.4.0",
|
38
|
+
"ejs": "~2.6.1"
|
39
|
+
},
|
40
|
+
"eyeglass": {
|
41
|
+
"exports": "eyeglass-exports.js",
|
42
|
+
"needs": "^0.7.1"
|
29
43
|
}
|
30
44
|
}
|
data/sache.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
2
|
"name": "bootstrap-sass",
|
3
|
-
"description": "bootstrap-sass is a Sass-powered version of Bootstrap, ready to drop right into your Sass powered applications",
|
3
|
+
"description": "bootstrap-sass is a Sass-powered version of Bootstrap 3, ready to drop right into your Sass powered applications.",
|
4
4
|
"tags": ["bootstrap", "grid", "typography", "buttons", "ui", "responsive-web-design"]
|
5
5
|
}
|
@@ -67,6 +67,7 @@ class Converter
|
|
67
67
|
log_processing name
|
68
68
|
# apply common conversions
|
69
69
|
file = convert_less(file)
|
70
|
+
file = replace_all file, %r{// stylelint-disable.*?\n+}, '', optional: true
|
70
71
|
if name.start_with?('mixins/')
|
71
72
|
file = varargify_mixin_definitions(file, *VARARG_MIXINS)
|
72
73
|
%w(responsive-(in)?visibility input-size text-emphasis-variant bg-variant).each do |mixin|
|
@@ -102,6 +103,11 @@ class Converter
|
|
102
103
|
// [converter] This is because some asset helpers, such as Sprockets, do not work with file-relative paths.
|
103
104
|
\\1: if($bootstrap-sass-asset-helper, "bootstrap/", "\\2bootstrap/") \\3;
|
104
105
|
SCSS
|
106
|
+
when 'breadcrumbs.less'
|
107
|
+
file = replace_all file, /(.*)(\\00a0)/, unindent(<<-SCSS, 8) + "\\1\#{$nbsp}"
|
108
|
+
// [converter] Workaround for https://github.com/sass/libsass/issues/1115
|
109
|
+
$nbsp: "\\2";
|
110
|
+
SCSS
|
105
111
|
when 'close.less'
|
106
112
|
# extract .close { button& {...} } rule
|
107
113
|
file = extract_nested_rule file, 'button&'
|
@@ -121,10 +127,7 @@ class Converter
|
|
121
127
|
when 'thumbnails.less', 'labels.less', 'badges.less', 'buttons.less'
|
122
128
|
file = extract_nested_rule file, 'a&'
|
123
129
|
when 'glyphicons.less'
|
124
|
-
file = replace_rules(file, /\s*@font-face/) { |rule|
|
125
|
-
rule = replace_all rule, /(\$icon-font(?:-\w+)+)/, '#{\1}'
|
126
|
-
replace_asset_url rule, :font
|
127
|
-
}
|
130
|
+
file = replace_rules(file, /\s*@font-face/) { |rule| replace_asset_url rule, :font }
|
128
131
|
when 'type.less'
|
129
132
|
file = apply_mixin_parent_selector(file, '\.(text|bg)-(success|primary|info|warning|danger)')
|
130
133
|
# .bg-primary will not get patched automatically as it includes an additional rule. fudge for now
|
@@ -320,10 +323,10 @@ SASS
|
|
320
323
|
%Q(@import "#{target_path}\\1";)
|
321
324
|
end
|
322
325
|
|
323
|
-
def replace_all(file, regex, replacement = nil, &block)
|
326
|
+
def replace_all(file, regex, replacement = nil, optional: false, &block)
|
324
327
|
log_transform regex, replacement
|
325
328
|
new_file = file.gsub(regex, replacement, &block)
|
326
|
-
raise "replace_all #{regex}, #{replacement} NO MATCH" if file == new_file
|
329
|
+
raise "replace_all #{regex}, #{replacement} NO MATCH" if !optional && file == new_file
|
327
330
|
new_file
|
328
331
|
end
|
329
332
|
|
@@ -460,7 +463,7 @@ SASS
|
|
460
463
|
def replace_ms_filters(file)
|
461
464
|
log_transform
|
462
465
|
file.gsub(
|
463
|
-
/filter: e\(%\("progid:DXImageTransform.Microsoft.gradient\(startColorstr='%d', endColorstr='%d', GradientType=(\d)\)",argb\(([\-$\w]+)\),argb\(([\-$\w]+)\)\)\);/,
|
466
|
+
/filter: e\(%\("progid:DXImageTransform.Microsoft.gradient\(startColorstr='%d', endColorstr='%d', GradientType=(\d)\)", ?argb\(([\-$\w]+)\), ?argb\(([\-$\w]+)\)\)\);/,
|
464
467
|
%Q(filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='\#{ie-hex-str(\\2)}', endColorstr='\#{ie-hex-str(\\3)}', GradientType=\\1);)
|
465
468
|
)
|
466
469
|
end
|
@@ -506,7 +509,8 @@ SASS
|
|
506
509
|
def replace_escaping(less)
|
507
510
|
less = less.gsub(/~"([^"]+)"/, '\1').gsub(/~'([^']+)'/, '\1') # Get rid of ~"" escape
|
508
511
|
less.gsub!(/\$\{([^}]+)\}/, '$\1') # Get rid of @{} escape
|
509
|
-
|
512
|
+
# interpolate variables in strings, e.g. url("$file-1x") => url("#{$file-1x}")
|
513
|
+
less.gsub!(/"[^"\n]*"/) { |str| str.gsub(/\$[^"\n$.\\]+/, '#{\0}') }
|
510
514
|
less.gsub(/(\W)e\(%\("?([^"]*)"?\)\)/, '\1\2') # Get rid of e(%("")) escape
|
511
515
|
end
|
512
516
|
|
data/tasks/converter/network.rb
CHANGED
@@ -32,7 +32,7 @@ class Converter
|
|
32
32
|
if File.directory?(full_path)
|
33
33
|
files.each do |name|
|
34
34
|
path = "#{full_path}/#{name}"
|
35
|
-
contents[name] = File.read(path, mode: 'rb') if File.
|
35
|
+
contents[name] = File.read(path, mode: 'rb') if File.exist?(path)
|
36
36
|
end
|
37
37
|
end
|
38
38
|
contents
|
@@ -51,7 +51,7 @@ class Converter
|
|
51
51
|
uri = URI(url)
|
52
52
|
cache_path = "./#@cache_path#{uri.path}#{uri.query.tr('?&=', '-') if uri.query}"
|
53
53
|
FileUtils.mkdir_p File.dirname(cache_path)
|
54
|
-
if File.
|
54
|
+
if File.exist?(cache_path)
|
55
55
|
log_http_get_file url, true
|
56
56
|
File.read(cache_path, mode: 'rb')
|
57
57
|
else
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Override Bootstrap variables here (defaults from bootstrap-sass v3.
|
1
|
+
// Override Bootstrap variables here (defaults from bootstrap-sass v3.4.0):
|
2
2
|
|
3
3
|
//
|
4
4
|
// Variables
|
@@ -52,14 +52,14 @@
|
|
52
52
|
|
53
53
|
// $font-size-base: 14px
|
54
54
|
// $font-size-large: ceil(($font-size-base * 1.25)) // ~18px
|
55
|
-
// $font-size-small: ceil(($font-size-base *
|
55
|
+
// $font-size-small: ceil(($font-size-base * .85)) // ~12px
|
56
56
|
|
57
57
|
// $font-size-h1: floor(($font-size-base * 2.6)) // ~36px
|
58
58
|
// $font-size-h2: floor(($font-size-base * 2.15)) // ~30px
|
59
59
|
// $font-size-h3: ceil(($font-size-base * 1.7)) // ~24px
|
60
60
|
// $font-size-h4: ceil(($font-size-base * 1.25)) // ~18px
|
61
61
|
// $font-size-h5: $font-size-base
|
62
|
-
// $font-size-h6: ceil(($font-size-base *
|
62
|
+
// $font-size-h6: ceil(($font-size-base * .85)) // ~12px
|
63
63
|
|
64
64
|
//** Unit-less `line-height` for use in components like buttons.
|
65
65
|
// $line-height-base: 1.428571429 // 20/14
|
@@ -117,7 +117,7 @@
|
|
117
117
|
//** Global background color for active items (e.g., navs or dropdowns).
|
118
118
|
// $component-active-bg: $brand-primary
|
119
119
|
|
120
|
-
//** Width of the `border` for generating carets that
|
120
|
+
//** Width of the `border` for generating carets that indicate dropdowns.
|
121
121
|
// $caret-width-base: 4px
|
122
122
|
//** Carets increase slightly in size for larger components.
|
123
123
|
// $caret-width-large: 5px
|
@@ -240,7 +240,7 @@
|
|
240
240
|
//** Background for the dropdown menu.
|
241
241
|
// $dropdown-bg: #fff
|
242
242
|
//** Dropdown menu `border-color`.
|
243
|
-
// $dropdown-border: rgba(0,0,0
|
243
|
+
// $dropdown-border: rgba(0, 0, 0, .15)
|
244
244
|
//** Dropdown menu `border-color` **for IE8**.
|
245
245
|
// $dropdown-fallback-border: #ccc
|
246
246
|
//** Divider color for between dropdown items.
|
@@ -546,7 +546,7 @@
|
|
546
546
|
//** Popover maximum width
|
547
547
|
// $popover-max-width: 276px
|
548
548
|
//** Popover border color
|
549
|
-
// $popover-border-color: rgba(0,0,0
|
549
|
+
// $popover-border-color: rgba(0, 0, 0, .2)
|
550
550
|
//** Popover fallback border color
|
551
551
|
// $popover-fallback-border-color: #ccc
|
552
552
|
|
@@ -604,7 +604,7 @@
|
|
604
604
|
//** Background color of modal content area
|
605
605
|
// $modal-content-bg: #fff
|
606
606
|
//** Modal content border color
|
607
|
-
// $modal-content-border-color: rgba(0,0,0
|
607
|
+
// $modal-content-border-color: rgba(0, 0, 0, .2)
|
608
608
|
//** Modal content border color **for IE8**
|
609
609
|
// $modal-content-fallback-border-color: #999
|
610
610
|
|
@@ -809,7 +809,7 @@
|
|
809
809
|
//
|
810
810
|
//##
|
811
811
|
|
812
|
-
// $carousel-text-shadow: 0 1px 2px rgba(0,0,0
|
812
|
+
// $carousel-text-shadow: 0 1px 2px rgba(0, 0, 0, .6)
|
813
813
|
|
814
814
|
// $carousel-control-color: #fff
|
815
815
|
// $carousel-control-width: 15%
|
@@ -869,5 +869,7 @@
|
|
869
869
|
// $page-header-border-color: $gray-lighter
|
870
870
|
//** Width of horizontal description list titles
|
871
871
|
// $dl-horizontal-offset: $component-offset-horizontal
|
872
|
+
//** Point at which .dl-horizontal becomes horizontal
|
873
|
+
// $dl-horizontal-breakpoint: $grid-float-breakpoint
|
872
874
|
//** Horizontal line color.
|
873
875
|
// $hr-border: $gray-lighter
|
data/test/compilation_test.rb
CHANGED
@@ -1,18 +1,30 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
require 'fileutils'
|
3
|
-
require '
|
3
|
+
require 'sassc'
|
4
4
|
|
5
5
|
class CompilationTest < Minitest::Test
|
6
|
-
def
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
def test_compilation_bootstrap
|
7
|
+
compile 'bootstrap'
|
8
|
+
assert true # nothing was raised
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_compilation_bootstrap_theme
|
12
|
+
compile 'bootstrap/theme'
|
13
|
+
assert true # nothing was raised
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def compile(file)
|
19
|
+
path = File.expand_path('../assets/stylesheets', __dir__)
|
20
|
+
FileUtils.rm_rf('.sass-cache', secure: true)
|
21
|
+
engine = SassC::Engine.new(
|
22
|
+
%Q{@import "#{path}/#{file}"},
|
23
|
+
syntax: :scss, load_paths: ['.']
|
24
|
+
)
|
25
|
+
FileUtils.mkdir_p("tmp/#{File.dirname(file)}")
|
26
|
+
File.open("tmp/#{file}.css", 'w') { |f|
|
27
|
+
f.write engine.render
|
28
|
+
}
|
17
29
|
end
|
18
30
|
end
|
@@ -12,13 +12,14 @@ end
|
|
12
12
|
|
13
13
|
require 'slim-rails'
|
14
14
|
require 'jquery-rails'
|
15
|
-
require '
|
15
|
+
require 'sassc-rails'
|
16
16
|
require 'bootstrap-sass'
|
17
17
|
require 'uglifier'
|
18
18
|
|
19
19
|
module Dummy
|
20
20
|
class Application < Rails::Application
|
21
21
|
config.assets.enabled = true if config.assets.respond_to?(:enabled)
|
22
|
+
config.assets.precompile += %w( application.css application.js )
|
22
23
|
config.to_prepare do
|
23
24
|
if ENV['VERBOSE']
|
24
25
|
STDERR.puts "Loaded Rails #{Rails::VERSION::STRING}, Sprockets #{Sprockets::VERSION}",
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Set up gems listed in the Gemfile.
|
2
2
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
|
3
3
|
|
4
|
-
require 'bundler/setup' if File.
|
4
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
5
5
|
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
|
@@ -1,13 +1,20 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'sassc'
|
2
4
|
require 'bootstrap-sass'
|
3
5
|
require 'fileutils'
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
+
load_path = ARGV[0]
|
8
|
+
out_path = ARGV[1]
|
9
|
+
|
10
|
+
output = SassC::Engine.new(
|
11
|
+
File.read(File.expand_path('./import_all.scss', __dir__)),
|
12
|
+
syntax: :scss, load_paths: ['.', load_path]
|
13
|
+
).render
|
7
14
|
|
8
|
-
if
|
9
|
-
FileUtils.mkdir_p
|
10
|
-
File.
|
15
|
+
if out_path
|
16
|
+
FileUtils.mkdir_p(File.dirname(out_path))
|
17
|
+
File.write(out_path, output)
|
11
18
|
else
|
12
|
-
puts
|
19
|
+
puts output
|
13
20
|
end
|
data/test/node_mincer_test.rb
CHANGED
@@ -22,15 +22,14 @@ class NodeMincerTest < Minitest::Test
|
|
22
22
|
|
23
23
|
def setup
|
24
24
|
tmp_dir = File.join GEM_PATH, 'tmp/node-mincer'
|
25
|
-
command = "node manifest.js #{tmp_dir}"
|
26
25
|
success = Dir.chdir DUMMY_PATH do
|
27
26
|
silence_stdout_if !ENV['VERBOSE'] do
|
28
|
-
system
|
27
|
+
system 'node', 'manifest.js', tmp_dir
|
29
28
|
end
|
30
29
|
end
|
31
30
|
assert success, 'Node.js Mincer compilation failed'
|
32
31
|
manifest = JSON.parse(File.read("#{tmp_dir}/manifest.json"))
|
33
|
-
css_name = manifest[
|
32
|
+
css_name = manifest['assets']['application.css']
|
34
33
|
@css = File.read("#{tmp_dir}/#{css_name}")
|
35
34
|
end
|
36
35
|
end
|
@@ -1,8 +1,9 @@
|
|
1
|
-
#!/bin/
|
1
|
+
#!/bin/bash
|
2
2
|
|
3
3
|
# Test compilation with node-sass binary
|
4
4
|
|
5
5
|
mkdir -p tmp/node-sass
|
6
|
-
node-sass assets/stylesheets/
|
7
|
-
node-sass assets/stylesheets/
|
6
|
+
node_modules/.bin/node-sass assets/stylesheets/_bootstrap.scss -o tmp/node-sass/bootstrap.css && \
|
7
|
+
node_modules/.bin/node-sass --include-path=assets/stylesheets/ \
|
8
|
+
assets/stylesheets/bootstrap/_theme.scss -o tmp/node-sass/bootstrap-theme.css || \
|
8
9
|
(echo "node-sass compilation failed" && exit 1)
|
data/test/sass_test.rb
CHANGED
@@ -1,23 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_helper'
|
2
4
|
require 'shellwords'
|
5
|
+
require 'fileutils'
|
6
|
+
require 'bootstrap-sass'
|
3
7
|
|
4
8
|
class SassTest < Minitest::Test
|
5
9
|
DUMMY_PATH = 'test/dummy_sass_only'
|
6
10
|
|
7
11
|
def test_font_helper
|
8
|
-
assert_match %r
|
12
|
+
assert_match %r{url\(['"]?.*eot['"]?\)}, @css
|
9
13
|
end
|
10
14
|
|
11
15
|
def setup
|
12
|
-
|
13
|
-
%x[rm -rf .sass-cache/]
|
14
|
-
%x[bundle]
|
15
|
-
end
|
16
|
+
FileUtils.rm_rf(File.join(DUMMY_PATH, '.sass-cache'), secure: true)
|
16
17
|
css_path = File.join GEM_PATH, 'tmp/bootstrap-sass-only.css'
|
17
|
-
command = "bundle exec ruby compile.rb #{Shellwords.escape css_path}"
|
18
18
|
success = Dir.chdir DUMMY_PATH do
|
19
19
|
silence_stdout_if !ENV['VERBOSE'] do
|
20
|
-
|
20
|
+
Bundler.with_original_env do
|
21
|
+
system('bundle') && system('bundle', 'exec', 'ruby', 'compile.rb',
|
22
|
+
Bootstrap.stylesheets_path, css_path)
|
23
|
+
end
|
21
24
|
end
|
22
25
|
end
|
23
26
|
assert success, 'Sass-only compilation failed'
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_helper'
|
2
4
|
require 'fileutils'
|
3
5
|
require 'find'
|
@@ -6,22 +8,24 @@ require 'shellwords'
|
|
6
8
|
class SprocketsRailsTest < Minitest::Test
|
7
9
|
|
8
10
|
def test_sprockets_digest_asset_refs
|
9
|
-
root
|
10
|
-
command = "bundle exec rake assets:precompile GEMFILE=#{GEM_PATH}/Gemfile RAILS_ENV=production"
|
11
|
+
root = 'test/dummy_rails'
|
11
12
|
compiled = Dir.chdir root do
|
12
13
|
silence_stderr_if !ENV['VERBOSE'] do
|
13
|
-
|
14
|
+
Bundler.with_original_env do
|
15
|
+
system({ 'BUNDLE_GEMFILE' => File.join(GEM_PATH, 'Gemfile'),
|
16
|
+
'RAILS_ENV' => 'production' },
|
17
|
+
'bundle && bundle exec rake assets:precompile')
|
18
|
+
end
|
14
19
|
end
|
15
20
|
end
|
16
21
|
assert compiled, 'Could not precompile assets'
|
17
22
|
Dir.glob(File.join(root, 'public', 'assets', 'app*.{css,js}')) do |path|
|
18
|
-
File.
|
19
|
-
|
20
|
-
|
21
|
-
end
|
23
|
+
File.read(path)
|
24
|
+
.scan(/url\("?[^"]+\.(?:jpg|png|eot|woff2?|ttf|svg)[^"]*"?\)/) do |m|
|
25
|
+
assert_match(/-[0-9a-f]{12,}\./, m)
|
22
26
|
end
|
23
27
|
end
|
24
28
|
ensure
|
25
|
-
FileUtils.rm_rf %W
|
29
|
+
FileUtils.rm_rf %W[#{root}/public/assets/ #{root}/tmp/cache/], secure: true
|
26
30
|
end
|
27
31
|
end
|
data/test/support/reporting.rb
CHANGED
@@ -14,4 +14,14 @@ module Kernel
|
|
14
14
|
run.call
|
15
15
|
end
|
16
16
|
end
|
17
|
+
|
18
|
+
def silence_stream(stream)
|
19
|
+
old_stream = stream.dup
|
20
|
+
stream.reopen(File::NULL)
|
21
|
+
stream.sync = true
|
22
|
+
yield
|
23
|
+
ensure
|
24
|
+
stream.reopen(old_stream)
|
25
|
+
old_stream.close
|
26
|
+
end unless method_defined?(:silence_stream)
|
17
27
|
end
|
data/test/test_helper.rb
CHANGED
@@ -10,7 +10,7 @@ Dir['test/support/**/*.rb'].each do |file|
|
|
10
10
|
require_relative File.join('.', file)
|
11
11
|
end
|
12
12
|
|
13
|
-
GEM_PATH = File.expand_path('../',
|
13
|
+
GEM_PATH = File.expand_path('../', __dir__)
|
14
14
|
|
15
15
|
#= Capybara + Poltergeist
|
16
16
|
require 'capybara/poltergeist'
|
@@ -26,10 +26,11 @@ Capybara.register_driver :poltergeist do |app|
|
|
26
26
|
end
|
27
27
|
|
28
28
|
Capybara.configure do |config|
|
29
|
+
config.server = :webrick
|
29
30
|
config.app_host = 'http://localhost:7000'
|
30
31
|
config.default_driver = :poltergeist
|
31
32
|
config.javascript_driver = :poltergeist
|
32
33
|
config.server_port = 7000
|
33
|
-
config.
|
34
|
+
config.default_max_wait_time = 10
|
34
35
|
end
|
35
36
|
|
metadata
CHANGED
@@ -1,73 +1,87 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas McDonald
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: sassc
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: autoprefixer-rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 5.
|
33
|
+
version: 5.2.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 5.
|
40
|
+
version: 5.2.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 5.
|
47
|
+
version: '5.11'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 5.
|
54
|
+
version: '5.11'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest-reporters
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: '1.3'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: '1.3'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: capybara
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.6'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.6'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: poltergeist
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - ">="
|
@@ -81,19 +95,19 @@ dependencies:
|
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
98
|
+
name: sassc-rails
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - ">="
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
103
|
+
version: 2.0.0
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
110
|
+
version: 2.0.0
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: actionpack
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -318,9 +332,11 @@ files:
|
|
318
332
|
- bootstrap-sass.gemspec
|
319
333
|
- bower.json
|
320
334
|
- composer.json
|
335
|
+
- eyeglass-exports.js
|
321
336
|
- lib/bootstrap-sass.rb
|
322
337
|
- lib/bootstrap-sass/engine.rb
|
323
338
|
- lib/bootstrap-sass/version.rb
|
339
|
+
- package-lock.json
|
324
340
|
- package.json
|
325
341
|
- sache.json
|
326
342
|
- tasks/bower.rake
|
@@ -334,7 +350,6 @@ files:
|
|
334
350
|
- templates/project/_bootstrap-variables.sass
|
335
351
|
- templates/project/manifest.rb
|
336
352
|
- templates/project/styles.sass
|
337
|
-
- test/compass_test.rb
|
338
353
|
- test/compilation_test.rb
|
339
354
|
- test/dummy_node_mincer/apple-touch-icon-144-precomposed.png
|
340
355
|
- test/dummy_node_mincer/application.css.ejs.scss
|
@@ -369,11 +384,8 @@ files:
|
|
369
384
|
- test/dummy_rails/log/.keep
|
370
385
|
- test/dummy_sass_only/Gemfile
|
371
386
|
- test/dummy_sass_only/compile.rb
|
372
|
-
- test/dummy_sass_only/import_all.
|
373
|
-
- test/gemfiles/
|
374
|
-
- test/gemfiles/sass_3_3.gemfile
|
375
|
-
- test/gemfiles/sass_3_4.gemfile
|
376
|
-
- test/gemfiles/sass_head.gemfile
|
387
|
+
- test/dummy_sass_only/import_all.scss
|
388
|
+
- test/gemfiles/default.gemfile
|
377
389
|
- test/node_mincer_test.rb
|
378
390
|
- test/node_sass_compile_test.sh
|
379
391
|
- test/pages_test.rb
|
@@ -403,12 +415,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
403
415
|
version: '0'
|
404
416
|
requirements: []
|
405
417
|
rubyforge_project:
|
406
|
-
rubygems_version: 2.
|
418
|
+
rubygems_version: 2.7.8
|
407
419
|
signing_key:
|
408
420
|
specification_version: 4
|
409
|
-
summary:
|
421
|
+
summary: bootstrap-sass is a Sass-powered version of Bootstrap 3, ready to drop right
|
422
|
+
into your Sass powered applications.
|
410
423
|
test_files:
|
411
|
-
- test/compass_test.rb
|
412
424
|
- test/compilation_test.rb
|
413
425
|
- test/dummy_node_mincer/apple-touch-icon-144-precomposed.png
|
414
426
|
- test/dummy_node_mincer/application.css.ejs.scss
|
@@ -443,11 +455,8 @@ test_files:
|
|
443
455
|
- test/dummy_rails/log/.keep
|
444
456
|
- test/dummy_sass_only/Gemfile
|
445
457
|
- test/dummy_sass_only/compile.rb
|
446
|
-
- test/dummy_sass_only/import_all.
|
447
|
-
- test/gemfiles/
|
448
|
-
- test/gemfiles/sass_3_3.gemfile
|
449
|
-
- test/gemfiles/sass_3_4.gemfile
|
450
|
-
- test/gemfiles/sass_head.gemfile
|
458
|
+
- test/dummy_sass_only/import_all.scss
|
459
|
+
- test/gemfiles/default.gemfile
|
451
460
|
- test/node_mincer_test.rb
|
452
461
|
- test/node_sass_compile_test.sh
|
453
462
|
- test/pages_test.rb
|