redmine_plugin_asset_pipeline 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +3 -7
- data/lib/generators/redmine_pipeline/private_assets_initializer/private_assets_initializer_generator.rb +4 -2
- data/lib/generators/redmine_pipeline/private_assets_initializer/templates/09-unpatch_10_patches.rb +7 -0
- data/lib/generators/redmine_pipeline/private_assets_initializer/templates/{35-patch_assets_mirror.rb → 25-patch_assets_mirror.rb} +8 -0
- data/lib/redmine_plugin_asset_pipeline/infectors/application_helper.rb +12 -9
- data/lib/redmine_plugin_asset_pipeline/plugin.rb +6 -5
- data/lib/redmine_plugin_asset_pipeline/version.rb +1 -1
- metadata +16 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ffcd3856eb4d11cdb694dae4afa70bf45370a69fdb088cbca9e6196b96e9f0fc
|
4
|
+
data.tar.gz: e21850d1c631583c5b2e1a2a92557511fb3a3e32d28f042b53b17e5b933b74de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6651a7e5fb0cb81234fb1cac4267e1a4e42bd663cabe892f0578fb65f86e5cf62bad7c0e5616e7d0273d23757254e77d35d835bc2b4061314ec9aa2a8a259b77
|
7
|
+
data.tar.gz: 24212ae60dbba13c33f45b93d3f907cf57d934bf817db3dbcdb31d153eb1d83342738fccefa649d5fd686f16a08facb1dae93113b48f95ac334fb1b9331f7fd7
|
data/README.md
CHANGED
@@ -66,13 +66,9 @@ conflicts with rails routes).
|
|
66
66
|
Our recommendations:
|
67
67
|
|
68
68
|
* Move redmine assets to directory `private/assets` (simple create it in root of Redmine)
|
69
|
-
* Run `rails generate redmine_pipeline:private_assets_initializer` (that create
|
70
|
-
`
|
71
|
-
private directory)
|
72
|
-
* Unfortunately file from previous step shouldn't work well without modification of standard
|
73
|
-
Redmine initializer. For fix it move all lines started on: `Redmine::Plugin.load` from `30-redmine.rb`
|
74
|
-
to new initializer goes after `35-patch_assets_mirror`. For example `36-redmine_plugin_init`
|
75
|
-
* Set `config.assets.prefix` to avoid a potential conflicts
|
69
|
+
* Run `rails generate redmine_pipeline:private_assets_initializer` (that create initializers
|
70
|
+
`09-unpatch-10-patches` and `25-patch_assets_mirror`, that patch Plugin class of Redmine for copy plugin assets to
|
71
|
+
private directory and cancel redmine patch that broke sprockets)
|
76
72
|
* Fix standard Redmine \*.css files (some paths in css hardcoded to the public root)
|
77
73
|
|
78
74
|
Then restart your Redmine instance.
|
@@ -2,8 +2,10 @@ module RedminePipeline
|
|
2
2
|
class PrivateAssetsInitializerGenerator < Rails::Generators::Base
|
3
3
|
source_root File.expand_path("../templates", __FILE__)
|
4
4
|
def copy_initializer_file
|
5
|
-
|
6
|
-
copy_file "#{
|
5
|
+
unpatch = '09-unpatch_10_patches'
|
6
|
+
copy_file "#{unpatch}.rb", "config/initializers/#{unpatch}.rb"
|
7
|
+
patch = '25-patch_assets_mirror'
|
8
|
+
copy_file "#{patch}.rb", "config/initializers/#{patch}.rb"
|
7
9
|
end
|
8
10
|
end
|
9
11
|
end
|
@@ -81,18 +81,21 @@ module RedminePluginAssetPipeline::Infectors::ApplicationHelper
|
|
81
81
|
# Copy relevant config to AV context
|
82
82
|
app = Rails.application
|
83
83
|
config = app.config
|
84
|
-
self.debug_assets = config.assets.debug
|
85
|
-
self.digest_assets = config.assets.digest
|
86
|
-
self.assets_prefix = config.assets.prefix
|
87
84
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
context.config = config.action_controller
|
85
|
+
self.debug_assets = config.assets.debug
|
86
|
+
self.digest_assets = config.assets.digest
|
87
|
+
self.assets_prefix = config.assets.prefix
|
88
|
+
self.assets_precompile = config.assets.precompile
|
93
89
|
|
94
|
-
self.assets_environment = app.assets
|
90
|
+
self.assets_environment = app.assets
|
95
91
|
self.assets_manifest = app.assets_manifest
|
92
|
+
|
93
|
+
self.resolve_assets_with = config.assets.resolve_with
|
94
|
+
|
95
|
+
self.check_precompiled_asset = config.assets.check_precompiled_asset
|
96
|
+
self.unknown_asset_fallback = config.assets.unknown_asset_fallback
|
97
|
+
# Expose the app precompiled asset check to the view
|
98
|
+
self.precompiled_asset_checker = -> logical_path { app.asset_precompiled? logical_path }
|
96
99
|
end.new
|
97
100
|
end
|
98
101
|
end
|
@@ -32,11 +32,12 @@ class RedminePluginAssetPipeline::Plugin < ::Rails::Engine
|
|
32
32
|
# Register our processor (subclass of the standard one which adds a directive for redmine plugins)
|
33
33
|
initializer 'redmine.sprockets_processor', after: 'sprockets.environment' do
|
34
34
|
require 'redmine_plugin_asset_pipeline/sprockets_processor'
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
RedmineApp::Application.config.assets.configure do |env|
|
36
|
+
env.unregister_preprocessor('text/css', Sprockets::DirectiveProcessor)
|
37
|
+
env.unregister_preprocessor('application/javascript', Sprockets::DirectiveProcessor)
|
38
|
+
env.register_preprocessor('text/css', RedminePluginAssetPipeline::SprocketsProcessor)
|
39
|
+
env.register_preprocessor('application/javascript', RedminePluginAssetPipeline::SprocketsProcessor)
|
40
|
+
end
|
40
41
|
end
|
41
42
|
|
42
43
|
config.to_prepare do
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_plugin_asset_pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tab10id
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sprockets
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: Asset pipeline for Redmine
|
@@ -73,14 +73,15 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- .gitignore
|
76
|
+
- ".gitignore"
|
77
77
|
- Gemfile
|
78
78
|
- LICENSE.txt
|
79
79
|
- README.md
|
80
80
|
- Rakefile
|
81
81
|
- init.rb
|
82
82
|
- lib/generators/redmine_pipeline/private_assets_initializer/private_assets_initializer_generator.rb
|
83
|
-
- lib/generators/redmine_pipeline/private_assets_initializer/templates/
|
83
|
+
- lib/generators/redmine_pipeline/private_assets_initializer/templates/09-unpatch_10_patches.rb
|
84
|
+
- lib/generators/redmine_pipeline/private_assets_initializer/templates/25-patch_assets_mirror.rb
|
84
85
|
- lib/redmine_plugin_asset_pipeline.rb
|
85
86
|
- lib/redmine_plugin_asset_pipeline/configuration.rb
|
86
87
|
- lib/redmine_plugin_asset_pipeline/infectors.rb
|
@@ -104,20 +105,18 @@ require_paths:
|
|
104
105
|
- lib
|
105
106
|
required_ruby_version: !ruby/object:Gem::Requirement
|
106
107
|
requirements:
|
107
|
-
- -
|
108
|
+
- - ">="
|
108
109
|
- !ruby/object:Gem::Version
|
109
110
|
version: '0'
|
110
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
112
|
requirements:
|
112
|
-
- -
|
113
|
+
- - ">="
|
113
114
|
- !ruby/object:Gem::Version
|
114
115
|
version: '0'
|
115
116
|
requirements: []
|
116
|
-
|
117
|
-
rubygems_version: 2.0.2
|
117
|
+
rubygems_version: 3.0.3
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: Asset pipeline for Redmine
|
121
121
|
test_files:
|
122
122
|
- test/test_helper.rb
|
123
|
-
has_rdoc:
|