guard-knife 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +3 -0
- data/README.md +6 -3
- data/guard-knife.gemspec +2 -2
- data/lib/guard/knife.rb +8 -8
- metadata +7 -8
data/ChangeLog
CHANGED
data/README.md
CHANGED
@@ -4,14 +4,15 @@ Guard::Knife
|
|
4
4
|
Knife guard allows to update cookbooks, data bags, environments, and roles
|
5
5
|
automatically when files are modified.
|
6
6
|
|
7
|
-
It differs from Guard::Chef in that it does not depend on
|
8
|
-
it uses knife directly instead of relying on some rake tasks
|
7
|
+
It differs from [Guard::Chef][guard-chef-repo] in that it does not depend on
|
8
|
+
activesupport and it uses knife directly instead of relying on some rake tasks
|
9
|
+
being around.
|
9
10
|
|
10
11
|
Install
|
11
12
|
-------
|
12
13
|
|
13
14
|
Please be sure to have [Guard](https://github.com/guard/guard) installed before
|
14
|
-
|
15
|
+
continuing.
|
15
16
|
|
16
17
|
Install the gem:
|
17
18
|
|
@@ -64,3 +65,5 @@ Author
|
|
64
65
|
------
|
65
66
|
|
66
67
|
[Nikolay Sturm](http://blog.nistu.de/)
|
68
|
+
|
69
|
+
[guard-chef-repo]: https://github.com/dreamr/guard-chef#readme
|
data/guard-knife.gemspec
CHANGED
data/lib/guard/knife.rb
CHANGED
@@ -3,7 +3,7 @@ require 'guard/guard'
|
|
3
3
|
|
4
4
|
module Guard
|
5
5
|
class Knife < Guard
|
6
|
-
VERSION = '0.1.
|
6
|
+
VERSION = '0.1.2'
|
7
7
|
|
8
8
|
# Initialize a Guard.
|
9
9
|
# @param [Array<Guard::Watcher>] watchers the Guard file watchers
|
@@ -64,10 +64,9 @@ module Guard
|
|
64
64
|
def upload(path)
|
65
65
|
if path.match(/^cookbooks\/([^\/]*)/)
|
66
66
|
upload_cookbook($1)
|
67
|
-
elsif path.match(/^data_bags\/(.*)
|
67
|
+
elsif path.match(/^data_bags\/(.*)\/.*\.json$/)
|
68
68
|
data_bag = $1
|
69
|
-
|
70
|
-
upload_databag(data_bag, item)
|
69
|
+
upload_databag(data_bag, path)
|
71
70
|
elsif path.match(/^(environments\/.*\.rb)$/)
|
72
71
|
upload_environment($1)
|
73
72
|
elsif path.match(/^(roles\/.*.rb)$/)
|
@@ -95,11 +94,12 @@ module Guard
|
|
95
94
|
end
|
96
95
|
end
|
97
96
|
|
98
|
-
def upload_databag(data_bag,
|
99
|
-
|
100
|
-
|
97
|
+
def upload_databag(data_bag, path)
|
98
|
+
item = File.basename path, '.json'
|
99
|
+
if system("knife data bag from file #{data_bag} #{path} #{knife_options}")
|
100
|
+
::Guard::Notifier.notify("Data bag item #{data_bag}::#{item} uploaded", :title => 'Knife')
|
101
101
|
else
|
102
|
-
::Guard::Notifier.notify("Data bag #{data_bag} failed to upload", :title => 'Knife', :image => :failed)
|
102
|
+
::Guard::Notifier.notify("Data bag item #{data_bag}::#{item} failed to upload", :title => 'Knife', :image => :failed)
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-knife
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: guard
|
16
|
-
requirement: &
|
16
|
+
requirement: &16392680 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *16392680
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: chef
|
27
|
-
requirement: &
|
27
|
+
requirement: &16391780 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0.10'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *16391780
|
36
36
|
description: Guard for Chef using knife to upload files
|
37
37
|
email: github@erisiandiscord.de
|
38
38
|
executables: []
|
@@ -69,9 +69,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
version: '0'
|
70
70
|
requirements: []
|
71
71
|
rubyforge_project: ''
|
72
|
-
rubygems_version: 1.8.
|
72
|
+
rubygems_version: 1.8.10
|
73
73
|
signing_key:
|
74
74
|
specification_version: 2
|
75
75
|
summary: Guard for Chef using knife
|
76
76
|
test_files: []
|
77
|
-
has_rdoc:
|