templater 0.2.1 → 0.2.2

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.
@@ -46,7 +46,7 @@ module Templater
46
46
  def invoke!
47
47
  callback(:before)
48
48
  ::FileUtils.mkdir_p(::File.dirname(destination))
49
- ::FileUtils.copy_file(source, destination)
49
+ ::FileUtils.cp_r(source, destination)
50
50
  callback(:after)
51
51
  end
52
52
 
@@ -172,7 +172,7 @@ module Templater
172
172
  # class MyGenerator < Templater::Generator
173
173
  # option :animal
174
174
  # # other_generator will be invoked only if the option 'animal' is set to 'bear'
175
- # invoke :other_generator, :amimal => :bear
175
+ # invoke :other_generator, :animal => :bear
176
176
  # end
177
177
  def invoke(name, options={}, &block)
178
178
  self.invocations << InvocationDescription.new(name.to_sym, options, &block)
@@ -253,6 +253,8 @@ module Templater
253
253
  file
254
254
  end
255
255
  end
256
+
257
+ alias_method :directory, :file
256
258
 
257
259
  # Adds an empty directory that will be created when the generator is run.
258
260
  #
@@ -320,6 +322,8 @@ module Templater
320
322
  self.file(item.gsub(/[\.\/]/, '_').to_sym, item)
321
323
  end
322
324
  end
325
+
326
+ alias_method :directory_list, :file_list
323
327
 
324
328
  # Search a directory for templates and files and add them to this generator. Any file
325
329
  # whose extension matches one of those provided in the template_extensions parameter
data/lib/templater.rb CHANGED
@@ -42,6 +42,6 @@ module Templater
42
42
  class MalformattedArgumentError < ArgumentError #:nodoc:
43
43
  end
44
44
 
45
- VERSION = '0.2.1'
45
+ VERSION = '0.2.2'
46
46
 
47
47
  end
@@ -67,17 +67,17 @@ describe Templater::Generator, '.glob!' do
67
67
 
68
68
  @instance = @generator_class.new('/tmp/destination')
69
69
 
70
- @instance.templates.map { |t| t.name }.should == [
70
+ @instance.templates.map { |t| t.name.to_s }.sort.should == [
71
71
  :arg_js,
72
72
  :hellothar_html_feh_,
73
73
  :readme,
74
74
  :subfolder_monkey_rb,
75
75
  :test_rb,
76
- ]
77
- @instance.files.map { |f| f.name }.should == [
76
+ ].map { |i| i.to_s }.sort
77
+ @instance.files.map { |f| f.name.to_s }.sort.should == [
78
78
  :hellothar_feh_,
79
79
  :subfolder_jessica_alba_jpg
80
- ]
80
+ ].map { |i| i.to_s }.sort
81
81
  end
82
82
 
83
83
  it "should ignore ending '.%..%' and look at the extension preceding it" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: templater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
@@ -9,7 +9,7 @@ autorequire: templater
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-28 00:00:00 +03:00
12
+ date: 2008-10-02 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -57,71 +57,71 @@ files:
57
57
  - README
58
58
  - Rakefile
59
59
  - TODO
60
+ - lib/templater.rb
60
61
  - lib/templater
61
- - lib/templater/actions
62
- - lib/templater/actions/action.rb
63
- - lib/templater/actions/empty_directory.rb
64
- - lib/templater/actions/file.rb
65
- - lib/templater/actions/template.rb
62
+ - lib/templater/description.rb
63
+ - lib/templater/generator.rb
64
+ - lib/templater/manifold.rb
65
+ - lib/templater/core_ext
66
+ - lib/templater/core_ext/kernel.rb
67
+ - lib/templater/core_ext/string.rb
68
+ - lib/templater/spec
69
+ - lib/templater/spec/helpers.rb
66
70
  - lib/templater/capture_helpers.rb
67
71
  - lib/templater/cli
68
72
  - lib/templater/cli/generator.rb
69
73
  - lib/templater/cli/manifold.rb
70
74
  - lib/templater/cli/parser.rb
71
- - lib/templater/core_ext
72
- - lib/templater/core_ext/kernel.rb
73
- - lib/templater/core_ext/string.rb
74
- - lib/templater/description.rb
75
75
  - lib/templater/discovery.rb
