emerald-rails 0.0.3 → 0.0.4
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,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,9 +1,20 @@
|
|
1
1
|
Description:
|
2
|
-
|
3
|
-
whom is going to edit or debug the code file.
|
2
|
+
Creates the following directories inside app/assets/javascripts/:
|
4
3
|
|
5
|
-
|
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/
|
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
|
7
|
-
|
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
|