berkes-drupal.rb 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/README.txt +11 -0
- data/drupal.rb.gemspec +1 -1
- data/lib/drupal/create_module.rb +14 -3
- metadata +1 -1
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -42,9 +42,20 @@ to quickly generate and manage Drupal modules.
|
|
42
42
|
|
43
43
|
View total todo items only.
|
44
44
|
drupal todo list total ./sites/all/modules
|
45
|
+
|
46
|
+
== LOCAL TEMPLATES
|
47
|
+
|
48
|
+
Create .drupal.rb/templates/ directories in your home-directory and put your
|
49
|
+
own templates there. Drupal.rb will pick these, instead of the global ones.
|
50
|
+
|
51
|
+
e.g. $ mkdir ~/.drupal.rb/
|
52
|
+
$ cp -r /path/to/gems/berkes-drupal.rb-0.0.7/var/lib/drupal/templates/ \
|
53
|
+
~/.drupal.rb/templates/
|
45
54
|
|
46
55
|
== TODO:
|
47
56
|
|
57
|
+
* Add defaults.yml-support. When .drupal.rb/defaults.yml exists, use these
|
58
|
+
instead of asking them everytime.
|
48
59
|
* Remove ':' from todo list items
|
49
60
|
* Add formatted help option
|
50
61
|
* Support versions for installer
|
data/drupal.rb.gemspec
CHANGED
data/lib/drupal/create_module.rb
CHANGED
@@ -160,7 +160,7 @@ class Drupal
|
|
160
160
|
# TODO: is \n included with STDIN?
|
161
161
|
_template = template
|
162
162
|
filepath = "#{@dir}/#{@module}/#{filepath}"
|
163
|
-
template =
|
163
|
+
template = get_template_location << template
|
164
164
|
puts "... Adding template '#{_template}' to '#{filepath}'"
|
165
165
|
contents = File.read(template)
|
166
166
|
tokens.each_pair do |token, value|
|
@@ -196,7 +196,18 @@ class Drupal
|
|
196
196
|
|
197
197
|
# Get array of templates of a certain type.
|
198
198
|
def get_templates(type)
|
199
|
-
Dir[
|
199
|
+
Dir[get_template_location << type << '/*']
|
200
|
+
end
|
201
|
+
|
202
|
+
|
203
|
+
private
|
204
|
+
def get_template_location
|
205
|
+
location = File.expand_path '~/.drupal.rb/templates/'
|
206
|
+
unless File.directory? location
|
207
|
+
location = File.dirname(__FILE__) + '/templates/'
|
208
|
+
end
|
209
|
+
return location
|
200
210
|
end
|
201
211
|
end
|
202
|
-
end
|
212
|
+
end
|
213
|
+
|