redmine_plugin_asset_pipeline 0.0.10 → 0.0.12
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f69a414b7ef365a32b7a3a817bc5af4db18a61ca
|
4
|
+
data.tar.gz: c3e4d2fcca90345cdce76bbcbde18b374cfb8b81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cb2b4951b8bcfc39666ab1c23ad660d1a63094df00b93b29b6f804ab1399627460923ba90e0b5f6c1846c15762a6de0cc9f33c33d5c4a6e3dc76108be54952d
|
7
|
+
data.tar.gz: 7ad912d8ba8b3613872f649e0b4115967615a0f99aeb840c89215ff1b48da47806017cd305f222a7fd2a9a801787e4b9135e2a9c3e684b6fddda1a3d7c0676b7
|
data/.gitignore
CHANGED
@@ -3,52 +3,80 @@ require_dependency 'application_helper'
|
|
3
3
|
module ApplicationHelper
|
4
4
|
def stylesheet_link_tag(*sources)
|
5
5
|
options = sources.extract_options!
|
6
|
-
plugin
|
6
|
+
plugin = options.delete(:plugin)
|
7
7
|
debug = options.key?(:debug) ? options.delete(:debug) : debug_assets?
|
8
|
-
body = options.key?(:body)
|
9
|
-
digest = options.key?(:digest)
|
8
|
+
body = options.key?(:body) ? options.delete(:body) : false
|
9
|
+
digest = options.key?(:digest) ? options.delete(:digest) : digest_assets?
|
10
10
|
sources.map! do |source|
|
11
11
|
if plugin
|
12
12
|
"#{plugin}/stylesheets/#{source}"
|
13
13
|
elsif current_theme && current_theme.stylesheets.include?(source)
|
14
14
|
current_theme.stylesheet_path(source)
|
15
15
|
else
|
16
|
-
|
16
|
+
# NOTE: bugfix aka crutch for asset from gem
|
17
|
+
["stylesheets/#{source}", source].
|
18
|
+
find{|s| asset_for(s, 'css').present?} || "stylesheets/#{source}"
|
17
19
|
end
|
18
20
|
end
|
19
21
|
sources.collect do |source|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
asset = asset_for(source, 'css')
|
23
|
+
if debug && asset
|
24
|
+
asset.to_a.map do |dep|
|
25
|
+
single_asset_path = asset_path(dep, ext: 'css',
|
26
|
+
body: true,
|
27
|
+
protocol: :request,
|
28
|
+
digest: digest)
|
29
|
+
# TODO: here we must try to make more pretty solution
|
30
|
+
next if single_asset_path.blank?
|
31
|
+
super(dep.pathname.to_s, { href: single_asset_path }.merge!(options))
|
32
|
+
end.compact
|
24
33
|
else
|
25
|
-
|
34
|
+
single_asset_path = asset_path(source, ext: 'css',
|
35
|
+
body: body,
|
36
|
+
protocol: :request,
|
37
|
+
digest: digest)
|
38
|
+
# TODO: here we must try to make more pretty solution
|
39
|
+
next if single_asset_path.blank?
|
40
|
+
super(source.to_s, { href: single_asset_path }.merge!(options))
|
26
41
|
end
|
27
|
-
end.
|
42
|
+
end.compact.uniq.join("\n").html_safe
|
28
43
|
end
|
29
44
|
|
30
45
|
def javascript_include_tag(*sources)
|
31
46
|
options = sources.last.is_a?(Hash) ? sources.pop : {}
|
32
|
-
plugin
|
47
|
+
plugin = options.delete(:plugin)
|
33
48
|
debug = options.key?(:debug) ? options.delete(:debug) : debug_assets?
|
34
|
-
body = options.key?(:body)
|
35
|
-
digest = options.key?(:digest)
|
49
|
+
body = options.key?(:body) ? options.delete(:body) : false
|
50
|
+
digest = options.key?(:digest) ? options.delete(:digest) : digest_assets?
|
36
51
|
sources.map! do |source|
|
37
52
|
if plugin
|
38
53
|
"#{plugin}/javascripts/#{source}"
|
39
54
|
else
|
40
|
-
|
55
|
+
# NOTE: bugfix aka crutch for asset from gem
|
56
|
+
["javascripts/#{source}", source].
|
57
|
+
find{|s| asset_for(s, 'js').present?} || "javascripts/#{source}"
|
41
58
|
end
|
42
59
|
end
|
43
60
|
sources.collect do |source|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
61
|
+
asset = asset_for(source, 'js')
|
62
|
+
if debug && asset
|
63
|
+
asset.to_a.map do |dep|
|
64
|
+
single_asset_path = asset_path(dep, ext: 'js',
|
65
|
+
body: true,
|
66
|
+
digest: digest)
|
67
|
+
# TODO: here we must try to make more pretty solution
|
68
|
+
next if single_asset_path.blank?
|
69
|
+
super(dep.pathname.to_s, { src: single_asset_path }.merge!(options))
|
70
|
+
end.compact
|
48
71
|
else
|
49
|
-
|
72
|
+
single_asset_path = asset_path(source, ext: 'js',
|
73
|
+
body: body,
|
74
|
+
digest: digest)
|
75
|
+
# TODO: here we must try to make more pretty solution
|
76
|
+
next if single_asset_path.blank?
|
77
|
+
super(source.to_s, { src: single_asset_path }.merge!(options))
|
50
78
|
end
|
51
|
-
end.
|
79
|
+
end.compact.uniq.join("\n").html_safe
|
52
80
|
end
|
53
81
|
|
54
82
|
def image_tag(source, options={})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_plugin_asset_pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tab10id
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|