twbs_sass_rails 0.2.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -8
- data/CONTRIBUTING.md +4 -4
- data/Gemfile.lock +52 -65
- data/LICENSE +2 -2
- data/README.md +48 -18
- data/Rakefile +67 -32
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +23 -8
- data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.svg +200 -199
- data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/gemfiles/Gemfile.rails-3.2.x +2 -3
- data/gemfiles/Gemfile.rails-4.0.x +2 -3
- data/lib/generators/twbs_sass_rails/install/install_generator.rb +2 -2
- data/lib/generators/twbs_sass_rails/install/templates/{twbs-variables.css.less → twbs-variables.css.scss} +4 -3
- data/lib/generators/twbs_sass_rails/install/templates/{twbs.css.less → twbs.css.scss} +12 -7
- data/lib/twbs_sass_rails/version.rb +1 -1
- data/test/dummy/app/assets/stylesheets/{default-twbs.css.less → default-twbs.css.scss} +0 -0
- data/test/dummy/app/assets/stylesheets/test.css.scss +9 -0
- data/test/dummy/app/assets/stylesheets/twbs-variables.css.scss +7 -0
- data/test/dummy/app/assets/stylesheets/{twbs.css.less → twbs.css.scss} +12 -7
- data/test/dummy/config/application.rb +4 -1
- data/test/dummy/config/environments/development.rb +1 -1
- data/test/generators/install_generator_test.rb +4 -4
- data/test/integration/assets_precompile_integration_test.rb +11 -5
- data/test/integration/twbs_sass_rails_integration_test.rb +8 -7
- data/test/test_helper.rb +2 -4
- data/twbs_sass_rails.gemspec +6 -9
- data/vendor/assets/javascripts/respond.js +223 -212
- data/vendor/assets/javascripts/twbs/bootstrap/affix.js +36 -25
- data/vendor/assets/javascripts/twbs/bootstrap/alert.js +7 -17
- data/vendor/assets/javascripts/twbs/bootstrap/button.js +26 -28
- data/vendor/assets/javascripts/twbs/bootstrap/carousel.js +22 -34
- data/vendor/assets/javascripts/twbs/bootstrap/collapse.js +9 -18
- data/vendor/assets/javascripts/twbs/bootstrap/dropdown.js +25 -32
- data/vendor/assets/javascripts/twbs/bootstrap/modal.js +27 -30
- data/vendor/assets/javascripts/twbs/bootstrap/popover.js +16 -23
- data/vendor/assets/javascripts/twbs/bootstrap/scrollspy.js +19 -24
- data/vendor/assets/javascripts/twbs/bootstrap/tab.js +10 -20
- data/vendor/assets/javascripts/twbs/bootstrap/tooltip.js +54 -41
- data/vendor/assets/javascripts/twbs/bootstrap/transition.js +13 -21
- data/vendor/assets/stylesheets/fontawesome/_bordered-pulled.scss +16 -0
- data/vendor/assets/stylesheets/fontawesome/_core.scss +12 -0
- data/vendor/assets/stylesheets/fontawesome/_extras.scss +44 -0
- data/vendor/assets/stylesheets/fontawesome/_fixed-width.scss +6 -0
- data/vendor/assets/stylesheets/fontawesome/_icons.scss +412 -0
- data/vendor/assets/stylesheets/fontawesome/_larger.scss +13 -0
- data/vendor/assets/stylesheets/fontawesome/_list.scss +19 -0
- data/vendor/assets/stylesheets/fontawesome/_mixins.scss +20 -0
- data/vendor/assets/stylesheets/fontawesome/_path.scss +14 -0
- data/vendor/assets/stylesheets/fontawesome/_rotated-flipped.scss +9 -0
- data/vendor/assets/stylesheets/fontawesome/_spinning.scss +30 -0
- data/vendor/assets/stylesheets/fontawesome/_stacked.scss +20 -0
- data/vendor/assets/stylesheets/fontawesome/_variables.scss +381 -0
- data/vendor/assets/stylesheets/fontawesome/font-awesome.scss +17 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{alerts.less → _alerts.scss} +10 -10
- data/vendor/assets/stylesheets/twbs/bootstrap/{badges.less → _badges.scss} +19 -15
- data/vendor/assets/stylesheets/twbs/bootstrap/_breadcrumbs.scss +26 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{button-groups.less → _button-groups.scss} +38 -60
- data/vendor/assets/stylesheets/twbs/bootstrap/{buttons.less → _buttons.scss} +28 -34
- data/vendor/assets/stylesheets/twbs/bootstrap/{carousel.less → _carousel.scss} +38 -19
- data/vendor/assets/stylesheets/twbs/bootstrap/_close.scss +35 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_code.scss +63 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{component-animations.less → _component-animations.scss} +2 -2
- data/vendor/assets/stylesheets/twbs/bootstrap/{dropdowns.less → _dropdowns.scss} +53 -33
- data/vendor/assets/stylesheets/twbs/bootstrap/{forms.less → _forms.scss} +133 -79
- data/vendor/assets/stylesheets/twbs/bootstrap/{glyphicons.less → _glyphicons.scss} +16 -19
- data/vendor/assets/stylesheets/twbs/bootstrap/_grid.scss +100 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{input-groups.less → _input-groups.scss} +58 -29
- data/vendor/assets/stylesheets/twbs/bootstrap/_jumbotron.scss +44 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{labels.less → _labels.scss} +14 -8
- data/vendor/assets/stylesheets/twbs/bootstrap/_list-group.scss +110 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{media.less → _media.scss} +0 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_mixins.scss +931 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{modals.less → _modals.scss} +37 -40
- data/vendor/assets/stylesheets/twbs/bootstrap/_navbar.scss +620 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{navs.less → _navs.scss} +41 -52
- data/vendor/assets/stylesheets/twbs/bootstrap/{normalize.less → _normalize.scss} +148 -121
- data/vendor/assets/stylesheets/twbs/bootstrap/{pager.less → _pager.scss} +8 -8
- data/vendor/assets/stylesheets/twbs/bootstrap/_pagination.scss +88 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_panels.scss +230 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{popovers.less → _popovers.scss} +36 -36
- data/vendor/assets/stylesheets/twbs/bootstrap/{print.less → _print.scss} +6 -5
- data/vendor/assets/stylesheets/twbs/bootstrap/_progress-bars.scss +80 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_responsive-utilities.scss +80 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{scaffolding.less → _scaffolding.scss} +39 -24
- data/vendor/assets/stylesheets/twbs/bootstrap/{tables.less → _tables.scss} +42 -48
- data/vendor/assets/stylesheets/twbs/bootstrap/_theme.scss +247 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_thumbnails.scss +38 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_tooltip.scss +95 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/_type.scss +296 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{utilities.less → _utilities.scss} +14 -3
- data/vendor/assets/stylesheets/twbs/bootstrap/_variables.scss +831 -0
- data/vendor/assets/stylesheets/twbs/bootstrap/{wells.less → _wells.scss} +6 -6
- data/vendor/assets/stylesheets/twbs/bootstrap/bootstrap.scss +48 -0
- data/vendor/assets/stylesheets/twbs/{bootstrap.less → bootstrap.scss} +0 -0
- metadata +94 -134
- data/test/dummy/app/assets/stylesheets/test.css.less +0 -5
- data/test/dummy/app/assets/stylesheets/twbs-variables.css.less +0 -6
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/db/.keep +0 -0
- data/vendor/assets/stylesheets/fontawesome/bootstrap.less +0 -84
- data/vendor/assets/stylesheets/fontawesome/core.less +0 -129
- data/vendor/assets/stylesheets/fontawesome/extras.less +0 -93
- data/vendor/assets/stylesheets/fontawesome/font-awesome.less +0 -33
- data/vendor/assets/stylesheets/fontawesome/icons.less +0 -381
- data/vendor/assets/stylesheets/fontawesome/mixins.less +0 -48
- data/vendor/assets/stylesheets/fontawesome/path.less +0 -14
- data/vendor/assets/stylesheets/fontawesome/variables.less +0 -735
- data/vendor/assets/stylesheets/twbs/bootstrap/bootstrap.less +0 -58
- data/vendor/assets/stylesheets/twbs/bootstrap/breadcrumbs.less +0 -23
- data/vendor/assets/stylesheets/twbs/bootstrap/close.less +0 -33
- data/vendor/assets/stylesheets/twbs/bootstrap/code.less +0 -56
- data/vendor/assets/stylesheets/twbs/bootstrap/grid.less +0 -346
- data/vendor/assets/stylesheets/twbs/bootstrap/jumbotron.less +0 -40
- data/vendor/assets/stylesheets/twbs/bootstrap/list-group.less +0 -88
- data/vendor/assets/stylesheets/twbs/bootstrap/mixins.less +0 -744
- data/vendor/assets/stylesheets/twbs/bootstrap/navbar.less +0 -621
- data/vendor/assets/stylesheets/twbs/bootstrap/pagination.less +0 -85
- data/vendor/assets/stylesheets/twbs/bootstrap/panels.less +0 -143
- data/vendor/assets/stylesheets/twbs/bootstrap/progress-bars.less +0 -96
- data/vendor/assets/stylesheets/twbs/bootstrap/responsive-utilities.less +0 -220
- data/vendor/assets/stylesheets/twbs/bootstrap/theme.less +0 -244
- data/vendor/assets/stylesheets/twbs/bootstrap/thumbnails.less +0 -32
- data/vendor/assets/stylesheets/twbs/bootstrap/tooltip.less +0 -95
- data/vendor/assets/stylesheets/twbs/bootstrap/type.less +0 -271
- data/vendor/assets/stylesheets/twbs/bootstrap/variables.less +0 -635
Binary file
|
Binary file
|
@@ -23,8 +23,8 @@ module TwbsSassRails
|
|
23
23
|
|
24
24
|
def copy_bootstrap
|
25
25
|
copy_file 'twbs.js.coffee', 'app/assets/javascripts/twbs.js.coffee'
|
26
|
-
copy_file 'twbs-variables.css.
|
27
|
-
copy_file 'twbs.css.
|
26
|
+
copy_file 'twbs-variables.css.scss', 'app/assets/stylesheets/twbs-variables.css.scss'
|
27
|
+
copy_file 'twbs.css.scss', 'app/assets/stylesheets/twbs.css.scss'
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -1,10 +1,15 @@
|
|
1
|
-
@import "twbs/bootstrap";
|
2
|
-
//@import "twbs/bootstrap/theme";
|
3
|
-
//@import "twbs/bootstrap/glyphicons";
|
4
|
-
@import "fontawesome/font-awesome";
|
5
|
-
|
6
1
|
/* Use twbs-variables to define new variables and override Bootstrap defaults.
|
7
|
-
* Import "twbs-variables
|
2
|
+
* Import "twbs-variables" instead of "twbs/bootstrap/variables"
|
8
3
|
* in each new stylesheet.
|
9
4
|
*/
|
10
|
-
@import "twbs-variables
|
5
|
+
@import "twbs-variables";
|
6
|
+
|
7
|
+
/* Start editing below this line */
|
8
|
+
@import "twbs/bootstrap";
|
9
|
+
|
10
|
+
/* Bootstrap Theme */
|
11
|
+
//@import "twbs/bootstrap/theme";
|
12
|
+
|
13
|
+
/* Glyphs */
|
14
|
+
//@import "twbs/bootstrap/glyphicons";
|
15
|
+
//@import "fontawesome/font-awesome";
|
File without changes
|
@@ -1,10 +1,15 @@
|
|
1
|
-
@import "twbs/bootstrap";
|
2
|
-
@import "twbs/bootstrap/theme";
|
3
|
-
@import "twbs/bootstrap/glyphicons";
|
4
|
-
@import "fontawesome/font-awesome";
|
5
|
-
|
6
1
|
/* Use twbs-variables to define new variables and override Bootstrap defaults.
|
7
|
-
* Import "twbs-variables
|
2
|
+
* Import "twbs-variables" instead of "twbs/bootstrap/variables"
|
8
3
|
* in each new stylesheet.
|
9
4
|
*/
|
10
|
-
@import "twbs-variables
|
5
|
+
@import "twbs-variables";
|
6
|
+
|
7
|
+
/* Start editing below this line */
|
8
|
+
@import "twbs/bootstrap";
|
9
|
+
|
10
|
+
/* Bootstrap Theme */
|
11
|
+
//@import "twbs/bootstrap/theme";
|
12
|
+
|
13
|
+
/* Glyphs */
|
14
|
+
@import "twbs/bootstrap/glyphicons";
|
15
|
+
@import "fontawesome/font-awesome";
|
@@ -1,6 +1,9 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
|
-
require
|
3
|
+
require "action_controller/railtie"
|
4
|
+
require "action_mailer/railtie"
|
5
|
+
require "sprockets/railtie"
|
6
|
+
require "rails/test_unit/railtie"
|
4
7
|
|
5
8
|
Bundler.require(*Rails.groups)
|
6
9
|
require "twbs_sass_rails"
|
@@ -20,7 +20,7 @@ Dummy::Application.configure do
|
|
20
20
|
config.active_support.deprecation = :log
|
21
21
|
|
22
22
|
# Raise an error on page load if there are pending migrations
|
23
|
-
config.active_record.migration_error = :page_load
|
23
|
+
# config.active_record.migration_error = :page_load
|
24
24
|
|
25
25
|
# Debug mode disables concatenation and preprocessing of assets.
|
26
26
|
# This option may cause significant delays in view rendering with a large
|
@@ -9,12 +9,12 @@ class InstallGeneratorTest < ::Rails::Generators::TestCase
|
|
9
9
|
test "Assert all files are properly created" do
|
10
10
|
run_generator
|
11
11
|
assert_file 'app/assets/stylesheets/application.css'
|
12
|
-
assert_file 'app/assets/stylesheets/twbs-variables.css.
|
13
|
-
template_file = File.expand_path('../../lib/generators/twbs_sass_rails/install/templates/twbs-variables.css.
|
12
|
+
assert_file 'app/assets/stylesheets/twbs-variables.css.scss' do |file_content|
|
13
|
+
template_file = File.expand_path('../../lib/generators/twbs_sass_rails/install/templates/twbs-variables.css.scss', File.dirname(__FILE__))
|
14
14
|
assert_match file_content, File.read(template_file)
|
15
15
|
end
|
16
|
-
assert_file 'app/assets/stylesheets/twbs.css.
|
17
|
-
template_file = File.expand_path('../../lib/generators/twbs_sass_rails/install/templates/twbs.css.
|
16
|
+
assert_file 'app/assets/stylesheets/twbs.css.scss' do |file_content|
|
17
|
+
template_file = File.expand_path('../../lib/generators/twbs_sass_rails/install/templates/twbs.css.scss', File.dirname(__FILE__))
|
18
18
|
assert_match file_content, File.read(template_file)
|
19
19
|
end
|
20
20
|
assert_file 'app/assets/javascripts/application.js'
|
@@ -4,11 +4,11 @@ describe "assets precompile in production environment integration" do
|
|
4
4
|
FileUtils::rm_rf 'test/dummy/public/assets'
|
5
5
|
system 'cd test/dummy && RAILS_ENV=production rake assets:precompile'
|
6
6
|
|
7
|
-
it "provides
|
7
|
+
it "provides Respond.js" do
|
8
8
|
visit "/assets/#{get_asset_name('respond','js')}"
|
9
9
|
end
|
10
10
|
|
11
|
-
it "provides
|
11
|
+
it "provides Font Awesome" do
|
12
12
|
['eot', 'svg', 'ttf', 'woff'].each do |fmt|
|
13
13
|
font_file = get_asset_name('fontawesome-webfont', fmt)
|
14
14
|
# NOTE: Rails 3 skips fingerprint when asset has parameters.
|
@@ -20,7 +20,7 @@ describe "assets precompile in production environment integration" do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
it "provides
|
23
|
+
it "provides Glyphicons" do
|
24
24
|
['eot', 'svg', 'ttf', 'woff'].each do |fmt|
|
25
25
|
font_file = get_asset_name('glyphicons-halflings-regular', fmt)
|
26
26
|
# NOTE: Rails 3 skips fingerprint when asset has parameters.
|
@@ -34,12 +34,18 @@ describe "assets precompile in production environment integration" do
|
|
34
34
|
|
35
35
|
it "overrides Bootstrap variables" do
|
36
36
|
visit "/assets/#{get_asset_name('application', 'css')}"
|
37
|
-
|
37
|
+
color = Rails.version.start_with?('3') ? 'color: #d10d10;' : 'color:#d10d10'
|
38
|
+
hover_color = Rails.version.start_with?('3') ? 'color: #89090a;' : 'color:#89090a'
|
39
|
+
page.text.must_include color
|
40
|
+
page.text.must_include hover_color # automatically generated hover
|
38
41
|
end
|
39
42
|
|
40
43
|
it "overrides Bootstrap variables in user stylesheets" do
|
41
44
|
visit "/assets/#{get_asset_name('application', 'css')}"
|
42
|
-
|
45
|
+
test_class = Rails.version.start_with?('3') ? '.test-class { color: #d10d10; }' : '.test-class{color:#d10d10}'
|
46
|
+
test_hover_class = Rails.version.start_with?('3') ? '.test-hover-class { color: #89090a; }' : '.test-hover-class{color:#89090a}'
|
47
|
+
page.text.must_include test_class
|
48
|
+
page.text.must_include test_hover_class
|
43
49
|
end
|
44
50
|
|
45
51
|
private
|
@@ -1,34 +1,35 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
describe "twbs sass rails integration" do
|
4
|
-
it "does not
|
4
|
+
it "does not include icons by default" do
|
5
5
|
visit '/assets/default-twbs.css'
|
6
6
|
page.text.wont_include 'Glyphicons Halflings'
|
7
|
+
page.text.wont_include 'FontAwesome'
|
7
8
|
end
|
8
9
|
|
9
|
-
it "provides
|
10
|
+
it "provides Bootstrap stylesheets on the asset pipeline" do
|
10
11
|
visit '/assets/application.css'
|
11
|
-
page.text.must_include '
|
12
|
+
page.text.must_include 'MIT License'
|
12
13
|
end
|
13
14
|
|
14
|
-
it "provides
|
15
|
+
it "provides Bootstrap javscripts on the asset pipeline" do
|
15
16
|
visit '/assets/application.js'
|
16
17
|
page.text.must_include '* Bootstrap'
|
17
18
|
end
|
18
19
|
|
19
|
-
it "provides
|
20
|
+
it "provides Respond.js on the asset pipeline" do
|
20
21
|
visit '/assets/respond.js'
|
21
22
|
page.text.must_include 'Respond.js'
|
22
23
|
end
|
23
24
|
|
24
|
-
it "provides
|
25
|
+
it "provides Font Awesome on the asset pipeline" do
|
25
26
|
visit '/assets/fontawesome-webfont.eot'
|
26
27
|
visit '/assets/fontawesome-webfont.svg'
|
27
28
|
visit '/assets/fontawesome-webfont.ttf'
|
28
29
|
visit '/assets/fontawesome-webfont.woff'
|
29
30
|
end
|
30
31
|
|
31
|
-
it "provides
|
32
|
+
it "provides Glyphicons on the asset pipeline" do
|
32
33
|
visit '/assets/glyphicons-halflings-regular.eot'
|
33
34
|
visit '/assets/glyphicons-halflings-regular.svg'
|
34
35
|
visit '/assets/glyphicons-halflings-regular.ttf'
|
data/test/test_helper.rb
CHANGED
@@ -11,15 +11,13 @@ end
|
|
11
11
|
|
12
12
|
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
13
13
|
|
14
|
+
require 'minitest/autorun'
|
15
|
+
|
14
16
|
require 'rails/test_help'
|
15
17
|
Rails.backtrace_cleaner.remove_silencers!
|
16
18
|
|
17
|
-
require 'minitest/autorun'
|
18
19
|
require 'capybara/rails'
|
19
20
|
|
20
|
-
require 'debugger'
|
21
|
-
Debugger.settings[:autoeval] = true
|
22
|
-
|
23
21
|
require 'turn'
|
24
22
|
Turn.config.format = :cool
|
25
23
|
Turn.config.natural = true
|
data/twbs_sass_rails.gemspec
CHANGED
@@ -10,25 +10,22 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.authors = ['diowa']
|
11
11
|
s.email = ['dev@diowa.com']
|
12
12
|
s.homepage = 'https://github.com/diowa/twbs_sass_rails'
|
13
|
-
s.summary = 'Bootstrap
|
14
|
-
s.description =
|
15
|
-
s.license = 'BSD
|
13
|
+
s.summary = 'Bootstrap and FontAwesome assets in Rails applications'
|
14
|
+
s.description = 'Provides assets for Bootstrap and FontAwesome in your Rails application.'
|
15
|
+
s.license = 'BSD-2-Clause'
|
16
16
|
|
17
17
|
s.files = `git ls-files`.split("\n") - `git ls-files -- {src/*,".*"}`.split("\n")
|
18
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ['lib']
|
21
21
|
|
22
|
-
s.add_runtime_dependency 'rails', '>= 3.2.
|
23
|
-
s.add_runtime_dependency '
|
24
|
-
s.add_runtime_dependency 'less-rails'
|
22
|
+
s.add_runtime_dependency 'rails', '>= 3.2.16'
|
23
|
+
s.add_runtime_dependency 'sass-rails', '>= 3.2'
|
25
24
|
|
26
25
|
s.add_development_dependency 'capybara'
|
27
26
|
s.add_development_dependency 'coveralls'
|
28
|
-
s.add_development_dependency '
|
29
|
-
s.add_development_dependency 'minitest', '~> 4'
|
27
|
+
s.add_development_dependency 'minitest', '~> 4' # NOTE: version 5 is not supported by Rails 4.0
|
30
28
|
s.add_development_dependency 'rake'
|
31
29
|
s.add_development_dependency 'simplecov'
|
32
|
-
s.add_development_dependency 'sqlite3'
|
33
30
|
s.add_development_dependency 'turn'
|
34
31
|
end
|