templater 0.3.1 → 0.3.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.
- data/lib/templater/cli/manifold.rb +12 -11
- data/lib/templater.rb +1 -1
- metadata +2 -2
@@ -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
|
-
|
19
|
-
|
20
|
-
|
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
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.
|
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-
|
12
|
+
date: 2008-10-09 00:00:00 +03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|