less-rails-bootstrap 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzBkMGEyODJjZWJhNjM1MmI3ZDJkYmUwM2NiM2ZkNGZkY2Y2Zjg0OA==
4
+ OTU1Y2UxM2QxZjc1YTY0ZDg1NWFjZjIxMGIxN2Y4YzJlNDI0YzU5MQ==
5
5
  data.tar.gz: !binary |-
6
- ZDU0MTk2ZTM4YTI4NTQ2NDUwZTUwZjg3MDRkOTc0NjM5ZDg5OGRkZA==
6
+ Zjg4MWQxMmJjOWIyNTg3OWU4N2UyMWExMTBlOTVmNjRiZmNmMTg4Yw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NDE1M2JkYTNmYWE4YTI1NTY3YmE2MmFmYzg4ZmRmYmQ3MDQ0MTUwZWM4ZDA4
10
- ZDdkYzE2M2U3YTY1ZmE2NmEwNjY5OThiZmE4NTk0NTU2MjAyNWMzZjQxMWQw
11
- OGJlNjU5ODgyZTRkZWJhZTgwZmY5OWVhM2YzYWRkMmZiZDA1NjU=
9
+ ZGRiMDFhYjBiMDBhYzAzMmU1ZTIzNzU2MTA5ZjYwNjEyNmIzNzBlNmQ1YTVl
10
+ MmQyZTVjM2E0YzhhN2NhNzkzMTJkOTU5MTg1YWVkYmEwMDllMTNjN2Y1NWVh
11
+ ZDdjMzMyZTM3Yzg1YTdmYWQxZTFhZTEwNjQwOGYyYjFkMmI3MTc=
12
12
  data.tar.gz: !binary |-
13
- NzQ2ODk5MWY3ZGUwMWY3ZjhmOGQ0OTU2ZDEwYjUyYmVkZjYyNGFlZDNjNGQz
14
- NDIzNDRiZDQ0NmE2YWIwM2QwODAzYTg3NDkwYjFjMDVhMGZjOWM1ODYzYmU2
15
- NTNjODg1YTEzY2VmNjZiOWM4ODJkZjYzNzgyYTNjMzNjOTdmYzU=
13
+ ZTY4MTZiMzIxNTcyODM1MDcyMzAxZWIzN2Y2OWI4YjgyNmYwNDAyNDJkZDMx
14
+ N2EyZmE3ZjI5NGFkN2I2MDUxYjVhOTQ5MTk4YmRiMzFiZWRiMzFkYzFhZTlm
15
+ NGU5ZDQxMzcwNzI1YmZmNTRkNWU3MTJmOWNjZTgzNDk2MTI4MjA=
data/.gitignore CHANGED
@@ -1,8 +1,11 @@
1
1
  *.gem
2
2
  .bundle
3
- Gemfile.lock
3
+ *.lock
4
4
  pkg/*
5
+ *.log
5
6
  test/dummy_app/log/*
7
+ test/dummy_app/tmp/*
6
8
  tmp/*
7
- .DS_Store
8
9
  twitter/
10
+ gemfiles/*.gemfile
11
+ test/dummy_app/tmp/
data/.travis.yml CHANGED
@@ -1,6 +1,13 @@
1
1
  rvm:
2
- - 1.8.7
3
2
  - 1.9.3
4
3
  - 2.0.0
5
- - jruby-18mode
6
4
  - jruby-19mode
5
+ before_install:
6
+ - gem install bundler
7
+ - bundle --version
8
+ install:
9
+ - bundle install
10
+ before_script:
11
+ - bundle exec rake appraisal:setup
12
+ script:
13
+ - bundle exec rake appraisal test
data/Appraisals ADDED
@@ -0,0 +1,11 @@
1
+ appraise "rails31" do
2
+ gem "rails", "~> 3.1.0"
3
+ end unless RUBY_VERSION == '2.0.0'
4
+
5
+ appraise "rails32" do
6
+ gem "rails", "~> 3.2.13"
7
+ end
8
+
9
+ appraise "rails40" do
10
+ gem "rails", "~> 4.0.0"
11
+ end
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ # 3.0.3 - unreleased
3
+
4
+ * Update to less-rails 2.4.2 or higher. Fix initializers for 2.4.2 too.
5
+ * Remove Rails 3.1 with Ruby 2.0 build support. Sprockets will not work!
6
+
2
7
  # 3.0.2 - 2013-09-01
3
8
 
4
9
  * Cross platform update script.
data/CONTRIBUTING.md CHANGED
@@ -3,7 +3,12 @@
3
3
  Here are the steps to update the version of twitter bootstrap used.
4
4
 
5
5
  * Clone this repository.
6
- * Run the `./scripts/update_bootstrap.sh` script with bootstrap repo
7
- version tag argument. For example `./scripts/update_bootstrap.sh v3.0.0`.
8
- * RUN THE TESTS!
9
- * Send pull request.
6
+ * Run the `./scripts/update_bootstrap.sh` script with bootstrap repo version tag argument. For example `./scripts/update_bootstrap.sh v3.0.0`.
7
+ * Make your changes
8
+ * Run the tests by doing:
9
+
10
+ ```
11
+ $ bundle install
12
+ $ bundle exec rake appraisal:setup
13
+ $ bundle exec rake appraisal test
14
+ ```
data/Gemfile CHANGED
@@ -2,6 +2,8 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
+ gem "appraisal"
6
+
5
7
  gem "therubyracer", ">= 0.10.1", :require => nil, :platforms => :ruby
6
8
  gem "therubyrhino", ">= 1.73.2", :require => nil, :platforms => :jruby
7
9
 
data/README.md CHANGED
@@ -85,16 +85,26 @@ Or include plugins individually.
85
85
  This gem will directly track the semantic versioning of the Twitter Bootstrap project. Our major and minor versions will always match to theirs, though we may have tiny patch level releases specific to this gem.
86
86
 
87
87
 
88
- ## Testing
88
+ ## Contributing
89
89
 
90
- Simple! Just clone the repo, then run `bundle install` and `bundle exec rake`. The tests will begin to run. We also use Travis CI to run our tests. The current build status is:
90
+ This gem is fully tested from Rails 3.1 to 4. We run our tests on [Travis CI](http://travis-ci.org/metaskills/less-rails-boostrap) in both Ruby 1.9, 2.0, and jRuby 1.9 mode. If you detect a problem, open up a github issue or fork the repo and help out. After you fork or clone the repository, the following commands will get you up and running on the test suite.
91
91
 
92
- We also have a test rails project setup using all the examples documented above. If you make a github issue and complain about something, I will likely forward you to this project.
92
+ ```shell
93
+ $ bundle install
94
+ $ bundle exec rake appraisal:setup
95
+ $ bundle exec rake appraisal test
96
+ ```
97
+
98
+ We use the [appraisal](https://github.com/thoughtbot/appraisal) gem from Thoughtbot to help us generate the individual gemfiles for each Rails version and to run the tests locally against each generated Gemfile. The `rake appraisal test` command actually runs our test suite against all Rails versions in our `Appraisal` file. If you want to run the tests for a specific Rails version, use `rake -T` for a list. For example, the following command will run the tests for Rails 3.2 only.
99
+
100
+ ```shell
101
+ $ bundle exec rake appraisal:rails32 test
102
+ ```
93
103
 
94
- [https://github.com/metaskills/less-rails-bootstrap-test](https://github.com/metaskills/less-rails-bootstrap-test)
104
+ Our current build status is:
105
+ [![Build Status](https://secure.travis-ci.org/metaskills/minitest-spec-rails.png)](http://travis-ci.org/metaskills/less-rails-bootstrap) read more in our [CONTRIBUTING](https://github.com/metaskills/less-rails-bootstrap/blob/master/CONTRIBUTING.md) file.
95
106
 
96
107
 
97
- ## [Contributing](https://github.com/metaskills/less-rails-bootstrap/blob/master/CONTRIBUTING.md)
98
108
 
99
109
  ## License
100
110
 
data/Rakefile CHANGED
@@ -1,14 +1,21 @@
1
1
  require 'bundler'
2
2
  require 'rake/testtask'
3
+ require 'appraisal'
3
4
 
4
5
  Bundler::GemHelper.install_tasks
5
6
 
6
7
  Rake::TestTask.new do |t|
7
8
  t.libs = ['lib','test']
8
- t.test_files = Dir.glob("test/**/*_spec.rb").sort
9
+ t.test_files = Dir.glob(["test/**/*_{spec,test}.rb"]).sort
9
10
  t.verbose = true
