templater 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  module Templater
2
-
2
+
3
3
  module CLI
4
-
4
+
5
5
  class Manifold
6
6
 
7
7
  def initialize(destination_root, manifold, name, version)
@@ -14,15 +14,16 @@ module Templater
14
14
  end
15
15
 
16
16
  def self.run(destination_root, manifold, name, version, arguments)
17
+ if arguments.blank? || (arguments.first && ["help", "-h", "--help"].include?(arguments.first))
18
+ Manifold.new(destination_root, manifold, name, version).run(arguments)
19
+ return
20
+ end
17
21
 
18
- unless ["help", "-h", "--help"].include?(arguments.first)
19
- generator_name = arguments.shift
20
- if generator_class = manifold.generator(generator_name)
21
- Generator.new(generator_name, generator_class, destination_root, name, version).run(arguments)
22
- else
23
- Manifold.new(destination_root, manifold, name, version).run(arguments)
24
- end
22
+ generator_name = arguments.shift
23
+ if generator_class = manifold.generator(generator_name)
24
+ Generator.new(generator_name, generator_class, destination_root, name, version).run(arguments)
25
25
  else
26
+ puts "Could not find a suitable generator in the manifold. Known generators: #{manifold.generators.keys.join(', ')}\n"
26
27
  Manifold.new(destination_root, manifold, name, version).run(arguments)
27
28
  end
28
29
  end
@@ -51,7 +52,7 @@ module Templater
51
52
  end
52
53
 
53
54
  end
54
-
55
+
55
56
  end
56
-
57
+
57
58
  end
data/lib/templater.rb CHANGED
@@ -43,6 +43,6 @@ module Templater
43
43
  class MalformattedArgumentError < ArgumentError #:nodoc:
44
44
  end
45
45
 
46
- VERSION = '0.3.1'
46
+ VERSION = '0.3.2'
47
47
 
48
48
  end
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.3.1
4
+ version: 0.3.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-10-08 00:00:00 +03:00
12
+ date: 2008-10-09 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency