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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f69a414b7ef365a32b7a3a817bc5af4db18a61ca
4
- data.tar.gz: c3e4d2fcca90345cdce76bbcbde18b374cfb8b81
3
+ metadata.gz: ee102d458d074760cad0bf032033b4b63880d3b5
4
+ data.tar.gz: c6d21a56a11b8976f810d3ff2e714dfbfb2bc5f0
5
5
  SHA512:
6
- metadata.gz: 4cb2b4951b8bcfc39666ab1c23ad660d1a63094df00b93b29b6f804ab1399627460923ba90e0b5f6c1846c15762a6de0cc9f33c33d5c4a6e3dc76108be54952d
7
- data.tar.gz: 7ad912d8ba8b3613872f649e0b4115967615a0f99aeb840c89215ff1b48da47806017cd305f222a7fd2a9a801787e4b9135e2a9c3e684b6fddda1a3d7c0676b7
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 awesomeness to Redmine and Redmine plugins.
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 deep understanding of the benefits and the way to make it work.
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 made the deliberate (and wise) choice to disable the asset pipeline for core development. Enabling the asset pipeline by default would bring a thousand questions for people who are not in Rails and have a deep understanding of how it works. See [some of my thoughs about this here](http://www.redmine.org/issues/11445#note-9).
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, which is my case. The average page on my biggest Redmine instance downloads ~50 js/css individual files, which is a big waste in terms of performance and bandwith. I'd really like them to be minified and bundled into one application.js and one application.css.
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 reconfigures asset-related options in the main app.
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 : disabled
23
- * serve plugin assets with the asset pipeline : disabled for standard plugins ; enabled for redmine gems
24
- * minify assets in the pipeline : disabled
25
- * concatenate all plugin assets into one js + one css : ok for redmine gems
26
- * concatenate core resources with the ones of plugins : abandonned (useless)
27
- * compile coffeescript/sass/etc. : not tested yet
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
- * for now it seems that all_plugins.js loads everything already loaded in all_core.js, resulting in unecessary wasted bandwith.
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.local:
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
- FileUtils.ln_s(source, destination)
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) }
@@ -1,3 +1,3 @@
1
1
  module RedminePluginAssetPipeline
2
- VERSION = '0.0.12'
2
+ VERSION = '0.0.13'
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.12
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-24 00:00:00.000000000 Z
11
+ date: 2014-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler