cheflow 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a11e5915ae780964544b0fbea4abdac4088a15ee
4
- data.tar.gz: 3ee9868dfb96e14a50a9024721add2ceba8c2b8b
3
+ metadata.gz: 2898d4933067abfd83277a8f5ba628af3e6c1671
4
+ data.tar.gz: 1570eefa27ab411e2929a9350f6dae56de9267a8
5
5
  SHA512:
6
- metadata.gz: 7a7fbce1ce9d1a5299de67a0740f906f52dc5c4b9289caa655eb09f12ce4e8aeba711748da4e0b47b8e673f94eeb2a1ff006da517eade8c2fea9199fff39abc2
7
- data.tar.gz: d61c7f99b64a62b7d7cd4102b8bef458b16c1b6b24cebaaac77afcbcdec37b568873038c09121b4bb0787ca3deebc2be29f735b836671f6d42352c667a48a647
6
+ metadata.gz: 0fa772f45a569263c28e71d3cbddc88861c6d294f088449700e8216272d1bc6e2e17fea926488a06c9aeb5fe1ede7d7bb09a57684be4bc3eb6d75ef192815a0f
7
+ data.tar.gz: 986cce94c7a062bbc643a61573a7509c9042be705ec54d64499070a0adc6c6e0784125f7da1b1be395cab2c207ce00dc501e1486109762dbfd2fee4769c83466
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.2.0
2
+
3
+ - [Improvement] Only showing the 15 most recent version in the info command.
4
+ - [Improvement] Showing environments that non-node cookbooks are included within.
5
+ - [Fix] using correct environment.
6
+
1
7
  ## 0.1.0
2
8
 
3
9
  Initial release supporting only the `info` command.
data/lib/cheflow/cli.rb CHANGED
@@ -68,14 +68,25 @@ module Cheflow
68
68
 
69
69
  desc 'info', 'Display information about the cookbook'
70
70
  def info
71
- say "#{cookbook.type} Cookbook: #{cookbook}"
71
+ say "#{cookbook.type.capitalize} Cookbook: #{cookbook}"
72
72
  say cookbook.path
73
73
  say
74
74
  say "Environments: #{cookbook.node_environments.join("\n ")}"
75
75
  say
76
- say 'Versions:'
77
- say " Production: " + cookbook.prod_versions.join(', ')
78
- say " Development: " + cookbook.dev_versions.join(', ')
76
+
77
+ say 'Versions: (most recent)'
78
+
79
+ if (pv = cookbook.prod_versions).count > 15
80
+ say " Production: #{pv[0,15].join(', ')} (...)"
81
+ else
82
+ say " Production: #{pv.join(', ')}"
83
+ end
84
+
85
+ if (dv = cookbook.dev_versions).count > 15
86
+ say " Development: #{dv[0,15].join(', ')} (...)"
87
+ else
88
+ say " Development: #{dv.join(', ')}"
89
+ end
79
90
  end
80
91
 
81
92
  desc 'default', 'Show version, info and help'
@@ -29,21 +29,37 @@ module Cheflow
29
29
  end
30
30
 
31
31
  def type
32
- if name.start_with? 'node_'
33
- 'Node'
32
+ @type ||= if name.start_with? 'node_'
33
+ :node
34
+ else
35
+ :application
34
36
  end
35
37
  end
36
38
 
39
+ def node_cookbook?
40
+ type == :node
41
+ end
42
+
43
+ def application_cookbook?
44
+ type == :application
45
+ end
46
+
37
47
  def node_environment_objects
38
- @node_environments ||= ridley.search(:environment, "name:node_mongodb*")
48
+ @node_environment_objects ||= begin
49
+ if node_cookbook?
50
+ ridley.search(:environment, "name:#{name}*")
51
+ else
52
+ ridley.search(:environment, "cookbook_versions:#{name}")
53
+ end
54
+ end
39
55
  end
40
56
 
41
57
  def node_environments
42
- @node_environment_names ||= node_environment_objects.map do |e|
58
+ @node_environments ||= node_environment_objects.map do |e|
43
59
  env = e.name.gsub /^#{name}_/, ''
44
60
  env = env == name ? 'production' : env
45
61
  "#{env.ljust(12)} (#{e.cookbook_versions[name]})"
46
- end
62
+ end.sort
47
63
  end
48
64
 
49
65
  def versions
@@ -1,3 +1,3 @@
1
1
  module Cheflow
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Moss
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-03 00:00:00.000000000 Z
11
+ date: 2015-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semverse