editarea-rails 2.0.2 → 2.1.0

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.
data/README.md CHANGED
@@ -19,9 +19,9 @@ Or install it yourself as:
19
19
 
20
20
  ## Usage
21
21
 
22
- add to application.js
22
+ add to application.js and copy static files
23
23
 
24
- //= require edit_area_full
24
+ $ rails generate editarea:install
25
25
 
26
26
  view code:
27
27
 
@@ -3,9 +3,6 @@ require "editarea-rails/version"
3
3
  module Editarea
4
4
  module Rails
5
5
  class Engine < ::Rails::Engine
6
- initializer 'editarea.load_static_assets' do |app|
7
- app.middleware.use ::ActionDispatch::Static, "#{root}/vendor"
8
- end
9
6
  end
10
7
  end
11
8
  end
@@ -1,5 +1,5 @@
1
1
  module Editarea
2
2
  module Rails
3
- VERSION = "2.0.2"
3
+ VERSION = "2.1.0"
4
4
  end
5
5
  end
@@ -0,0 +1,23 @@
1
+ require 'rails/generators'
2
+
3
+ module Editarea
4
+ class InstallGenerator < ::Rails::Generators::Base
5
+ desc "Copy static files and add js to application.js"
6
+ source_root File.expand_path('../templates', __FILE__)
7
+
8
+ def add_js
9
+ js_manifest = 'app/assets/javascripts/application.js'
10
+
11
+ if File.exist?(js_manifest)
12
+ insert_into_file js_manifest, "//= require edit_area_full\n", :after => "jquery_ujs\n"
13
+ else
14
+ copy_file "application.js", js_manifest
15
+ end
16
+ end
17
+
18
+
19
+ def copy_assets
20
+ directory File.expand_path("../../../../vendor/assets", __FILE__), "public/assets"
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,10 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require edit_area_full
10
+ //= require_tree .
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: editarea-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-05 00:00:00.000000000 Z
12
+ date: 2013-08-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -34,6 +34,8 @@ executables: []
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
+ - lib/generators/editarea/templates/application.js
38
+ - lib/generators/editarea/install_generator.rb
37
39
  - lib/editarea-rails/version.rb
38
40
  - lib/editarea-rails.rb
39
41
  - vendor/assets/images/fullscreen.gif