sprockets-plugin 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Appraisals +14 -6
- data/Gemfile +1 -1
- data/Rakefile +3 -3
- data/gemfiles/sprockets-2.2.gemfile +1 -1
- data/gemfiles/sprockets-2.3.gemfile +7 -0
- data/gemfiles/sprockets-2.4.gemfile +7 -0
- data/lib/sprockets-plugin.rb +1 -1
- data/lib/sprockets/plugin.rb +3 -3
- data/lib/sprockets/plugin/aware.rb +1 -1
- data/lib/sprockets/plugin/version.rb +1 -1
- data/spec/spec_helper.rb +3 -3
- data/spec/sprockets-plugin_spec.rb +43 -43
- data/sprockets-plugin.gemspec +12 -12
- metadata +55 -84
data/Appraisals
CHANGED
@@ -1,11 +1,19 @@
|
|
1
|
-
appraise
|
2
|
-
gem
|
1
|
+
appraise 'sprockets-2.0' do
|
2
|
+
gem 'sprockets', '~> 2.0.0'
|
3
3
|
end
|
4
4
|
|
5
|
-
appraise
|
6
|
-
gem
|
5
|
+
appraise 'sprockets-2.1' do
|
6
|
+
gem 'sprockets', '~> 2.1.0'
|
7
7
|
end
|
8
8
|
|
9
|
-
appraise
|
10
|
-
gem
|
9
|
+
appraise 'sprockets-2.2' do
|
10
|
+
gem 'sprockets', '~> 2.2.0'
|
11
|
+
end
|
12
|
+
|
13
|
+
appraise 'sprockets-2.3' do
|
14
|
+
gem 'sprockets', '~> 2.3.0'
|
15
|
+
end
|
16
|
+
|
17
|
+
appraise 'sprockets-2.4' do
|
18
|
+
gem 'sprockets', '~> 2.4.0'
|
11
19
|
end
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/sprockets-plugin.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require
|
1
|
+
require 'sprockets/plugin'
|
data/lib/sprockets/plugin.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require
|
1
|
+
require 'pathname'
|
2
2
|
|
3
3
|
module Sprockets
|
4
4
|
class Plugin
|
5
|
-
require
|
6
|
-
require
|
5
|
+
require 'sprockets/plugin/version'
|
6
|
+
require 'sprockets/plugin/aware'
|
7
7
|
|
8
8
|
class << self
|
9
9
|
def inherited(plugin)
|
data/spec/spec_helper.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Sprockets::Plugin do
|
4
4
|
after :each do
|
5
5
|
Sprockets::Plugin.send :class_variable_set, :@@plugins, nil
|
6
6
|
end
|
7
7
|
|
8
|
-
describe
|
9
|
-
it
|
10
|
-
dir_1 = @sandbox.directory
|
11
|
-
dir_2 = @sandbox.directory
|
12
|
-
dir_3 = @sandbox.directory
|
8
|
+
describe '#append_plugin_paths' do
|
9
|
+
it 'adds paths from plugins to environments' do
|
10
|
+
dir_1 = @sandbox.directory 'plugin_1/assets'
|
11
|
+
dir_2 = @sandbox.directory 'plugin_2/assets'
|
12
|
+
dir_3 = @sandbox.directory 'plugin_3/assets'
|
13
13
|
|
14
14
|
plugin_1 = Class.new Sprockets::Plugin
|
15
15
|
plugin_1.append_path dir_1
|
@@ -23,10 +23,10 @@ describe Sprockets::Plugin do
|
|
23
23
|
env.paths.should == [dir_1, dir_2, dir_3].map(&:to_s)
|
24
24
|
end
|
25
25
|
|
26
|
-
it
|
27
|
-
dir_1 = @sandbox.directory
|
28
|
-
dir_2 = @sandbox.directory
|
29
|
-
dir_3 = @sandbox.directory
|
26
|
+
it 'does not add duplicate paths' do
|
27
|
+
dir_1 = @sandbox.directory 'plugin_1/assets'
|
28
|
+
dir_2 = @sandbox.directory 'plugin_2/assets'
|
29
|
+
dir_3 = @sandbox.directory 'plugin_3/assets'
|
30
30
|
|
31
31
|
plugin_1 = Class.new Sprockets::Plugin
|
32
32
|
plugin_1.append_path dir_1
|
@@ -45,11 +45,11 @@ describe Sprockets::Plugin do
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
describe
|
49
|
-
it
|
50
|
-
dir_1 = @sandbox.directory
|
51
|
-
dir_2 = @sandbox.directory
|
52
|
-
dir_3 = @sandbox.directory
|
48
|
+
describe '.append_path' do
|
49
|
+
it 'adds paths' do
|
50
|
+
dir_1 = @sandbox.directory 'plugin/assets/images'
|
51
|
+
dir_2 = @sandbox.directory 'plugin/assets/javascripts'
|
52
|
+
dir_3 = @sandbox.directory 'plugin/assets/stylesheets'
|
53
53
|
|
54
54
|
plugin = Class.new Sprockets::Plugin
|
55
55
|
plugin.append_path dir_1
|
@@ -58,23 +58,23 @@ describe Sprockets::Plugin do
|
|
58
58
|
plugin.paths.should == [dir_1, dir_2, dir_3].map(&:to_s)
|
59
59
|
end
|
60
60
|
|
61
|
-
it
|
62
|
-
dir_1 = @sandbox.directory
|
63
|
-
dir_2 = @sandbox.directory
|
64
|
-
dir_3 = @sandbox.directory
|
61
|
+
it 'adds the paths relative to the plugin root' do
|
62
|
+
dir_1 = @sandbox.directory 'plugin/assets/images'
|
63
|
+
dir_2 = @sandbox.directory 'plugin/assets/javascripts'
|
64
|
+
dir_3 = @sandbox.directory 'plugin/assets/stylesheets'
|
65
65
|
|
66
66
|
plugin = Class.new Sprockets::Plugin
|
67
|
-
plugin.root @sandbox.join
|
68
|
-
plugin.append_path
|
69
|
-
plugin.append_path
|
70
|
-
plugin.append_path
|
67
|
+
plugin.root @sandbox.join 'plugin'
|
68
|
+
plugin.append_path 'assets/images'
|
69
|
+
plugin.append_path 'assets/javascripts'
|
70
|
+
plugin.append_path 'assets/stylesheets'
|
71
71
|
plugin.paths.should == [dir_1, dir_2, dir_3].map(&:to_s)
|
72
72
|
end
|
73
73
|
|
74
|
-
it
|
75
|
-
dir_1 = @sandbox.directory
|
76
|
-
dir_2 = @sandbox.directory
|
77
|
-
dir_3 = @sandbox.join
|
74
|
+
it 'only adds existing paths' do
|
75
|
+
dir_1 = @sandbox.directory 'plugin/assets/images'
|
76
|
+
dir_2 = @sandbox.directory 'plugin/assets/javascripts'
|
77
|
+
dir_3 = @sandbox.join 'plugin/assets/stylesheets'
|
78
78
|
|
79
79
|
plugin = Class.new Sprockets::Plugin
|
80
80
|
plugin.append_path dir_1
|
@@ -84,11 +84,11 @@ describe Sprockets::Plugin do
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
-
describe
|
88
|
-
it
|
89
|
-
dir_1 = @sandbox.directory
|
90
|
-
dir_2 = @sandbox.directory
|
91
|
-
dir_3 = @sandbox.directory
|
87
|
+
describe '.appends_paths' do
|
88
|
+
it 'adds multiple paths at once' do
|
89
|
+
dir_1 = @sandbox.directory 'plugin/assets/images'
|
90
|
+
dir_2 = @sandbox.directory 'plugin/assets/javascripts'
|
91
|
+
dir_3 = @sandbox.directory 'plugin/assets/stylesheets'
|
92
92
|
|
93
93
|
plugin = Class.new Sprockets::Plugin
|
94
94
|
plugin.append_path dir_1, dir_2 ,dir_3
|
@@ -96,12 +96,12 @@ describe Sprockets::Plugin do
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
-
describe
|
100
|
-
it
|
101
|
-
assets_dir = @sandbox.directory
|
102
|
-
dir_1 = assets_dir.directory
|
103
|
-
dir_2 = assets_dir.directory
|
104
|
-
dir_3 = assets_dir.directory
|
99
|
+
describe '.append_paths_in' do
|
100
|
+
it 'adds paths within the given path' do
|
101
|
+
assets_dir = @sandbox.directory 'plugin/assets'
|
102
|
+
dir_1 = assets_dir.directory 'images'
|
103
|
+
dir_2 = assets_dir.directory 'javascripts'
|
104
|
+
dir_3 = assets_dir.directory 'stylesheets'
|
105
105
|
|
106
106
|
plugin = Class.new Sprockets::Plugin
|
107
107
|
plugin.append_paths_in assets_dir
|
@@ -109,9 +109,9 @@ describe Sprockets::Plugin do
|
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
-
describe
|
113
|
-
it
|
114
|
-
plugin_path = @sandbox.join
|
112
|
+
describe '.root' do
|
113
|
+
it 'converts the given path to a Pathname object' do
|
114
|
+
plugin_path = @sandbox.join 'plugin'
|
115
115
|
plugin = Class.new Sprockets::Plugin
|
116
116
|
plugin.root plugin_path.to_s
|
117
117
|
plugin.root.should be_an_instance_of(Pathname)
|
@@ -119,8 +119,8 @@ describe Sprockets::Plugin do
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
|
-
describe
|
123
|
-
it
|
122
|
+
describe '.plugins' do
|
123
|
+
it 'returns all of the plugins' do
|
124
124
|
plugin_1 = Class.new Sprockets::Plugin
|
125
125
|
plugin_2 = Class.new Sprockets::Plugin
|
126
126
|
plugin_3 = Class.new Sprockets::Plugin
|
data/sprockets-plugin.gemspec
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path(
|
3
|
-
require
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'sprockets/plugin/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
|
-
s.name =
|
6
|
+
s.name = 'sprockets-plugin'
|
7
7
|
s.version = Sprockets::Plugin::VERSION
|
8
|
-
s.authors = [
|
9
|
-
s.email = [
|
10
|
-
s.homepage =
|
8
|
+
s.authors = ['Pete Browne']
|
9
|
+
s.email = ['me@petebrowne.com']
|
10
|
+
s.homepage = 'https://github.com/petebrowne/sprockets-plugin'
|
11
11
|
s.summary = %q{Package assets into gems for non-Rails Sprockets 2.x applications.}
|
12
12
|
s.description = %q{Package assets into gems for non-Rails Sprockets 2.x applications.}
|
13
13
|
|
14
|
-
s.rubyforge_project =
|
14
|
+
s.rubyforge_project = 'sprockets-plugin'
|
15
15
|
|
16
16
|
s.files = `git ls-files`.split("\n")
|
17
17
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
-
s.require_paths = [
|
19
|
+
s.require_paths = ['lib']
|
20
20
|
|
21
|
-
s.add_runtime_dependency
|
22
|
-
s.add_development_dependency
|
23
|
-
s.add_development_dependency
|
24
|
-
s.add_development_dependency
|
21
|
+
s.add_runtime_dependency 'sprockets', '~> 2.0'
|
22
|
+
s.add_development_dependency 'appraisal', '~> 0.4.0'
|
23
|
+
s.add_development_dependency 'rspec', '~> 2.6.0'
|
24
|
+
s.add_development_dependency 'test-construct', '~> 1.2.0'
|
25
25
|
end
|
metadata
CHANGED
@@ -1,95 +1,67 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-plugin
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 0
|
10
|
-
version: 0.2.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Pete Browne
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
12
|
+
date: 2012-04-20 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: sprockets
|
16
|
+
requirement: &-1072935408 !ruby/object:Gem::Requirement
|
23
17
|
none: false
|
24
|
-
requirements:
|
18
|
+
requirements:
|
25
19
|
- - ~>
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
|
29
|
-
- 2
|
30
|
-
- 0
|
31
|
-
version: "2.0"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.0'
|
22
|
+
type: :runtime
|
32
23
|
prerelease: false
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
24
|
+
version_requirements: *-1072935408
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: appraisal
|
27
|
+
requirement: &-1072935688 !ruby/object:Gem::Requirement
|
38
28
|
none: false
|
39
|
-
requirements:
|
29
|
+
requirements:
|
40
30
|
- - ~>
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
hash: 15
|
43
|
-
segments:
|
44
|
-
- 0
|
45
|
-
- 4
|
46
|
-
- 0
|
31
|
+
- !ruby/object:Gem::Version
|
47
32
|
version: 0.4.0
|
48
|
-
prerelease: false
|
49
|
-
name: appraisal
|
50
|
-
version_requirements: *id002
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
33
|
type: :development
|
53
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *-1072935688
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec
|
38
|
+
requirement: &-1072935928 !ruby/object:Gem::Requirement
|
54
39
|
none: false
|
55
|
-
requirements:
|
40
|
+
requirements:
|
56
41
|
- - ~>
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
hash: 23
|
59
|
-
segments:
|
60
|
-
- 2
|
61
|
-
- 6
|
62
|
-
- 0
|
42
|
+
- !ruby/object:Gem::Version
|
63
43
|
version: 2.6.0
|
64
|
-
prerelease: false
|
65
|
-
name: rspec
|
66
|
-
version_requirements: *id003
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
44
|
type: :development
|
69
|
-
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *-1072935928
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: test-construct
|
49
|
+
requirement: &-1072936358 !ruby/object:Gem::Requirement
|
70
50
|
none: false
|
71
|
-
requirements:
|
51
|
+
requirements:
|
72
52
|
- - ~>
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
hash: 31
|
75
|
-
segments:
|
76
|
-
- 1
|
77
|
-
- 2
|
78
|
-
- 0
|
53
|
+
- !ruby/object:Gem::Version
|
79
54
|
version: 1.2.0
|
55
|
+
type: :development
|
80
56
|
prerelease: false
|
81
|
-
|
82
|
-
version_requirements: *id004
|
57
|
+
version_requirements: *-1072936358
|
83
58
|
description: Package assets into gems for non-Rails Sprockets 2.x applications.
|
84
|
-
email:
|
59
|
+
email:
|
85
60
|
- me@petebrowne.com
|
86
61
|
executables: []
|
87
|
-
|
88
62
|
extensions: []
|
89
|
-
|
90
63
|
extra_rdoc_files: []
|
91
|
-
|
92
|
-
files:
|
64
|
+
files:
|
93
65
|
- .gitignore
|
94
66
|
- Appraisals
|
95
67
|
- Gemfile
|
@@ -99,6 +71,8 @@ files:
|
|
99
71
|
- gemfiles/sprockets-2.0.gemfile
|
100
72
|
- gemfiles/sprockets-2.1.gemfile
|
101
73
|
- gemfiles/sprockets-2.2.gemfile
|
74
|
+
- gemfiles/sprockets-2.3.gemfile
|
75
|
+
- gemfiles/sprockets-2.4.gemfile
|
102
76
|
- lib/sprockets-plugin.rb
|
103
77
|
- lib/sprockets/plugin.rb
|
104
78
|
- lib/sprockets/plugin/aware.rb
|
@@ -108,37 +82,34 @@ files:
|
|
108
82
|
- sprockets-plugin.gemspec
|
109
83
|
homepage: https://github.com/petebrowne/sprockets-plugin
|
110
84
|
licenses: []
|
111
|
-
|
112
85
|
post_install_message:
|
113
86
|
rdoc_options: []
|
114
|
-
|
115
|
-
require_paths:
|
87
|
+
require_paths:
|
116
88
|
- lib
|
117
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
118
90
|
none: false
|
119
|
-
requirements:
|
120
|
-
- -
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
|
123
|
-
segments:
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
segments:
|
124
96
|
- 0
|
125
|
-
|
126
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
hash: 878799453
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
99
|
none: false
|
128
|
-
requirements:
|
129
|
-
- -
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
|
132
|
-
segments:
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
segments:
|
133
105
|
- 0
|
134
|
-
|
106
|
+
hash: 878799453
|
135
107
|
requirements: []
|
136
|
-
|
137
108
|
rubyforge_project: sprockets-plugin
|
138
109
|
rubygems_version: 1.8.11
|
139
110
|
signing_key:
|
140
111
|
specification_version: 3
|
141
112
|
summary: Package assets into gems for non-Rails Sprockets 2.x applications.
|
142
|
-
test_files:
|
113
|
+
test_files:
|
143
114
|
- spec/spec_helper.rb
|
144
115
|
- spec/sprockets-plugin_spec.rb
|