redmine_plugin_asset_pipeline 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +46 -14
- data/lib/redmine_plugin_asset_pipeline/plugin_patch.rb +8 -1
- data/lib/redmine_plugin_asset_pipeline/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee102d458d074760cad0bf032033b4b63880d3b5
|
4
|
+
data.tar.gz: c6d21a56a11b8976f810d3ff2e714dfbfb2bc5f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 403e98dab4c715b8d8183e2356191a10a822f6a6e8fc181e1905adec677a0c7264bf637d61508c6f359d264fe72b58ee4d269fe66d555e05738271254c450b2e
|
7
|
+
data.tar.gz: 6758219cad88f5d3b54f91a4e2352a7ba9258a5df309aa2afb08bfaa42ef41a01454c1367facb098ca33bd85612f07c511be5880dbc10a430d4d6fb7cab6cb53
|
data/README.md
CHANGED
@@ -1,41 +1,52 @@
|
|
1
|
-
Redmine Asset Pipeline plugin
|
1
|
+
Redmine Plugin Asset Pipeline plugin
|
2
2
|
=============================
|
3
3
|
|
4
|
-
This plugin adds asset pipeline
|
4
|
+
This plugin adds asset pipeline features to Redmine and Redmine plugins.
|
5
5
|
|
6
6
|
For who ?
|
7
7
|
---------
|
8
|
-
This plugin only targets plugin developers. You shouldn't try to install this without a
|
8
|
+
This plugin only targets plugin developers. You shouldn't try to install this without a
|
9
|
+
deep understanding of the benefits and the way to make it work.
|
9
10
|
|
10
11
|
Why ?
|
11
12
|
-----
|
12
|
-
By default, Redmine
|
13
|
+
By default, Redmine not support asset pipeline feature (many rewrites of standard rails
|
14
|
+
functionality).
|
13
15
|
|
14
|
-
Having the asset pipeline enabled would be interesting though if you have a lot of plugins
|
16
|
+
Having the asset pipeline enabled would be interesting though if you have a lot of plugins
|
17
|
+
or when you want to have possibility for normal usage different preprocessors like sass,
|
18
|
+
less, CoffeeScript.
|
15
19
|
|
16
20
|
How ?
|
17
21
|
-----
|
18
|
-
The plugin
|
22
|
+
The plugin try to restore normal pipeline functionality in Redmine and add some features
|
23
|
+
for comfortable Redmine plugins development.
|
19
24
|
|
20
25
|
Features of this plugin
|
21
26
|
-----------------------
|
22
|
-
* serve main app assets with the asset pipeline
|
23
|
-
* serve plugin assets with the asset pipeline
|
24
|
-
*
|
25
|
-
|
26
|
-
|
27
|
-
|
27
|
+
* serve main app assets with the asset pipeline
|
28
|
+
* serve plugin assets with the asset pipeline
|
29
|
+
* ability for concatenate .css and .js assets in one file (just create `_common_application.(js/css)`
|
30
|
+
in your plugin and use sprocket directives in those files, than create aggregating css/js in one
|
31
|
+
of your plugin and use sprocket directive require_redmine_plugins on it)
|
32
|
+
e.g. `//= require_redmine_plugins javascripts` for js
|
33
|
+
* minify assets in the pipeline
|
34
|
+
* support digest option of asset pipeline config
|
35
|
+
* in development environment you have assets src directory than have symlinks to the plugin
|
36
|
+
directories, so you don't need run `redmine:plugins:assets` or restart server every time
|
37
|
+
when you edit asset in your plugin
|
28
38
|
|
29
39
|
Known problems
|
30
40
|
--------------
|
31
|
-
*
|
41
|
+
* Redmine themes are not processed through the pipeline
|
42
|
+
* Plugin code looks a little ugly
|
32
43
|
|
33
44
|
Installation
|
34
45
|
------------
|
35
46
|
|
36
47
|
This plugin is only compatible with Redmine 2.1.0+. It is distributed as a ruby gem.
|
37
48
|
|
38
|
-
Add this line to your redmine's Gemfile
|
49
|
+
Add this line to your redmine's Gemfile:
|
39
50
|
|
40
51
|
gem 'redmine_plugin_asset_pipeline'
|
41
52
|
|
@@ -43,6 +54,27 @@ And then execute:
|
|
43
54
|
|
44
55
|
$ bundle install
|
45
56
|
|
57
|
+
Configure assets in your application (core `Redmine config/application.rb`)
|
58
|
+
Unfortunately you can't configure pipeline in gem or in redmine plugin, many gems may work
|
59
|
+
wrong if pipeline functionality enabled not in application (according to order of gem loading).
|
60
|
+
|
61
|
+
You can set `config.assets.paths` to public directory of Redmine but that can provoke some
|
62
|
+
problems with preprocessors (if you precompile assets).
|
63
|
+
Also problems may occur if you leave standard Redmine assets in root of public (possible
|
64
|
+
conflicts with rails routes).
|
65
|
+
|
66
|
+
Our recommendations:
|
67
|
+
|
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 initializer
|
70
|
+
`35-patch_assets_mirror`, that patch Plugin class of Redmine for copy plugin assets to
|
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
|
76
|
+
* Fix standard Redmine \*.css files (some paths in css hardcoded to the public root)
|
77
|
+
|
46
78
|
Then restart your Redmine instance.
|
47
79
|
|
48
80
|
Note that general instructions for plugins [here](http://www.redmine.org/wiki/redmine/Plugins) don't apply here.
|
@@ -28,13 +28,20 @@ module RedminePluginAssetPipeline
|
|
28
28
|
def mirror_assets_to_private
|
29
29
|
source = assets_directory
|
30
30
|
destination = private_directory
|
31
|
+
|
32
|
+
unless File.exist?(self.class.private_directory)
|
33
|
+
FileUtils.mkdir_p(self.class.private_directory)
|
34
|
+
end
|
35
|
+
|
31
36
|
if File.exist?(destination)
|
32
37
|
FileUtils.rm_rf(destination)
|
33
38
|
end
|
34
39
|
return unless File.directory?(source)
|
35
40
|
|
36
41
|
if RedminePluginAssetPipeline.config.use_ln
|
37
|
-
|
42
|
+
if File.exist?(source)
|
43
|
+
FileUtils.ln_s(source, destination)
|
44
|
+
end
|
38
45
|
else
|
39
46
|
source_files = Dir[source + "/**/*"]
|
40
47
|
source_dirs = source_files.select { |d| File.directory?(d) }
|
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.13
|
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
|
+
date: 2014-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|