ae_skip_asset_pipeline 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ae_skip_asset_pipeline.rb +36 -17
- data/lib/ae_skip_asset_pipeline/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a74a60a685e3481ef8a5e5e3d395602f7822db9d0fa805e8357c435425823ecd
|
4
|
+
data.tar.gz: ac711aa1326855309527760e3d06a1c8bca533849dafa8bd944de7e646be9f4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f647e91aaf518d8ce7667e138ad8b0e370159b39130b416e69bcd4c38d926837ff5b29333f99b42ccb991897b1ec27f7d2e3025367aa29c8a6c41cc55b585da9
|
7
|
+
data.tar.gz: 7d8e8cc97e5bf852d1d023946fd64cb963079480fc2fca554ef6ba41d8f1236e6e4c154bb59446904cfd1198d3fedee511c138dcf48f88cf5fefb5388af50f11
|
@@ -6,28 +6,47 @@ require 'ae_skip_asset_pipeline/version'
|
|
6
6
|
module AeSkipAssetPipeline
|
7
7
|
mattr_accessor :enabled
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
module AssetPipelineMethods
|
10
|
+
def javascript_packs_with_chunks_tag(*args)
|
11
|
+
super unless AeSkipAssetPipeline.enabled
|
12
|
+
end
|
13
|
+
|
14
|
+
def javascript_include_tag(*args)
|
15
|
+
super unless AeSkipAssetPipeline.enabled
|
16
|
+
end
|
17
|
+
|
18
|
+
def stylesheet_packs_with_chunks_tag(*args)
|
19
|
+
super unless AeSkipAssetPipeline.enabled
|
20
|
+
end
|
21
|
+
|
22
|
+
def stylesheet_link_tag(*args)
|
23
|
+
super unless AeSkipAssetPipeline.enabled
|
24
|
+
end
|
25
|
+
|
26
|
+
def path_to_asset(source, options={})
|
27
|
+
super(source, options.merge(skip_pipeline: AeSkipAssetPipeline.enabled))
|
28
|
+
end
|
11
29
|
end
|
12
30
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
31
|
+
module HelperMethods
|
32
|
+
def save_current_state_and_set_asset_pipeline_enabled(enabled = true)
|
33
|
+
@current_skip_status = AeSkipAssetPipeline.enabled
|
34
|
+
AeSkipAssetPipeline.enabled = !enabled
|
35
|
+
end
|
36
|
+
|
37
|
+
def restore_old_state_of_asset_pipeline_enabled
|
38
|
+
AeSkipAssetPipeline.enabled = @current_skip_status
|
39
|
+
end
|
40
|
+
|
41
|
+
def with_asset_pipeline_enabled(enabled = true)
|
42
|
+
save_current_state_and_set_asset_pipeline_enabled(enabled)
|
43
|
+
yield
|
44
|
+
restore_old_state_of_asset_pipeline_enabled
|
45
|
+
end
|
27
46
|
end
|
28
47
|
end
|
29
48
|
|
30
49
|
AeSkipAssetPipeline.enabled = true
|
31
50
|
|
32
|
-
ActionView::Base.prepend AeSkipAssetPipeline
|
51
|
+
ActionView::Base.prepend AeSkipAssetPipeline::AssetPipelineMethods
|
33
52
|
|