10
11
  end
11
12
 
12
13
  task :default => [:test]
13
14
  task :spec => [:test]
14
15
 
16
+ desc "Setup Appraisal."
17
+ task 'appraisal:setup' do
18
+ Rake::Task['appraisal:cleanup'].invoke
19
+ Rake::Task['appraisal:gemfiles'].invoke
20
+ Rake::Task['appraisal:install'].invoke
21
+ end
@@ -10,12 +10,13 @@ Gem::Specification.new do |gem|
10
10
  gem.homepage = 'http://github.com/metaskills/less-rails-bootstrap'
11
11
  gem.summary = 'CSS toolkit from Twitter For Rails 3.1 Asset Pipeline'
12
12
  gem.description = 'CSS toolkit from Twitter For Rails 3.1 Asset Pipeline. Best one of all!'
13
+ gem.license = 'MIT'
13
14
  gem.files = `git ls-files`.split("\n")
14
15
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
16
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
16
17
  gem.require_paths = ['lib']
17
- gem.add_runtime_dependency 'less-rails', '~> 2.3.1'
18
- gem.add_development_dependency 'minitest'
18
+ gem.add_runtime_dependency 'less-rails', '~> 2.4.2'
19
+ gem.add_development_dependency 'minitest', '~> 4.0'
19
20
  gem.add_development_dependency 'guard-minitest'
20
- gem.add_development_dependency 'rails', '~> 3.1'
21
+ gem.add_development_dependency 'rails', ['>= 3.1', '< 4.1']
21
22
  end
@@ -5,7 +5,7 @@ module Less
5
5
  module Bootstrap
6
6
  class Engine < ::Rails::Engine
7
7
 
8
- initializer 'less-rails-bootstrap.setup', :after => 'less-rails.after.load_config_initializers', :group => :all do |app|
8
+ initializer 'less-rails-bootstrap.setup', :after => 'less-rails.before.load_config_initializers', :group => :all do |app|
9
9
  app.config.less.paths << File.join(config.root, 'app', 'frameworks')
10
10
  end
11
11
 
@@ -1,7 +1,7 @@
1
1
  module Less
2
2
  module Rails
3
3
  module Bootstrap
