jamie 0.1.0.alpha5 → 0.1.0.alpha6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Rakefile +1 -0
  2. data/lib/jamie/cli.rb +33 -3
  3. data/lib/jamie/version.rb +1 -1
  4. metadata +1 -1
data/Rakefile CHANGED
@@ -7,6 +7,7 @@ Cane::RakeTask.new do |cane|
7
7
  cane.abc_exclude = %w(
8
8
  Jamie::RakeTasks#define
9
9
  Jamie::Vagrant.define_vagrant_vm
10
+ Jamie::CLI#console
10
11
  )
11
12
  cane.style_exclude = %w(
12
13
  lib/vendor/hash_recursive_merge.rb
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
- say @config.instances.as_names.join("\n")
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Jamie
4
4
 
5
- VERSION = "0.1.0.alpha5"
5
+ VERSION = "0.1.0.alpha6"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jamie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.alpha5
4
+ version: 0.1.0.alpha6
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: