Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing a bug when using with Sprockets 2.4

  • Loading branch information...
commit 8987a437efd796100970e1ebaad2159b811a7147 1 parent bb411d6
@petebrowne authored
View
20 Appraisals 100644 → 100755
@@ -1,11 +1,19 @@
-appraise "sprockets-2.0" do
- gem "sprockets", "~> 2.0.0"
+appraise 'sprockets-2.0' do
+ gem 'sprockets', '~> 2.0.0'
end
-appraise "sprockets-2.1" do
- gem "sprockets", "~> 2.1.0"
+appraise 'sprockets-2.1' do
+ gem 'sprockets', '~> 2.1.0'
end
-appraise "sprockets-2.2" do
- gem "sprockets", ">= 2.2.0.beta"
+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
View
2  Gemfile 100644 → 100755
@@ -1,4 +1,4 @@
-source "http://rubygems.org"
+source 'http://rubygems.org'
# Specify your gem's dependencies in sprockets-plugin.gemspec
gemspec
View
6 Rakefile 100644 → 100755
@@ -1,6 +1,6 @@
-require "appraisal"
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
+require 'appraisal'
+require 'bundler/gem_tasks'
+require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
task :default => :spec
View
2  gemfiles/sprockets-2.2.gemfile
@@ -2,6 +2,6 @@
source "http://rubygems.org"
-gem "sprockets", ">= 2.2.0.beta"
+gem "sprockets", "~> 2.2.0"
gemspec :path=>"../"
View
7 gemfiles/sprockets-2.3.gemfile
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "sprockets", "~> 2.3.0"
+
+gemspec :path=>"../"
View
7 gemfiles/sprockets-2.4.gemfile
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "sprockets", "~> 2.4.0"
+
+gemspec :path=>"../"
View
2  lib/sprockets-plugin.rb 100644 → 100755
@@ -1 +1 @@
-require "sprockets/plugin"
+require 'sprockets/plugin'
View
6 lib/sprockets/plugin.rb
@@ -1,9 +1,9 @@
-require "pathname"
+require 'pathname'
module Sprockets
class Plugin
- require "sprockets/plugin/version"
- require "sprockets/plugin/aware"
+ require 'sprockets/plugin/version'
+ require 'sprockets/plugin/aware'
class << self
def inherited(plugin)
View
2  lib/sprockets/plugin/aware.rb
@@ -1,4 +1,4 @@
-require "sprockets/environment"
+require 'sprockets'
module Sprockets
class Plugin
View
2  lib/sprockets/plugin/version.rb
@@ -1,5 +1,5 @@
module Sprockets
class Plugin
- VERSION = "0.2.0"
+ VERSION = '0.2.0'
end
end
View
6 spec/spec_helper.rb 100644 → 100755
@@ -1,6 +1,6 @@
-require "sprockets"
-require "sprockets-plugin"
-require "construct"
+require 'sprockets'
+require 'sprockets-plugin'
+require 'construct'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
View
86 spec/sprockets-plugin_spec.rb
@@ -1,15 +1,15 @@
-require "spec_helper"
+require 'spec_helper'
describe Sprockets::Plugin do
after :each do
Sprockets::Plugin.send :class_variable_set, :@@plugins, nil
end
- describe "#append_plugin_paths" do
- it "adds paths from plugins to environments" do
- dir_1 = @sandbox.directory "plugin_1/assets"
- dir_2 = @sandbox.directory "plugin_2/assets"
- dir_3 = @sandbox.directory "plugin_3/assets"
+ describe '#append_plugin_paths' do
+ it 'adds paths from plugins to environments' do
+ dir_1 = @sandbox.directory 'plugin_1/assets'
+ dir_2 = @sandbox.directory 'plugin_2/assets'
+ dir_3 = @sandbox.directory 'plugin_3/assets'
plugin_1 = Class.new Sprockets::Plugin
plugin_1.append_path dir_1
@@ -23,10 +23,10 @@
env.paths.should == [dir_1, dir_2, dir_3].map(&:to_s)
end
- it "does not add duplicate paths" do
- dir_1 = @sandbox.directory "plugin_1/assets"
- dir_2 = @sandbox.directory "plugin_2/assets"
- dir_3 = @sandbox.directory "plugin_3/assets"
+ it 'does not add duplicate paths' do
+ dir_1 = @sandbox.directory 'plugin_1/assets'
+ dir_2 = @sandbox.directory 'plugin_2/assets'
+ dir_3 = @sandbox.directory 'plugin_3/assets'
plugin_1 = Class.new Sprockets::Plugin
plugin_1.append_path dir_1
@@ -45,11 +45,11 @@
end
end
- describe ".append_path" do
- it "adds paths" do
- dir_1 = @sandbox.directory "plugin/assets/images"
- dir_2 = @sandbox.directory "plugin/assets/javascripts"
- dir_3 = @sandbox.directory "plugin/assets/stylesheets"
+ describe '.append_path' do
+ it 'adds paths' do
+ dir_1 = @sandbox.directory 'plugin/assets/images'
+ dir_2 = @sandbox.directory 'plugin/assets/javascripts'
+ dir_3 = @sandbox.directory 'plugin/assets/stylesheets'
plugin = Class.new Sprockets::Plugin
plugin.append_path dir_1
@@ -58,23 +58,23 @@
plugin.paths.should == [dir_1, dir_2, dir_3].map(&:to_s)
end
- it "adds the paths relative to the plugin root" do
- dir_1 = @sandbox.directory "plugin/assets/images"
- dir_2 = @sandbox.directory "plugin/assets/javascripts"
- dir_3 = @sandbox.directory "plugin/assets/stylesheets"
+ it 'adds the paths relative to the plugin root' do
+ dir_1 = @sandbox.directory 'plugin/assets/images'
+ dir_2 = @sandbox.directory 'plugin/assets/javascripts'
+ dir_3 = @sandbox.directory 'plugin/assets/stylesheets'
plugin = Class.new Sprockets::Plugin
- plugin.root @sandbox.join "plugin"
- plugin.append_path "assets/images"
- plugin.append_path "assets/javascripts"
- plugin.append_path "assets/stylesheets"
+ plugin.root @sandbox.join 'plugin'
+ plugin.append_path 'assets/images'
+ plugin.append_path 'assets/javascripts'
+ plugin.append_path 'assets/stylesheets'
plugin.paths.should == [dir_1, dir_2, dir_3].map(&:to_s)
end
- it "only adds existing paths" do
- dir_1 = @sandbox.directory "plugin/assets/images"
- dir_2 = @sandbox.directory "plugin/assets/javascripts"
- dir_3 = @sandbox.join "plugin/assets/stylesheets"
+ it 'only adds existing paths' do
+ dir_1 = @sandbox.directory 'plugin/assets/images'
+ dir_2 = @sandbox.directory 'plugin/assets/javascripts'
+ dir_3 = @sandbox.join 'plugin/assets/stylesheets'
plugin = Class.new Sprockets::Plugin
plugin.append_path dir_1
@@ -84,11 +84,11 @@
end
end
- describe ".appends_paths" do
- it "adds multiple paths at once" do
- dir_1 = @sandbox.directory "plugin/assets/images"
- dir_2 = @sandbox.directory "plugin/assets/javascripts"
- dir_3 = @sandbox.directory "plugin/assets/stylesheets"
+ describe '.appends_paths' do
+ it 'adds multiple paths at once' do
+ dir_1 = @sandbox.directory 'plugin/assets/images'
+ dir_2 = @sandbox.directory 'plugin/assets/javascripts'
+ dir_3 = @sandbox.directory 'plugin/assets/stylesheets'
plugin = Class.new Sprockets::Plugin
plugin.append_path dir_1, dir_2 ,dir_3
@@ -96,12 +96,12 @@
end
end
- describe ".append_paths_in" do
- it "adds paths within the given path" do
- assets_dir = @sandbox.directory "plugin/assets"
- dir_1 = assets_dir.directory "images"
- dir_2 = assets_dir.directory "javascripts"
- dir_3 = assets_dir.directory "stylesheets"
+ describe '.append_paths_in' do
+ it 'adds paths within the given path' do
+ assets_dir = @sandbox.directory 'plugin/assets'
+ dir_1 = assets_dir.directory 'images'
+ dir_2 = assets_dir.directory 'javascripts'
+ dir_3 = assets_dir.directory 'stylesheets'
plugin = Class.new Sprockets::Plugin
plugin.append_paths_in assets_dir
@@ -109,9 +109,9 @@
end
end
- describe ".root" do
- it "converts the given path to a Pathname object" do
- plugin_path = @sandbox.join "plugin"
+ describe '.root' do
+ it 'converts the given path to a Pathname object' do
+ plugin_path = @sandbox.join 'plugin'
plugin = Class.new Sprockets::Plugin
plugin.root plugin_path.to_s
plugin.root.should be_an_instance_of(Pathname)
@@ -119,8 +119,8 @@
end
end
- describe ".plugins" do
- it "returns all of the plugins" do
+ describe '.plugins' do
+ it 'returns all of the plugins' do
plugin_1 = Class.new Sprockets::Plugin
plugin_2 = Class.new Sprockets::Plugin
plugin_3 = Class.new Sprockets::Plugin
View
24 sprockets-plugin.gemspec
@@ -1,25 +1,25 @@
# -*- encoding: utf-8 -*-
-$:.push File.expand_path("../lib", __FILE__)
-require "sprockets/plugin/version"
+$:.push File.expand_path('../lib', __FILE__)
+require 'sprockets/plugin/version'
Gem::Specification.new do |s|
- s.name = "sprockets-plugin"
+ s.name = 'sprockets-plugin'
s.version = Sprockets::Plugin::VERSION
- s.authors = ["Pete Browne"]
- s.email = ["me@petebrowne.com"]
- s.homepage = "https://github.com/petebrowne/sprockets-plugin"
+ s.authors = ['Pete Browne']
+ s.email = ['me@petebrowne.com']
+ s.homepage = 'https://github.com/petebrowne/sprockets-plugin'
s.summary = %q{Package assets into gems for non-Rails Sprockets 2.x applications.}
s.description = %q{Package assets into gems for non-Rails Sprockets 2.x applications.}
- s.rubyforge_project = "sprockets-plugin"
+ s.rubyforge_project = 'sprockets-plugin'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
- s.require_paths = ["lib"]
+ s.require_paths = ['lib']
- s.add_runtime_dependency "sprockets", "~> 2.0"
- s.add_development_dependency "appraisal", "~> 0.4.0"
- s.add_development_dependency "rspec", "~> 2.6.0"
- s.add_development_dependency "test-construct", "~> 1.2.0"
+ s.add_runtime_dependency 'sprockets', '~> 2.0'
+ s.add_development_dependency 'appraisal', '~> 0.4.0'
+ s.add_development_dependency 'rspec', '~> 2.6.0'
+ s.add_development_dependency 'test-construct', '~> 1.2.0'
end
Please sign in to comment.
Something went wrong with that request. Please try again.