4
- VERSION = "3.0.2"
4
+ VERSION = "3.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,34 @@
1
+ require 'spec_helper'
2
+ require 'rails/generators/test_case'
3
+ require 'generators/less_rails_bootstrap/custom_bootstrap/custom_bootstrap_generator'
4
+
5
+ class CustomBootstrapGeneratorTest < Rails::Generators::TestCase
6
+ tests LessRailsBootstrap::Generators::CustomBootstrapGenerator
7
+
8
+ destination Rails.root.join('tmp/generators')
9
+ setup :prepare_destination
10
+
11
+ def setup
12
+ run_generator
13
+ end
14
+
15
+ test "content of custom_bootstrap.less was changed" do
16
+ md5 = Digest::MD5.file(destination_root.join("app/assets/stylesheets/custom_bootstrap/custom_bootstrap.less")).hexdigest
17
+ assert_equal '1f5b67b27608c7c5db14ad0b9c6cacbb', md5,
18
+ 'Looks like content of custom_bootstrap.less was changed. Please, investigate the reason of this and fix test if these changes is appropriate.'
19
+ end
20
+
21
+ test "custom_bootstrap.less is generated" do
22
+ assert_file(destination_root.join("app/assets/stylesheets/custom_bootstrap/custom_bootstrap.less"), /@import/)
23
+ end
24
+
25
+ test "variables.less is generated" do
26
+ assert_file("app/assets/stylesheets/custom_bootstrap/variables.less",
27
+ "// Use this file to override Twitter Bootstrap variables or define own variables.\n")
28
+ end
29
+
30
+ test "mixins.less is generated" do
31
+ assert_file("app/assets/stylesheets/custom_bootstrap/mixins.less",
32
+ "// Use this file to override Twitter Bootstrap mixins or define own mixins.\n")
33
+ end
34
+ end
@@ -40,7 +40,7 @@ class UsageCssSpec < Less::Rails::Bootstrap::Spec
40
40
 
41
41
  it 'will render bootstrap variables' do
42
42
  link_color_line = line_for_framework_css('framework-linkColor')
43
- link_color_line.must_include 'color:#428bca;'
43
+ link_color_line.must_include 'color:#428bca'
44
44
  end
45
45
 
46
46
  end
@@ -20,7 +20,7 @@ class UsageJsSpec < Less::Rails::Bootstrap::Spec
20
20
 
21
21
  end
22
22
 
23
- describe 'individual.css.less' do
23
+ describe 'individual.js' do
24
24
 
25
25
  let(:individual_js) { dummy_asset('individual.js') }
26
26
 
@@ -11,9 +11,10 @@ module Dummy
11
11
  config.active_support.deprecation = :stderr
12
12
  config.cache_store = :memory_store
13
13
  config.consider_all_requests_local = true
14
+ config.eager_load = false
14
15
 
15
- config.assets.enabled = true
16
- config.assets.cache_store = config.cache_store
16
+ config.assets.enabled = true if ::Rails::VERSION::MAJOR < 4
17
+ config.assets.cache_store = [:file_store, "#{config.root}/tmp/cache/assets/"]
17
18
 
18
19
  end
19
20
  end
data/test/spec_helper.rb CHANGED
@@ -1,54 +1,76 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- Bundler.require
1
+ require 'bundler' ; Bundler.require :development, :test
4
2
  require 'less-rails-bootstrap'
5
3
  require 'minitest/autorun'
6
- require 'minitest/spec'
7
4
  require 'dummy_app/init'
5
+ require 'fileutils'
8
6
 
9
7
  module Less
10
8
  module Rails
11
9
  module Bootstrap
12
10
  class Spec < MiniTest::Spec
11
+
12
+ include FileUtils
13
+
14
+ class << self
15
+
16
+ def dummy_app
17
+ Dummy::Application
18
+ end
13
19
 
20
+ def dummy_tmp
21
+ "#{dummy_app.root}/tmp"
22
+ end
23
+
24
+ end
25
+
14
26
  before do
27
+ prepare_cache_dir
28
+ reset_config_options
15
29
  reset_caches
16
30
  end
17
-
18
-
19
- private
20
-
21
- def dummy_app
22
- Dummy::Application
23
- end
31
+
32
+ protected
33
+
34
+ delegate :dummy_app, :dummy_tmp, :to => :'self.class'
24
35
 
25
36
  def dummy_config
26
37
  dummy_app.config
27
38
  end
28
-
39
+
29
40
  def dummy_assets
30
41
  dummy_app.assets
31
42
  end
32
-
43
+
33
44
  def dummy_asset(name)
34
45
  dummy_assets[name].to_s.strip
35
46
  end
36
-
47
+
48
+ def reset_config_options
49
+ dummy_config.less.compress = false
50
+ end
51
+
37
52
  def reset_caches
