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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/cheflow/cli.rb +15 -4
- data/lib/cheflow/cookbook.rb +21 -5
- data/lib/cheflow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2898d4933067abfd83277a8f5ba628af3e6c1671
|
4
|
+
data.tar.gz: 1570eefa27ab411e2929a9350f6dae56de9267a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
77
|
-
say
|
78
|
-
|
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'
|
data/lib/cheflow/cookbook.rb
CHANGED
@@ -29,21 +29,37 @@ module Cheflow
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def type
|
32
|
-
if name.start_with? 'node_'
|
33
|
-
|
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
|
-
@
|
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
|
-
@
|
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
|
data/lib/cheflow/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semverse
|