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 CHANGED
@@ -1,3 +1,9 @@
1
+
2
+ === 0.0.7 / 2009-05-02
3
+
4
+ * Cleanup and rename to drupal.rb
5
+ * Implemented ability to override global templates in a ~/.drupal.rb directory.
6
+
1
7
  === 0.0.6 / 2008-10-16
2
8
 
3
9
  * 1 Minor Feature:
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "drupal.rb"
3
- s.version = "0.0.6"
3
+ s.version = "0.0.7"
4
4
  s.date = "2008-10-16"
5
5
  s.summary = "Drupal development kit"
6
6
  s.email = "ber@webschuur.com"
@@ -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 = File.dirname(__FILE__) + "/templates/#{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[File.dirname(__FILE__) + '/templates/' << type << '/*']
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
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkes-drupal.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - tj@vision-media.ca