38
- dummy_assets.version = SecureRandom.hex(32)
39
- dummy_assets.cache.clear
53
+ version = SecureRandom.hex(32)
54
+ dummy_config.assets.version = version
55
+ dummy_assets.version = version
56
+ cache = dummy_assets.cache
57
+ cache.respond_to?(:clear) ? cache.clear : rm_r("#{dummy_tmp}/cache/assets")
40
58
  end
41
59
 
60
+ def prepare_cache_dir
61
+ mkdir_p "#{dummy_tmp}/cache/assets"
62
+ end
63
+
42
64
  def project_root
43
65
  File.expand_path File.join(File.dirname(__FILE__), '..')
44
66
  end
45
-
67
+
46
68
  def project_app_twitter_bootstrap
47
69
  File.join project_root, 'app', 'frameworks'
48
70
  end
49
-
71
+
50
72
  end
51
- end
73
+ end
52
74
  end
53
75
  end
54
76
 
metadata CHANGED
@@ -1,40 +1,40 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: less-rails-bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-01 00:00:00.000000000 Z
11
+ date: 2013-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - ~>
17
17
  - !ruby/object:Gem::Version
18
- version: 2.3.1
18
+ version: 2.4.2
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
21
  - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 2.3.1
23
+ version: 2.4.2
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  name: less-rails
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - ! '>='
30
+ - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: '0'
32
+ version: '4.0'
33
33
  version_requirements: !ruby/object:Gem::Requirement
34
34
  requirements:
35
- - - ! '>='
35
+ - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: '0'
37
+ version: '4.0'
38
38
  type: :development
39
39
  prerelease: false
40
40
  name: minitest
@@ -55,14 +55,20 @@ dependencies:
55
55
  - !ruby/object:Gem::Dependency
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ~>
58
+ - - ! '>='
59
59
  - !ruby/object:Gem::Version
60
60
  version: '3.1'
61
+ - - <
62
+ - !ruby/object:Gem::Version
63
+ version: '4.1'
61
64
  version_requirements: !ruby/object:Gem::Requirement
62
65
  requirements:
63
- - - ~>
66
+ - - ! '>='
64
67
  - !ruby/object:Gem::Version
65
68
  version: '3.1'
69
+ - - <
70
+ - !ruby/object:Gem::Version
71
+ version: '4.1'
66
72
  type: :development
67
73
  prerelease: false
68
74
  name: rails
@@ -75,6 +81,7 @@ extra_rdoc_files: []
75
81
  files:
76
82
  - .gitignore
77
83
  - .travis.yml
84
+ - Appraisals
78
85
  - CHANGELOG.md
79
86
  - CONTRIBUTING.md
80
87
  - Gemfile
@@ -147,6 +154,7 @@ files:
147
154
  - lib/less/rails/bootstrap/version.rb
148
155
  - scripts/update_bootstrap.sh
149
156
  - test/cases/engine_spec.rb
157
+ - test/cases/generators/custom_bootstrap_generator_test.rb
150
158
  - test/cases/usage_css_spec.rb
151
159
  - test/cases/usage_js_spec.rb
152
160
  - test/dummy_app/app/assets/javascripts/application.js
@@ -158,7 +166,8 @@ files:
158
166
  - test/dummy_app/init.rb
159
167
  - test/spec_helper.rb
160
168
  homepage: http://github.com/metaskills/less-rails-bootstrap
161
- licenses: []
169
+ licenses:
170
+ - MIT
162
171
  metadata: {}
163
172
  post_install_message:
164
173
  rdoc_options: []
@@ -182,6 +191,7 @@ specification_version: 4
182
191
  summary: CSS toolkit from Twitter For Rails 3.1 Asset Pipeline
183
192
  test_files:
184
193
  - test/cases/engine_spec.rb
194
+ - test/cases/generators/custom_bootstrap_generator_test.rb
185
195
  - test/cases/usage_css_spec.rb
186
196
  - test/cases/usage_js_spec.rb
187
197
  - test/dummy_app/app/assets/javascripts/application.js