ace-rails-ap 3.0.3 → 4.0.0

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: 1a146f781a512a5ab622bfb8a3fad21a59142249
4
- data.tar.gz: a049cebb1545b3dc069e7fc5af514c6cc90596f3
3
+ metadata.gz: be8935634992bbd9473e1842eb231a30d0d31244
4
+ data.tar.gz: 6736d38668d527d593d81110945c289bab4c2a83
5
5
  SHA512:
6
- metadata.gz: 2da45a8b12d4fdbd99e9e4e9a7f053af094f7ba00d676f9167043333bdbd92d7c938a6840d162ba1a86ba908de3bfaae9f4fe9fcf12e208e9867e03af4952f26
7
- data.tar.gz: 4cb3ebb3ceb77f4177ec3a8e53190bc7fbeade35b4afd8ab554f5a432863a57a8da1d32707937066aa123585ab98b7ed3d6a3513851e9bc99bbff5baf44771f4
6
+ metadata.gz: b30649b31cbffb384a578c925eda11599fd18f02c14e8b7aa7c9fee00e73e8950d3540cd031f39973e90ad13a8a0940790e53187317d0e55dba21bd7be610009
7
+ data.tar.gz: b6eb56d79356dd04295a7015c0e4f5240389c6ded75452a8755e3f06c3e19c42e317e319d77a3ea43d682f7562755bbaab2ad3658ff535fbbbc2c3b3ee111aed
data/README.md CHANGED
@@ -3,29 +3,43 @@
3
3
  The [Ajax.org Cloud9 Editor (Ace)](https://github.com/ajaxorg/ace) for the Rails 3.1+ asset
4
4
  pipeline.
5
5
 
6
- ## Usage
6
+ ## Installation
7
7
 
8
- `Gemfile`:
8
+ In your Gemfile, add:
9
9
 
10
10
  ```ruby
11
11
  gem 'ace-rails-ap'
12
12
  ```
13
13
 
14
- `application.js`:
14
+ Then execute `bundle` and restart your server.
15
+
16
+ Add in your application.js file:
15
17
 
16
18
  ```javascript
17
- //= require ace/ace
18
- //= require ace/worker-html
19
+ //= require ace-rails-ap
19
20
  ```
20
21
 
21
- To include a theme or mode, put:
22
+ To include a theme or mode, add them in your application.js file:
22
23
 
23
24
  ```javascript
24
25
  //= require ace/theme-sometheme
25
26
  //= require ace/mode-somemode
26
27
  ```
27
28
 
28
- ...in your `application.js` manifest as well.
29
+ Do not include Ace workers files in your application.js file. Then just use Ace like normal.
30
+
31
+ ## Rails Asset Pipeline
32
+
33
+ Ace editor will dynamically load in run-time the workers javascript files.
34
+ ace-rails-ap play nice with rails asset pipeline by automatically configuring the precompilation of the workers files,
35
+ and by setting-up Ace to load the fingerprinted worker files. You have nothing to do, it just works.
36
+
37
+ ## Migrate from previous version of ace-rails-ap
38
+
39
+ You may have done some customisation to allow ace-rails-ap to work in production, such as adding the worker files in
40
+ `assets.precompile` of your application.rb and/or using `ace.config.setModuleUrl` function. You can remove those.
41
+
42
+ Also replace the previous javascript manifest instruction `//= require ace/ace` by the new `//= require ace-rails-ap`, and remove
43
+ all workers from your javascript manifest.
29
44
 
30
- Then just use Ace like normal.
31
45
 
@@ -1,6 +1,9 @@
1
1
  module Ace
2
2
  module Rails
3
3
  class Engine < ::Rails::Engine
4
+ initializer 'ace-rails-ap.assets.precompile' do |app|
5
+ app.config.assets.precompile += %w[ace/worker-*.js]
6
+ end
4
7
  end
5
8
  end
6
9
  end
@@ -1,5 +1,5 @@
1
1
  module Ace
2
2
  module Rails
3
- VERSION = "3.0.3"
3
+ VERSION = "4.0.0"
4
4
  end
5
5
  end
@@ -0,0 +1,2 @@
1
+ //= require ace/ace
2
+ //= require set_ace_paths
@@ -0,0 +1,5 @@
1
+ ace.config.set('basePath', '/assets/ace');
2
+ <% Dir[File.dirname(__FILE__) + '/ace/worker-*.js'].each do |file| %>
3
+ <% worker = File.basename(file, '.js').sub(/^worker-/, '') %>
4
+ ace.config.setModuleUrl("ace/mode/<%= worker %>_worker", "<%= asset_path "ace/worker-#{worker}.js" %>");
5
+ <% end %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ace-rails-ap
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Krieger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-07 00:00:00.000000000 Z
11
+ date: 2015-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -57,6 +57,7 @@ files:
57
57
  - lib/ace/rails/engine.rb
58
58
  - lib/ace/rails/version.rb
59
59
  - update.sh
60
+ - vendor/assets/javascripts/ace-rails-ap.js
60
61
  - vendor/assets/javascripts/ace/ace.js
61
62
  - vendor/assets/javascripts/ace/ext-beautify.js
62
63
  - vendor/assets/javascripts/ace/ext-chromevox.js
@@ -370,6 +371,7 @@ files:
370
371
  - vendor/assets/javascripts/ace/worker-php.js
371
372
  - vendor/assets/javascripts/ace/worker-xml.js
372
373
  - vendor/assets/javascripts/ace/worker-xquery.js
374
+ - vendor/assets/javascripts/set_ace_paths.js.erb
373
375
  homepage: https://github.com/codykrieger/ace-rails-ap
374
376
  licenses:
375
377
  - MIT