less-rails 2.8.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fe9397581bb0fdd5aaeb11cd2c0d1b2517678e3
4
- data.tar.gz: ccbc64b1095619266a377808b8800cb9a0e53189
3
+ metadata.gz: a5a9bb17b24c9e112ac835768320e84beb41b31f
4
+ data.tar.gz: 81848fe2b108c8a135ffe4faa6c20d9b4f4c94e8
5
5
  SHA512:
6
- metadata.gz: 9309e8ddb0b87e1d44cd60395c85e03e58c9eb0dd0398cc6c5507d4a1b0e5bcd656ab1ac193314cae2355fbd2523a56cdd136b8bf67d45ba3cae2cd734e47f04
7
- data.tar.gz: 6f9a8baca9fe6539bfc7dcf8c00b39f2c9d4ed08c5c7aa4d577b58df016ca679dc573474a830fff55b6c051d170470ad90a5719090c0d149312f634e746a8d4a
6
+ metadata.gz: 22858f553f73f72e4156adeeb0ff08a6d06ab0d2101ae255530383a89df83f9989f0c41c9050d3d899b0ff5a57c683b4e9158e0e16407e55237bfaf1fa82fa24
7
+ data.tar.gz: 2450a2536ea9e4178a28b2de71a671cf64641a34dcc652c248dddf76bcbb1dd04a7cd3e4a593d778526be2c42cf1e9f9d52099ac2fd96a6dba3d1b6bd1813565
data/.gitignore CHANGED
@@ -5,4 +5,5 @@ pkg/*
5
5
  *.log
6
6
  tmp/*
7
7
  test/dummy_app/tmp/cache/assets/*
8
- gemfiles/*.gemfile
8
+ *.gemfile.lock
9
+ Gemfile.lock
@@ -1,14 +1,37 @@
1
+ language: ruby
2
+ cache: bundler
3
+ sudo: false
1
4
  rvm:
2
- - 1.9.3
3
- - 2.0.0
4
- - 2.1.4
5
- - jruby-19mode
5
+ - 1.9.3-p551
6
+ - 2.0.0-p648
7
+ - 2.1.10
8
+ - 2.2.7
9
+ - 2.3.4
10
+ - 2.4.1
11
+ - jruby-9.1.9.0
6
12
  before_install:
7
- - travis_retry gem install bundler
8
- - bundle --version
9
- install:
10
- - travis_retry bundle install
11
- before_script:
12
- - travis_retry bundle exec appraisal install
13
- script:
14
- - bundle exec appraisal rake test
13
+ - gem install bundler
14
+ gemfile:
15
+ - gemfiles/rails40.gemfile
16
+ - gemfiles/rails41.gemfile
17
+ - gemfiles/rails42.gemfile
18
+ - gemfiles/rails50.gemfile
19
+ - gemfiles/rails51.gemfile
20
+ matrix:
21
+ exclude:
22
+ - rvm: 1.9.3-p551
23
+ gemfile: gemfiles/rails50.gemfile
24
+ - rvm: 1.9.3-p551
25
+ gemfile: gemfiles/rails51.gemfile
26
+ - rvm: 2.0.0-p648
27
+ gemfile: gemfiles/rails50.gemfile
28
+ - rvm: 2.0.0-p648
29
+ gemfile: gemfiles/rails51.gemfile
30
+ - rvm: 2.1.10
31
+ gemfile: gemfiles/rails50.gemfile
32
+ - rvm: 2.1.10
33
+ gemfile: gemfiles/rails51.gemfile
34
+ - rvm: 2.4.1
35
+ gemfile: gemfiles/rails40.gemfile
36
+ - rvm: 2.4.1
37
+ gemfile: gemfiles/rails41.gemfile
data/Appraisals CHANGED
@@ -1,11 +1,19 @@
1
1
  appraise 'rails40' do
2
- gem 'rails', '~> 4.0.11'
2
+ gem 'rails', '~> 4.0.13'
3
3
  end
4
4
 
5
5
  appraise 'rails41' do
6
- gem 'rails', '~> 4.1.7'
6
+ gem 'rails', '~> 4.1.16'
7
7
  end
8
8
 
9
9
  appraise 'rails42' do
10
- gem 'rails', '~> 4.2.1'
10
+ gem 'rails', '~> 4.2.8'
11
+ end
12
+
13
+ appraise 'rails50' do
14
+ gem 'rails', '~> 5.0.3'
15
+ end
16
+
17
+ appraise 'rails51' do
18
+ gem 'rails', '~> 5.1.1'
11
19
  end
@@ -1,6 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
- ### 2.8.0 - ?
3
+ ### 3.0.0 - 2017-10-02
4
+
5
+ * Solve deprecation warning via Grease adapter!
6
+
7
+ ### 2.8.0 - 2016-10-12
4
8
 
5
9
  * Make it possible to pass parameters to less.rb
6
10
  Fixes https://github.com/metaskills/less-rails/issues/94
data/README.md CHANGED
@@ -10,7 +10,7 @@ This gem provides integration for Rails projects using the Less stylesheet langu
10
10
  Just bundle up less-rails in your Gemfile. This will pull in less as a runtime dependency too.
11
11
 
12
12
  ```ruby
13
- gem 'less-rails', '~> 2.7.0'
13
+ gem 'less-rails', '~> 3.0.0'
14
14
  ```
15
15
 
16
16
  But be warned, less.rb relies on a JavaScript runtime gem too. Just like ExecJS, it will look for a gem that is appropriate to your system. Typically, this means you will need one of the following.
@@ -125,12 +125,12 @@ We also have a generator for rails scaffold CSS. Just like the Sass gem, we simp
125
125
 
126
126
  ## Contributing
127
127
 
128
- This gem is fully tested from Rails 4.0 to Rails 4.2. We run our tests on [Travis CI](http://travis-ci.org/metaskills/less-rails) 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.
128
+ This gem is fully tested from Rails 4.0 to Rails 5.1. We run our tests on [Travis CI](http://travis-ci.org/metaskills/less-rails) in both Ruby 1.9, 2.0, and JRuby 9000. 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.
129
129
 
130
130
  ```shell
131
- $ bundle install
132
- $ bundle exec rake appraisal:setup
133
- $ bundle exec rake appraisal test
131
+ $ bundle
132
+ $ bundle exec appraisal install
133
+ $ bundle exec appraisal rake
134
134
  ```
135
135
 
136
136
  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 4.0 only.
data/Rakefile CHANGED
@@ -7,6 +7,7 @@ Rake::TestTask.new do |t|
7
7
  t.libs = ['lib','test']
8
8
  t.test_files = Dir.glob("test/**/*_spec.rb").sort
9
9
  t.verbose = true
10
+ # t.warning = false
10
11
  end
11
12
 
12
13
  task :default => [:test]
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "therubyracer", "~> 0.12.0", require: nil, platforms: :ruby
6
+ gem "therubyrhino", "~> 2.0.2", require: nil, platforms: :jruby
7
+ gem "mime-types", "~> 2.6.2", platforms: [:ruby_19, :jruby]
8
+ gem "rails", "~> 4.0.13"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "therubyracer", "~> 0.12.0", require: nil, platforms: :ruby
6
+ gem "therubyrhino", "~> 2.0.2", require: nil, platforms: :jruby
7
+ gem "mime-types", "~> 2.6.2", platforms: [:ruby_19, :jruby]
8
+ gem "rails", "~> 4.1.16"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "therubyracer", "~> 0.12.0", require: nil, platforms: :ruby
6
+ gem "therubyrhino", "~> 2.0.2", require: nil, platforms: :jruby
7
+ gem "mime-types", "~> 2.6.2", platforms: [:ruby_19, :jruby]
8
+ gem "rails", "~> 4.2.8"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "therubyracer", "~> 0.12.0", require: nil, platforms: :ruby
6
+ gem "therubyrhino", "~> 2.0.2", require: nil, platforms: :jruby
7
+ gem "mime-types", "~> 2.6.2", platforms: [:ruby_19, :jruby]
8
+ gem "rails", "~> 5.0.3"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "therubyracer", "~> 0.12.0", require: nil, platforms: :ruby
6
+ gem "therubyrhino", "~> 2.0.2", require: nil, platforms: :jruby
7
+ gem "mime-types", "~> 2.6.2", platforms: [:ruby_19, :jruby]
8
+ gem "rails", "~> 5.1.1"
9
+
10
+ gemspec path: "../"
@@ -18,6 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.add_runtime_dependency 'less', '~> 2.6.0'
19
19
  gem.add_runtime_dependency 'actionpack', '>= 4.0'
20
20
  gem.add_runtime_dependency 'tilt'
21
+ gem.add_runtime_dependency 'grease'
21
22
  gem.add_runtime_dependency 'sprockets', '> 2', '< 4'
22
23
  gem.add_development_dependency 'appraisal'
23
24
  gem.add_development_dependency 'minitest'
@@ -1,6 +1,8 @@
1
+ require 'less'
2
+ require 'grease'
1
3
  require 'sprockets/railtie'
2
4
 
3
- module Less
5
+ module Less
4
6
  module Rails
5
7
  class Railtie < ::Rails::Railtie
6
8
  config.less = ActiveSupport::OrderedOptions.new
@@ -10,15 +12,22 @@ module Less
10
12
  config.app_generators.stylesheet_engine :less
11
13
 
12
14
  config.before_initialize do |app|
13
- require 'less'
14
- require 'less-rails'
15
- Sprockets::Engines #force autoloading
16
- Sprockets.register_engine '.less', LessTemplate
15
+ sprockets_env = app.assets || Sprockets
16
+ if sprockets_env.respond_to?(:register_engine)
17
+ args = ['.less', Grease.apply(LessTemplate)]
18
+ args << { mime_type: 'text/less', silence_deprecation: true } if Sprockets::VERSION.start_with?("3")
19
+ sprockets_env.register_engine(*args)
20
+ end
21
+
22
+ if sprockets_env.respond_to?(:register_transformer)
23
+ sprockets_env.register_mime_type 'text/less', extensions: ['.less', '.less.erb', '.less.css'], charset: :css
24
+ sprockets_env.register_transformer 'text/less', 'text/css', Grease.apply(LessTemplate)
25
+ end
17
26
  end
18
27
 
19
28
  initializer 'less-rails.before.load_config_initializers', :before => :load_config_initializers, :group => :all do |app|
20
29
  sprockets_env = app.assets || Sprockets
21
- sprockets_env.register_preprocessor 'text/css', ImportProcessor
30
+ sprockets_env.register_preprocessor 'text/css', Grease.apply(ImportProcessor)
22
31
 
23
32
  config.assets.configure do |env|
24
33
  env.context_class.class_eval do
@@ -32,11 +41,11 @@ module Less
32
41
  assets_stylesheet_paths = app.config.assets.paths.select { |p| p && p.to_s.ends_with?('stylesheets') }
33
42
  app.config.less.paths.unshift(*assets_stylesheet_paths)
34
43
  end
35
-
44
+
36
45
  initializer 'less-rails.setup_compression', :group => :all do |app|
37
46
  config.less.compress = app.config.assets.compress
38
47
  end
39
-
48
+
40
49
  end
41
50
  end
42
51
  end
@@ -1,5 +1,5 @@
1
1
  module Less
2
2
  module Rails
3
- VERSION = "2.8.0"
3
+ VERSION = "3.0.0"
4
4
  end
5
5
  end
@@ -31,7 +31,7 @@ class RailtieSpec < Less::Rails::Spec
31
31
  describe 'initialization' do
32
32
 
33
33
  it 'must register our template engine' do
34
- dummy_assets.engines['.less'].must_equal Less::Rails::LessTemplate
34
+ dummy_assets.engines['.less'].must_be_instance_of Grease::Adapter
35
35
  end
36
36
 
37
37
  it 'must extend the context class with our config' do
@@ -40,7 +40,9 @@ class RailtieSpec < Less::Rails::Spec
40
40
  end
41
41
 
42
42
  it 'must register our import pre processor' do
43
- dummy_assets.preprocessors['text/css'].must_include Less::Rails::ImportProcessor
43
+ dummy_assets.preprocessors['text/css'].any? do |preprocessor|
44
+ preprocessor.is_a? Grease::Adapter
45
+ end.must_equal true
44
46
  end
45
47
 
46
48
  it 'must include the asset pipelines stylesheet paths to less paths' do
@@ -100,7 +100,7 @@ module Less
100
100
  end
101
101
 
102
102
  def run_generator(args=default_arguments, config={})
103
- capture(:stdout) { generator_class.start(args, config.reverse_merge(:destination_root => destination_root)) }
103
+ generator_class.start(args, config.reverse_merge(:destination_root => destination_root))
104
104
  end
105
105
 
106
106
  def generator(args=default_arguments, options={}, config={})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: less-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-12 00:00:00.000000000 Z
11
+ date: 2017-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: less
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: grease
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: sprockets
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -160,6 +174,11 @@ files:
160
174
  - README.md
161
175
  - Rakefile
162
176
  - gemfiles/.keep
177
+ - gemfiles/rails40.gemfile
178
+ - gemfiles/rails41.gemfile
179
+ - gemfiles/rails42.gemfile
180
+ - gemfiles/rails50.gemfile
181
+ - gemfiles/rails51.gemfile
163
182
  - less-rails.gemspec
164
183
  - lib/less-rails.rb
165
184
  - lib/less/rails.rb
@@ -208,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
227
  version: '0'
209
228
  requirements: []
210
229
  rubyforge_project:
211
- rubygems_version: 2.5.1
230
+ rubygems_version: 2.5.2
212
231
  signing_key:
213
232
  specification_version: 4
214
233
  summary: The dynamic stylesheet language for the Rails asset pipeline.
@@ -230,4 +249,3 @@ test_files:
230
249
  - test/dummy_app/tmp/cache/.gitkeep
231
250
  - test/dummy_app/vendor/assets/stylesheets/vendored.less
232
251
  - test/spec_helper.rb
233
- has_rdoc: