redmine_plugin_asset_pipeline 0.0.10 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32c6c1262932a660105027633a4db9595fad559d
4
- data.tar.gz: 2858b901fdcb9c87e905f11f8fc971ca3a093e7e
3
+ metadata.gz: f69a414b7ef365a32b7a3a817bc5af4db18a61ca
4
+ data.tar.gz: c3e4d2fcca90345cdce76bbcbde18b374cfb8b81
5
5
  SHA512:
6
- metadata.gz: 7c4fbcc94210ccf17a0292abeef07d2751f4bcad8b4425811ca857b910baccb401ce9198b785ac2ac081e6437be0f8377cae9eea0bd2b7d92132ddbae5dd4d0a
7
- data.tar.gz: bc4d527cf689a5547ae7921457f5204e6d1e5cdae71b14ecf81e42cc38b2aca6221a90686e0d41d4bfa85246a525525ca0a2d4420053df4d3a1db565a52951aa
6
+ metadata.gz: 4cb2b4951b8bcfc39666ab1c23ad660d1a63094df00b93b29b6f804ab1399627460923ba90e0b5f6c1846c15762a6de0cc9f33c33d5c4a6e3dc76108be54952d
7
+ data.tar.gz: 7ad912d8ba8b3613872f649e0b4115967615a0f99aeb840c89215ff1b48da47806017cd305f222a7fd2a9a801787e4b9135e2a9c3e684b6fddda1a3d7c0676b7
data/.gitignore CHANGED
@@ -3,6 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ .idea/*
6
7
  Gemfile.lock
7
8
  InstalledFiles
8
9
  _yardoc
@@ -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 = options.delete(:plugin)
6
+ plugin = options.delete(:plugin)
7
7
  debug = options.key?(:debug) ? options.delete(:debug) : debug_assets?
8
- body = options.key?(:body) ? options.delete(:body) : false
9
- digest = options.key?(:digest) ? options.delete(:digest) : digest_assets?
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
- "stylesheets/#{source}"
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
- if debug && asset = asset_for(source, 'css')
21
- asset.to_a.map { |dep|
22
- super(dep.pathname.to_s, { href: asset_path(dep, ext: 'css', body: true, protocol: :request, digest: digest) }.merge!(options))
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
- super(source.to_s, { href: asset_path(source, ext: 'css', body: body, protocol: :request, digest: digest) }.merge!(options))
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.flatten.uniq.join("\n").html_safe
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 = options.delete(:plugin)
47
+ plugin = options.delete(:plugin)
33
48
  debug = options.key?(:debug) ? options.delete(:debug) : debug_assets?
34
- body = options.key?(:body) ? options.delete(:body) : false
35
- digest = options.key?(:digest) ? options.delete(:digest) : digest_assets?
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
- "javascripts/#{source}"
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
- if debug && asset = asset_for(source, 'js')
45
- asset.to_a.map { |dep|
46
- super(dep.pathname.to_s, { src: asset_path(dep, ext: 'js', body: true, digest: digest) }.merge!(options))
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
- super(source.to_s, { src: asset_path(source, ext: 'js', body: body, digest: digest) }.merge!(options))
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.flatten.uniq.join("\n").html_safe
79
+ end.compact.uniq.join("\n").html_safe
52
80
  end
53
81
 
54
82
  def image_tag(source, options={})
@@ -1,3 +1,3 @@
1
1
  module RedminePluginAssetPipeline
2
- VERSION = '0.0.10'
2
+ VERSION = '0.0.12'
3
3
  end
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.10
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-10 00:00:00.000000000 Z
11
+ date: 2014-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler