generated-assets 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generated-assets/manifest.rb +20 -0
- data/lib/generated-assets/railtie.rb +1 -3
- data/lib/generated-assets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 270d5c1b58c3e458b4498ef3316f98e2797352ee
|
4
|
+
data.tar.gz: 6225de66325286d4bb96c09497029865fd4cd9de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b29756801f0a778c1acb2207c8c5333564ebb72551c4aa2d34dbb8229c9108e169f2d4e866908e315301ff35d29f2d0f266930048f10190fa22ec3483497f1a5
|
7
|
+
data.tar.gz: abbf1bfd03a585c3bcc44ec568502d6f575c0d6ea75657f4c9f1a77aa8cc1b679a62e42cd84b6bc2f284b2359c35955c6985fcbe2d0c45fbbacab7105c7feb9d
|
@@ -7,6 +7,17 @@ module GeneratedAssets
|
|
7
7
|
attr_reader :app, :prefix, :entries
|
8
8
|
attr_reader :before_hooks, :after_hooks
|
9
9
|
|
10
|
+
# Force generated-assets to write files and add stuff to the precompile
|
11
|
+
# list. It works similarly to config.assets compile, but applies only to
|
12
|
+
# generated assets. Under normal circumstances, generated-assets will
|
13
|
+
# detect when it should do these things for you, usually when
|
14
|
+
# 1) config.assets.compile is true, or 2) when running
|
15
|
+
# rake assets:precompile. If you've got a non-standard setup though,
|
16
|
+
# set this property to a truthy value when you're compiling assets or
|
17
|
+
# running your app in an environment (i.e. development) that requires
|
18
|
+
# generated assets to be available.
|
19
|
+
attr_accessor :compile
|
20
|
+
|
10
21
|
def initialize(app, prefix)
|
11
22
|
@app = app
|
12
23
|
@prefix = prefix
|
@@ -20,6 +31,7 @@ module GeneratedAssets
|
|
20
31
|
end
|
21
32
|
|
22
33
|
def apply!
|
34
|
+
return unless should_apply?
|
23
35
|
before_hooks.each(&:call)
|
24
36
|
|
25
37
|
write_files
|
@@ -46,6 +58,14 @@ module GeneratedAssets
|
|
46
58
|
end
|
47
59
|
end
|
48
60
|
|
61
|
+
def should_apply?
|
62
|
+
app.config.assets.compile ||
|
63
|
+
compile || (
|
64
|
+
defined?(::Rake) &&
|
65
|
+
::Rake.application.top_level_tasks.include?('assets:precompile')
|
66
|
+
)
|
67
|
+
end
|
68
|
+
|
49
69
|
def ensure_prefix_dir_exists
|
50
70
|
FileUtils.mkdir_p(prefix)
|
51
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: generated-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dutro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|