redmine_plugin_asset_pipeline 0.0.2 → 0.0.3

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: c8607b90303306caa6ac05676ebedc9c1c93e151
4
- data.tar.gz: b3784b2ab2839be947d3c33107beeac1e3911b9a
3
+ metadata.gz: 91a4a9461b84bbf19043080f128f089fd85d3c74
4
+ data.tar.gz: 72b472baeee4c937c37c8363ddc1c1686b7ed77d
5
5
  SHA512:
6
- metadata.gz: 7c13d262d64bec8c75d3825756bb14bb8200b539fd1e95488f1cf1cb91fce1e12ecd40e59e90f8b6c343646182763337bb7012bbae33a8002b5a575a334e90b1
7
- data.tar.gz: 7d017dc542ca8ca39d787c739f264363d00212fc1bcb8f37d15f05bb9b65a7bb174794ee8bb16ec76094f5a16ea5073ebf42716b4d0f265c71f9ead7c871b9d4
6
+ metadata.gz: 0ce8dcd7185a4908425dc34db083dbf526e5f3f536a5a530069580dc0a59f87bc32afea5f562df543d8647e907bed81add8c46c49ab43bc2e65acc1b743d54f6
7
+ data.tar.gz: 7d55ea3df973138e063d269b6ad7c196abe41c566e1d528fd03608c7f39ecf955d92bd8fd5dce484b044b8f368f46ccf3f1cc01c35159a32d12e94f7bc113134
@@ -33,11 +33,8 @@ module RedminePluginAssetPipeline
33
33
  end
34
34
  end
35
35
 
36
- config.after_initialize do
36
+ config.to_prepare do
37
37
  require_dependency 'redmine_plugin_asset_pipeline/application_helper_patch'
38
- unless ApplicationHelper.included_modules.include? RedminePluginAssetPipeline::ApplicationHelperPatch
39
- ApplicationHelper.send(:include, RedminePluginAssetPipeline::ApplicationHelperPatch)
40
- end
41
38
  end
42
39
 
43
40
  end
@@ -1,54 +1,46 @@
1
- module RedminePluginAssetPipeline
2
- module ApplicationHelperPatch
3
- def self.included(base)
4
- base.send(:include, InstanceMethods)
5
- base.class_eval do
6
- def assets_prefix
7
- Rails.application.config.assets.prefix.gsub(/^\//, '')
8
- end
1
+ require_dependency 'application_helper'
9
2
 
10
- def stylesheet_link_tag(*sources)
11
- options = sources.last.is_a?(Hash) ? sources.pop : {}
12
- plugin = options.delete(:plugin)
13
- sources = sources.map do |source|
14
- if plugin
15
- "/#{[assets_prefix, "#{plugin}/stylesheets/#{source}"].join('/')}"
16
- elsif current_theme && current_theme.stylesheets.include?(source)
17
- current_theme.stylesheet_path(source)
18
- else
19
- "/#{[assets_prefix, "stylesheets/#{source}"].join('/')}"
20
- end
21
- end
22
- super *sources, options
23
- end
3
+ module ApplicationHelper
4
+ def assets_prefix
5
+ Rails.application.config.assets.prefix.gsub(/^\//, '')
6
+ end
24
7
 
25
- def javascript_include_tag(*sources)
26
- options = sources.last.is_a?(Hash) ? sources.pop : {}
27
- plugin = options.delete(:plugin)
28
- sources = sources.map do |source|
29
- if plugin
30
- "/#{[assets_prefix, "#{plugin}/javascripts/#{source}"].join('/')}"
31
- else
32
- "/#{[assets_prefix, "javascripts/#{source}"].join('/')}"
33
- end
34
- end
35
- super *sources, options
36
- end
8
+ def stylesheet_link_tag(*sources)
9
+ options = sources.last.is_a?(Hash) ? sources.pop : {}
10
+ plugin = options.delete(:plugin)
11
+ sources = sources.map do |source|
12
+ if plugin
13
+ "/#{[assets_prefix, "#{plugin}/stylesheets/#{source}"].join('/')}"
14
+ elsif current_theme && current_theme.stylesheets.include?(source)
15
+ current_theme.stylesheet_path(source)
16
+ else
17
+ "/#{[assets_prefix, "stylesheets/#{source}"].join('/')}"
18
+ end
19
+ end
20
+ super *sources, options
21
+ end
37
22
 
38
- def image_tag(source, options={})
39
- if plugin = options.delete(:plugin)
40
- source = "/#{[assets_prefix, "#{plugin}/images/#{source}"].join('/')}"
41
- elsif current_theme && current_theme.images.include?(source)
42
- source = current_theme.image_path(source)
43
- else
44
- source = "/#{[assets_prefix, "images/#{source}"].join('/')}"
45
- end
46
- super source, options
47
- end
23
+ def javascript_include_tag(*sources)
24
+ options = sources.last.is_a?(Hash) ? sources.pop : {}
25
+ plugin = options.delete(:plugin)
26
+ sources = sources.map do |source|
27
+ if plugin
28
+ "/#{[assets_prefix, "#{plugin}/javascripts/#{source}"].join('/')}"
29
+ else
30
+ "/#{[assets_prefix, "javascripts/#{source}"].join('/')}"
48
31
  end
49
32
  end
33
+ super *sources, options
34
+ end
50
35
 
51
- module InstanceMethods
36
+ def image_tag(source, options={})
37
+ if plugin = options.delete(:plugin)
38
+ source = "/#{[assets_prefix, "#{plugin}/images/#{source}"].join('/')}"
39
+ elsif current_theme && current_theme.images.include?(source)
40
+ source = current_theme.image_path(source)
41
+ else
42
+ source = "/#{[assets_prefix, "images/#{source}"].join('/')}"
52
43
  end
44
+ super source, options
53
45
  end
54
46
  end
@@ -1,3 +1,3 @@
1
1
  module RedminePluginAssetPipeline
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_plugin_asset_pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tab10id