jamie 0.1.0.alpha5 → 0.1.0.alpha6
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/Rakefile +1 -0
- data/lib/jamie/cli.rb +33 -3
- data/lib/jamie/version.rb +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
data/lib/jamie/cli.rb
CHANGED
@@ -15,9 +15,10 @@ module Jamie
|
|
15
15
|
@config = Jamie::Config.new(ENV['JAMIE_YAML'])
|
16
16
|
end
|
17
17
|
|
18
|
-
desc "list", "List all instances"
|
19
|
-
def list
|
20
|
-
|
18
|
+
desc "list (all ['REGEX']|[INSTANCE])", "List all instances"
|
19
|
+
def list(*args)
|
20
|
+
result = parse_subcommand(args[0], args[1])
|
21
|
+
say Array(result).map{ |i| i.name }.join("\n")
|
21
22
|
end
|
22
23
|
|
23
24
|
[:create, :converge, :setup, :verify, :test, :destroy].each do |action|
|
@@ -28,6 +29,35 @@ module Jamie
|
|
28
29
|
define_method(action) { |*args| exec_action(action) }
|
29
30
|
end
|
30
31
|
|
32
|
+
desc "version", "Print Jamie's version information"
|
33
|
+
def version
|
34
|
+
say "Jamie version #{Jamie::VERSION}"
|
35
|
+
end
|
36
|
+
map %w(-v --version) => :version
|
37
|
+
|
38
|
+
desc "console", "Jamie Console!"
|
39
|
+
def console
|
40
|
+
require 'pry'
|
41
|
+
Pry.start(@config, :prompt => [
|
42
|
+
proc { |target_self, nest_level, pry|
|
43
|
+
[ "[#{pry.input_array.size}] ",
|
44
|
+
"jc(#{Pry.view_clip(target_self.class)})",
|
45
|
+
"#{":#{nest_level}" unless nest_level.zero?}> "
|
46
|
+
].join
|
47
|
+
},
|
48
|
+
proc { |target_self, nest_level, pry|
|
49
|
+
[ "[#{pry.input_array.size}] ",
|
50
|
+
"jc(#{Pry.view_clip(target_self.class)})",
|
51
|
+
"#{":#{nest_level}" unless nest_level.zero?}* "
|
52
|
+
].join
|
53
|
+
}
|
54
|
+
])
|
55
|
+
rescue LoadError => e
|
56
|
+
warn %{Make sure you have the pry gem installed. You can install it with:}
|
57
|
+
warn %{`gem install pry` or including 'gem "pry"' in your Gemfile.}
|
58
|
+
exit 1
|
59
|
+
end
|
60
|
+
|
31
61
|
private
|
32
62
|
|
33
63
|
attr_reader :task
|
data/lib/jamie/version.rb
CHANGED