sprockets-rails 2.0.0.rc4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7e4219d086080ce19e5b2e2f2366a0757cf2abe
4
- data.tar.gz: 5a79b2f569b27e8417b68fa9af82ce53f5c7d385
3
+ metadata.gz: 0d271ba7763932c67dc00e93a3d19edf2ff7ffb4
4
+ data.tar.gz: 82c38b9ef100ad90cb8dbd44a5b27547269d8c1d
5
5
  SHA512:
6
- metadata.gz: de3da76c296f34d97645d42dcd9a334da9f320c976328dc750e7e508222c350be57b99ac8274e68fc1a4373967547c8c715710fae05cabde61b1e03db294249a
7
- data.tar.gz: 49b99c15fb9409df7b66eadb8af11b17fc4a5427edd8af4554747927b5caf2d42d468dc988422d6bb8bbb1aa91b247689f811cc4979c9c2ca254113eae0e334c
6
+ metadata.gz: 6920457524ba530f05b148d7e4be9b4d75a73052e1fd511ac442555a011b70d1ae04c646ea8e090f444dd4439fe04105990fecb93ebf69d42ee530e3df4da267
7
+ data.tar.gz: f8ab08f41162fab0a1565405d58f77967ab6bc83b1ccf733a2fc88f3c7c984d5640f66a2c4473770019e01bd1debdbbc504d51fdab3b81ea9d7c880b5abb1305
@@ -5,7 +5,45 @@ require 'sprockets'
5
5
  module Sprockets
6
6
  module Rails
7
7
  class Task < Rake::SprocketsTask
8
- attr_accessor :cache_path
8
+ attr_accessor :app
9
+
10
+ def initialize(app = nil)
11
+ self.app = app
12
+ super()
13
+ end
14
+
15
+ def environment
16
+ if app
17
+ app.assets
18
+ else
19
+ super
20
+ end
21
+ end
22
+
23
+ def output
24
+ if app
25
+ File.join(app.root, 'public', app.config.assets.prefix)
26
+ else
27
+ super
28
+ end
29
+ end
30
+
31
+ def assets
32
+ if app
33
+ app.config.assets.precompile
34
+ else
35
+ super
36
+ end
37
+ end
38
+
39
+ def cache_path
40
+ if app
41
+ "#{app.config.root}/tmp/cache/assets"
42
+ else
43
+ @cache_path
44
+ end
45
+ end
46
+ attr_writer :cache_path
9
47
 
10
48
  def define
11
49
  namespace :assets do
@@ -58,13 +58,7 @@ module Sprockets
58
58
 
59
59
  rake_tasks do |app|
60
60
  require 'sprockets/rails/task'
61
-
62
- Sprockets::Rails::Task.new do |t|
63
- t.environment = lambda { app.assets }
64
- t.output = File.join(app.root, 'public', app.config.assets.prefix)
65
- t.assets = app.config.assets.precompile
66
- t.cache_path = "#{app.config.root}/tmp/cache/assets"
67
- end
61
+ Sprockets::Rails::Task.new(app)
68
62
  end
69
63
 
70
64
  config.after_initialize do |app|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc4
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Peek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-18 00:00:00.000000000 Z
11
+ date: 2013-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets
@@ -93,9 +93,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - '>'
96
+ - - '>='
97
97
  - !ruby/object:Gem::Version
98
- version: 1.3.1
98
+ version: '0'
99
99
  requirements: []
100
100
  rubyforge_project:
101
101
  rubygems_version: 2.0.2