76
- - lib/templater/generator.rb
77
- - lib/templater/manifold.rb
78
- - lib/templater/spec
79
- - lib/templater/spec/helpers.rb
80
- - lib/templater.rb
81
- - spec/actions
82
- - spec/actions/empty_directory_spec.rb
83
- - spec/actions/file_spec.rb
84
- - spec/actions/template_spec.rb
85
- - spec/core_ext
86
- - spec/core_ext/string_spec.rb
76
+ - lib/templater/actions
77
+ - lib/templater/actions/empty_directory.rb
78
+ - lib/templater/actions/template.rb
79
+ - lib/templater/actions/action.rb
80
+ - lib/templater/actions/file.rb
81
+ - spec/spec_helper.rb
87
82
  - spec/generator
83
+ - spec/generator/invoke_spec.rb
84
+ - spec/generator/invocations_spec.rb
85
+ - spec/generator/files_spec.rb
86
+ - spec/generator/glob_spec.rb
87
+ - spec/generator/templates_spec.rb
88
+ - spec/generator/empty_directories_spec.rb
88
89
  - spec/generator/actions_spec.rb
89
- - spec/generator/arguments_spec.rb
90
90
  - spec/generator/desc_spec.rb
91
- - spec/generator/destination_root_spec.rb
92
- - spec/generator/empty_directories_spec.rb
93
- - spec/generator/files_spec.rb
94
91
  - spec/generator/generators_spec.rb
95
- - spec/generator/glob_spec.rb
96
- - spec/generator/invocations_spec.rb
97
- - spec/generator/invoke_spec.rb
92
+ - spec/generator/arguments_spec.rb
93
+ - spec/generator/source_root_spec.rb
98
94
  - spec/generator/options_spec.rb
95
+ - spec/generator/destination_root_spec.rb
99
96
  - spec/generator/render_spec.rb
100
- - spec/generator/source_root_spec.rb
101
- - spec/generator/templates_spec.rb
102
- - spec/manifold_spec.rb
103
- - spec/results
104
- - spec/results/erb.rbs
105
- - spec/results/file.rbs
106
- - spec/results/random.rbs
107
- - spec/results/simple_erb.rbs
108
- - spec/spec_helper.rb
109
- - spec/spec_helpers_spec.rb
110
- - spec/templater_spec.rb
111
97
  - spec/templates
112
- - spec/templates/erb.rbt
113
98
  - spec/templates/glob
114
- - spec/templates/glob/arg.js
99
+ - spec/templates/glob/test.rb
115
100
  - spec/templates/glob/hellothar.%feh%
116
- - spec/templates/glob/hellothar.html.%feh%
117
101
  - spec/templates/glob/README
102
+ - spec/templates/glob/arg.js
103
+ - spec/templates/glob/hellothar.html.%feh%
118
104
  - spec/templates/glob/subfolder
119
- - spec/templates/glob/subfolder/jessica_alba.jpg
120
105
  - spec/templates/glob/subfolder/monkey.rb
121
- - spec/templates/glob/test.rb
106
+ - spec/templates/glob/subfolder/jessica_alba.jpg
122
107
  - spec/templates/literals_erb.rbt
123
108
  - spec/templates/simple.rbt
124
109
  - spec/templates/simple_erb.rbt
110
+ - spec/templates/erb.rbt
111
+ - spec/core_ext
112
+ - spec/core_ext/string_spec.rb
113
+ - spec/templater_spec.rb
114
+ - spec/spec_helpers_spec.rb
115
+ - spec/manifold_spec.rb
116
+ - spec/results
117
+ - spec/results/simple_erb.rbs
118
+ - spec/results/erb.rbs
119
+ - spec/results/file.rbs
120
+ - spec/results/random.rbs
121
+ - spec/actions
122
+ - spec/actions/file_spec.rb
123
+ - spec/actions/empty_directory_spec.rb
124
+ - spec/actions/template_spec.rb
125
125
  has_rdoc: true
126
126
  homepage: http://templater.rubyforge.org/
127
127
  post_install_message: