emerald-rails 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -19,6 +19,22 @@ before your own scripts:
19
19
 
20
20
  //= require emerald
21
21
 
22
+ Then run the Rails generator:
23
+
24
+ $ rails generate emerald:install
25
+
26
+ If you want to nest the news directories, say in the admin/ directory,
27
+ use instead:
28
+
29
+ $ rails generate emerald:install admin
30
+
31
+ This will create the following directories:
32
+
33
+ app/assets/javascripts/admin/views/
34
+ app/assets/javascripts/admin/controllers/
35
+ app/assets/javascripts/admin/models/
36
+ app/assets/javascripts/admin/routers/
37
+
22
38
  ## Usage
23
39
 
24
40
  For instructions on how to use Emerald.js, visit its page,
@@ -1,3 +1,3 @@
1
1
  module EmeraldRails
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,9 +1,20 @@
1
1
  Description:
2
- Copies emerald.js to app/assets/javascripts/ directory. Recommended for
3
- whom is going to edit or debug the code file.
2
+ Creates the following directories inside app/assets/javascripts/:
4
3
 
5
- Example:
4
+ - views/
5
+ - controllers/
6
+ - models/
7
+ - router/
8
+
9
+ If root_directory is provided, the directories will be nested inside it.
10
+
11
+ Examples:
6
12
  rails generate emerald:install
7
13
 
8
14
  This will create:
9
- app/assets/javascripts/emerald.js
15
+ app/assets/javascripts/views/
16
+
17
+ rails generate emerald:install admin
18
+
19
+ This will create:
20
+ app/assets/javascripts/admin/views/
@@ -2,9 +2,19 @@ module Emerald
2
2
  module Generators
3
3
  class InstallGenerator < Rails::Generators::Base
4
4
  source_root File.expand_path('../templates', __FILE__)
5
+ argument :root_directory, :type => :string, :default => ""
5
6
 
6
- def copy_emerald
7
- copy_file "emerald.js", "app/assets/javascripts/emerald.js"
7
+ def create_directories
8
+ empty_directory "#{dir}/views/"
9
+ empty_directory "#{dir}/controllers/"
10
+ empty_directory "#{dir}/models/"
11
+ empty_directory "#{dir}/router/"
12
+ end
13
+
14
+ private
15
+
16
+ def dir
17
+ "app/assets/javascripts/#{root_directory}"
8
18
  end
9
19
  end
10
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emerald-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: