whisk 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -36,17 +36,31 @@ Whiskfile.
36
36
 
37
37
  ingredient "ntp" do
38
38
  source github % "ntp"
39
- ref 'develop'
39
+ ref 'develop'
40
40
  end
41
41
 
42
42
  ingredient "ssh" do
43
43
  source github % "ssh"
44
- ref 'develop'
44
+ ref 'develop'
45
45
  end
46
46
  end
47
47
 
48
48
  # Commands #
49
49
 
50
+ ## whisk list ##
51
+
52
+ The list subcommand will list the short name of all of the configured
53
+ ingredients. This short name consists of the bowl and ingredient names
54
+ separated by a forward slash. These short names maybe be used as filters for
55
+ most other subcommands
56
+
57
+ $ whisk list
58
+ production/ntp
59
+ production/ssh
60
+ development/ntp
61
+ development/ssh
62
+
63
+
50
64
  ## whisk prepare ##
51
65
 
52
66
  The prepare subcommand allows you to clone your ingredients and optional
data/lib/whisk/cli.rb CHANGED
@@ -46,6 +46,18 @@ class Whisk
46
46
  runner.run('diff')
47
47
  end
48
48
 
49
+ method_option :whiskfile,
50
+ type: :string,
51
+ default: File.join(Dir.pwd, Whisk::DEFAULT_FILENAME),
52
+ desc: "Path to a Whiskfile to operate off of.",
53
+ aliases: "-w",
54
+ banner: "PATH"
55
+ desc "list", "list the configured bowls and ingredients"
56
+ def list(filter=nil)
57
+ runner = Whisk::Runner.new(options[:whiskfile], filter)
58
+ runner.run('list')
59
+ end
60
+
49
61
  method_option :whiskfile,
50
62
  type: :string,
51
63
  default: File.join(Dir.pwd, Whisk::DEFAULT_FILENAME),
@@ -47,6 +47,14 @@ class Whisk
47
47
  end
48
48
  end
49
49
 
50
+ def action_list
51
+ if self.exist?
52
+ resource.ingredients.each do |name, ingredient|
53
+ Whisk.ui.info("#{resource.name}/#{ingredient.name}")
54
+ end
55
+ end
56
+ end
57
+
50
58
  def action_prepare
51
59
  self.create unless self.exist?
52
60
  ::Dir.chdir resource.path
@@ -35,7 +35,7 @@ class Whisk
35
35
 
36
36
  def ingredient(iname, &block)
37
37
  if ingredients.has_key? iname
38
- raise ArgumentError "Ingredient '#{iname}' has already added to bowl '#{name}'"
38
+ raise ArgumentError, "Ingredient '#{iname}' has already added to bowl '#{name}'"
39
39
  else
40
40
  ingredients[iname] = Whisk::Resource::Ingredient.new(iname, &block)
41
41
  end
@@ -38,7 +38,7 @@ class Whisk
38
38
 
39
39
  def provider(arg=nil)
40
40
  klass = if arg.kind_of?(String) || arg.kind_of?(Symbol)
41
- raise ArgumentError "must provider provider by klass"
41
+ raise ArgumentError, "must provide provider by klass"
42
42
  # lookup_provider_constant(arg)
43
43
  else
44
44
  arg
data/lib/whisk/version.rb CHANGED
@@ -17,5 +17,5 @@
17
17
  #
18
18
 
19
19
  class Whisk
20
- VERSION = '0.2.0'
20
+ VERSION = '0.2.1'
21
21
  end
@@ -31,7 +31,7 @@ class Whisk
31
31
  class << self
32
32
  def add_bowl(bowl)
33
33
  if @@bowls.has_key? name
34
- raise ArgumentError "bowl #{name} already exists"
34
+ raise ArgumentError, "bowl #{name} already exists"
35
35
  else
36
36
  @@bowls[bowl.name] = bowl
37
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whisk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-25 00:00:00.000000000 Z
12
+ date: 2012-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef