Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Major Changes][Sprockets 3 for LESS] Using versionized classes #5

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
*.gem
.bundle
Gemfile.lock
.rbenv-version
gemfiles/*.lock
pkg/*
.sass-cache
.rspec
.ruby-version

# Ignore IntelliJ IDEA project files.
*.iml
/.idea/
12 changes: 12 additions & 0 deletions .reek
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
Attribute:
enabled: false
TooManyInstanceVariables:
enabled: false
TooManyMethods:
enabled: false
UtilityFunction:
enabled: false
exclude_paths:
- examples
- spec
77 changes: 77 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
AllCops:
Exclude:
- sprockets-sass.gemspec
- lib/sprockets/sass.rb
- bin/**/*
- Guardfile
- vendor/**/**
- spec/**/*
- Gemfile
- Rakefile

TargetRubyVersion: 2.3

ClassLength:
Max: 500

Documentation:
Enabled: true

Encoding:
Enabled: false

LineLength:
Max: 200

AccessModifierIndentation:
EnforcedStyle: outdent

IfUnlessModifier:
Enabled: false

CaseIndentation:
IndentWhenRelativeTo: case
IndentOneStep: true

MethodLength:
CountComments: false
Max: 20

SignalException:
Enabled: false

ColonMethodCall:
Enabled: false

AsciiComments:
Enabled: false

RegexpLiteral:
Enabled: false

AssignmentInCondition:
Enabled: false

ParameterLists:
CountKeywordArgs: false

SingleLineBlockParams:
Methods:
- reduce:
- memo
- item

Metrics/AbcSize:
Enabled: false

Style/CollectionMethods:
Enabled: true

Style/SymbolArray:
Enabled: true

Style/ExtraSpacing:
Enabled: true

Style/FileName:
Enabled: false
23 changes: 21 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
language: ruby
sudo: false

cache: bundler

before_install:
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
- gem install bundler
- gem update bundler
- rm -f .bundle/config

script:
- echo $BUNDLE_GEMFILE
- bundle exec rake
rvm:
- 2.0.0
- 2.1.0
- 2.2.2
- 2.2.3
- 2.3.1
- 2.4.1
env:
- RAILS_ENV=test RACK_ENV=test
notifications:
email: false
48 changes: 48 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

appraise 'sprockets_2.2' do
gem 'sprockets', '~> 2.2.0'
end

appraise 'sprockets_2.3' do
gem 'sprockets', '~> 2.3.0'
end

appraise 'sprockets_2.4' do
gem 'sprockets', '~> 2.4.0'
end

appraise 'sprockets_2.5' do
gem 'sprockets', '~> 2.5.0'
end

appraise 'sprockets_2.6' do
gem 'sprockets', '~> 2.6.0'
end

appraise 'sprockets_2.7' do
gem 'sprockets', '~> 2.7.0'
end

appraise 'sprockets_2.8' do
gem 'sprockets', '~> 2.8.0'
end

appraise 'sprockets_2.9' do
gem 'sprockets', '~> 2.9.0'
end

appraise 'sprockets_2.10' do
gem 'sprockets', '~> 2.9.0'
end

appraise 'sprockets_2.11' do
gem 'sprockets', '~> 2.11.0'
end

appraise 'sprockets_3.7' do
gem 'sprockets', '~> 3.7.0'
end

# appraise 'sprockets_4.0_beta2' do
# gem 'sprockets', '4.0.0.beta2'
# end
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ gemspec

gem "therubyracer", "~> 0.12", :require => nil, :platforms => :ruby
gem "therubyrhino", "~> 2.0", :require => nil, :platforms => :jruby

if RUBY_VERSION < "2.2.0"
gem 'rack', '>= 1.0', '< 2.0'
end
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# sprockets-less

**Better Less integration with [Sprockets 2.x](http://github.com/sstephenson/sprockets)**
**Better Less integration with [Sprockets 2.x and 3.x](http://github.com/sstephenson/sprockets)**

[![Build Status](https://travis-ci.org/lloeki/sprockets-less.svg?branch=master)](https://travis-ci.org/lloeki/sprockets-less)

When using Sprockets 2.x with Less you will eventually run into a pretty big issue. `//= require` directives will not allow Less mixins, variables, etc. to be shared between files. So you'll try to use `@import`, and that'll also blow up in your face. `sprockets-less` aims to fix this.
When using Sprockets 2.x or 3.x with Less you will eventually run into a pretty big issue. `//= require` directives will not allow Less mixins, variables, etc. to be shared between files. So you'll try to use `@import`, and that'll also blow up in your face. `sprockets-less` aims to fix this.

_Note: If you use Rails 3.1, you may want to use the [less-rails gem](http://github.com/rails/less-rails). But if you want to use Sprockets and Less anywhere else, like Sinatra, use `sprockets-less`._

Expand Down Expand Up @@ -95,4 +95,3 @@ Please note that these helpers are only available server-side, and something lik
## License

Sprocket::Less is released under the MIT license. See LICENSE file for details.

29 changes: 27 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
require 'bundler/setup'
require 'bundler/gem_tasks'
require 'appraisal'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new
task :default => :spec

RSpec::Core::RakeTask.new(:spec) do |spec|
spec.rspec_opts = ['--backtrace '] if ENV['DEBUG']
spec.verbose = true
end

desc 'Default: run the unit tests.'
task default: [:all]

desc 'Test the plugin under all supported versions.'
task :all do |_t|
if ENV['TRAVIS']
# require 'json'
# puts JSON.pretty_generate(ENV.to_hash)
if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
appraisal_name = ENV['BUNDLE_GEMFILE'].scan(/sprockets\_(.*)\.gemfile/).flatten.first
command_prefix = "appraisal sprockets_#{appraisal_name}"
exec ("#{command_prefix} bundle install && #{command_prefix} bundle exec rspec ")
else
exec(' bundle exec appraisal install && bundle exec rake appraisal spec')
end
else
exec('bundle exec appraisal install && bundle exec rake appraisal spec')
end
end
9 changes: 9 additions & 0 deletions gemfiles/sprockets_2.10.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "therubyracer", "~> 0.12", require: nil, platforms: :ruby
gem "therubyrhino", "~> 2.0", require: nil, platforms: :jruby
gem "sprockets", "~> 2.9.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/sprockets_2.11.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "therubyracer", "~> 0.12", require: nil, platforms: :ruby
gem "therubyrhino", "~> 2.0", require: nil, platforms: :jruby
gem "sprockets", "~> 2.11.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/sprockets_2.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "therubyracer", "~> 0.12", require: nil, platforms: :ruby
gem "therubyrhino", "~> 2.0", require: nil, platforms: :jruby
gem "sprockets", "~> 2.2.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/sprockets_2.3.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "therubyracer", "~> 0.12", require: nil, platforms: :ruby
gem "therubyrhino", "~> 2.0", require: nil, platforms: :jruby
gem "sprockets", "~> 2.3.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/sprockets_2.4.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "therubyracer", "~> 0.12", require: nil, platforms: :ruby
gem "therubyrhino", "~> 2.0", require: nil, platforms: :jruby
gem "sprockets", "~> 2.4.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/sprockets_2.5.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "therubyracer", "~> 0.12", require: nil, platforms: :ruby
gem "therubyrhino", "~> 2.0", require: nil, platforms: :jruby
gem "sprockets", "~> 2.5.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/sprockets_2.6.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "therubyracer", "~> 0.12", require: nil, platforms: :ruby
gem "therubyrhino", "~> 2.0", require: nil, platforms: :jruby
gem "sprockets", "~> 2.6.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/sprockets_2.7.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "therubyracer", "~> 0.12", require: nil, platforms: :ruby
gem "therubyrhino", "~> 2.0", require: nil, platforms: :jruby
gem "sprockets", "~> 2.7.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/sprockets_2.8.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "therubyracer", "~> 0.12", require: nil, platforms: :ruby
gem "therubyrhino", "~> 2.0", require: nil, platforms: :jruby
gem "sprockets", "~> 2.8.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/sprockets_2.9.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "therubyracer", "~> 0.12", require: nil, platforms: :ruby
gem "therubyrhino", "~> 2.0", require: nil, platforms: :jruby
gem "sprockets", "~> 2.9.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/sprockets_3.7.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "therubyracer", "~> 0.12", require: nil, platforms: :ruby
gem "therubyrhino", "~> 2.0", require: nil, platforms: :jruby
gem "sprockets", "~> 3.7.0"

gemspec path: "../"
10 changes: 10 additions & 0 deletions gemfiles/sprockets_4.0_beta2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "therubyracer", "~> 0.12", :require => nil, :platforms => :ruby
gem "therubyrhino", "~> 2.0", :require => nil, :platforms => :jruby
gem "rack", ">= 1.0", "< 2.0"
gem "sprockets", "4.0.0.beta2"

gemspec :path => "../"
Loading