knife-partial-search 0.0.2 → 0.0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cf858b2fc20d3548c3d7bf6687da1ab868b1f24
|
4
|
+
data.tar.gz: 03c5f714491f61d98593b98f5eea3336b59de1e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5ce2dcf62086f671de8574e94daf8b6625a822ee3ae41c64a0145cf20577bae1764484c49937c34ef453ea647ba8542bae76f8cbfc8d62c22f2e7e53616df92
|
7
|
+
data.tar.gz: 18ddc461262f750a64fa91d3354287236718272093bd0d7442f8a293c31c71c30b399ca6d93486238ee36f928d79bef73fb36d755e3177ece7e0f91e7e12a964
|
@@ -1,27 +1,25 @@
|
|
1
|
-
|
2
|
-
class
|
3
|
-
class
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
end
|
1
|
+
module Knife
|
2
|
+
class PartialSearch
|
3
|
+
class FakeNode < Hash
|
4
|
+
def name
|
5
|
+
self['name']
|
6
|
+
end
|
7
|
+
def chef_environment
|
8
|
+
self['chef_environment']
|
9
|
+
end
|
10
|
+
def run_list
|
11
|
+
self['run_list'].join(', ')
|
12
|
+
end
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
def [](key)
|
15
|
+
super(key.to_s)
|
16
|
+
end
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
18
|
+
def kind_of?(klass)
|
19
|
+
if klass.to_s == 'Chef::Node'
|
20
|
+
true
|
21
|
+
else
|
22
|
+
super
|
25
23
|
end
|
26
24
|
end
|
27
25
|
end
|
@@ -17,7 +17,7 @@ class Chef
|
|
17
17
|
args[:rows] = rows
|
18
18
|
if block_given?
|
19
19
|
q.search(type, query, args) do |node_hash|
|
20
|
-
n =
|
20
|
+
n = ::Knife::PartialSearch::FakeNode.new do |h,k|
|
21
21
|
h[k] = node_hash[k]
|
22
22
|
end
|
23
23
|
@@keys.each do |k,v| n[k] end
|
@@ -43,7 +43,7 @@ class Chef
|
|
43
43
|
alias_method :old_extract, :extract_nested_value unless method_defined? :old_extract
|
44
44
|
|
45
45
|
def extract_nested_value(data, nested_value_spec)
|
46
|
-
if data.kind_of?(
|
46
|
+
if data.kind_of?(::Knife::PartialSearch::FakeNode)
|
47
47
|
data[nested_value_spec]
|
48
48
|
else
|
49
49
|
old_extract(data, nested_value_spec)
|
data/lib/chef/knife/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-partial-search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregoire Seux
|
@@ -111,4 +111,3 @@ signing_key:
|
|
111
111
|
specification_version: 4
|
112
112
|
summary: Improve usual knife commands thanks to partial-search
|
113
113
|
test_files: []
|
114
|
-
has_rdoc:
|