sinatra-asset-pipeline 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sinatra/asset_pipeline/task.rb +42 -12
- data/lib/sinatra/asset_pipeline/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8940b084da32484db38b94dee13ccaf39091f07ec2cdd7178b50139054478fd3
|
4
|
+
data.tar.gz: 73323e81756b6d29e89388f9a5d2b0f3618d29df29a9199e733886dd5c796b60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2b4d32d885d3f618399601ac2a41f6a6773459ae21e2591ff9b7900fb88f63229a400c829e4d75d9a5a24db85a5e8836df65d6830f42bbfd54273abb90676da
|
7
|
+
data.tar.gz: bc13a552c3928a04a1deb6bf858893c7e4b99fe2eb7ea90849f5354e9c4d4407faf7f54316d8d2b501a0e221479f6d577365ab790d9fc0242d29aaa7bfc0e05e
|
@@ -1,28 +1,58 @@
|
|
1
1
|
require 'rake'
|
2
|
-
require 'rake/tasklib'
|
3
2
|
require 'rake/sprocketstask'
|
3
|
+
require 'sprockets'
|
4
4
|
|
5
5
|
module Sinatra
|
6
6
|
module AssetPipeline
|
7
|
-
class Task < Rake::
|
8
|
-
|
7
|
+
class Task < Rake::SprocketsTask
|
8
|
+
attr_accessor :app
|
9
|
+
|
10
|
+
def initialize(app = nil)
|
11
|
+
self.app = app
|
12
|
+
super()
|
13
|
+
end
|
14
|
+
|
15
|
+
def environment
|
16
|
+
app ? app.sprockets : super
|
17
|
+
end
|
18
|
+
|
19
|
+
def assets
|
20
|
+
app ? app.assets_precompile : super
|
21
|
+
end
|
22
|
+
|
23
|
+
def manifest
|
24
|
+
app ? Sprockets::Manifest.new(environment.index, app.assets_public_path) : super
|
25
|
+
end
|
26
|
+
|
27
|
+
def define
|
9
28
|
namespace :assets do
|
10
|
-
|
29
|
+
%w( precompile clean clobber ).each { |task| Rake::Task[task].clear if Rake::Task.task_defined?(task) }
|
30
|
+
|
31
|
+
desc "Compile all assets"
|
11
32
|
task :precompile do
|
12
|
-
|
13
|
-
|
14
|
-
|
33
|
+
with_logger do
|
34
|
+
manifest.compile(assets)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "Remove old compiled assets"
|
39
|
+
task :clean, [:keep] do |t, args|
|
40
|
+
with_logger do
|
41
|
+
manifest.clean(Integer(args.keep || self.keep))
|
42
|
+
end
|
15
43
|
end
|
16
44
|
|
17
|
-
desc "
|
18
|
-
task :
|
19
|
-
|
45
|
+
desc "Remove compiled assets"
|
46
|
+
task :clobber do
|
47
|
+
with_logger do
|
48
|
+
manifest.clobber
|
49
|
+
end
|
20
50
|
end
|
21
51
|
end
|
22
52
|
end
|
23
53
|
|
24
|
-
def self.define!(
|
25
|
-
self.new
|
54
|
+
def self.define!(app)
|
55
|
+
self.new(app)
|
26
56
|
end
|
27
57
|
end
|
28
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-asset-pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joakim Ekberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|