guard-knife 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ 0.1.2
2
+ - unbreak data bag handling, from Alan Harper
3
+
1
4
  0.1.1
2
5
  - only upload each cookbook once, even if multiple files change
3
6
  - better title for notifications
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 activesupport and
8
- it uses knife directly instead of relying on some rake tasks being around.
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
- continueing.
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
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
5
5
  s.rubygems_version = '1.3.5'
6
6
 
7
7
  s.name = 'guard-knife'
8
- s.version = '0.1.1'
9
- s.date = '2012-03-18'
8
+ s.version = '0.1.2'
9
+ s.date = '2012-05-17'
10
10
  s.rubyforge_project = ''
11
11
 
12
12
  s.summary = "Guard for Chef using knife"
@@ -3,7 +3,7 @@ require 'guard/guard'
3
3
 
4
4
  module Guard
5
5
  class Knife < Guard
6
- VERSION = '0.1.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\/(.*)\/(.*).json$/)
67
+ elsif path.match(/^data_bags\/(.*)\/.*\.json$/)
68
68
  data_bag = $1
69
- item = $2
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, item)
99
- if system("knife data bag from file #{data_bag} #{item} #{knife_options}")
100
- ::Guard::Notifier.notify("Data bag #{data_bag} upload", :title => 'Knife')
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.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-03-18 00:00:00.000000000 Z
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: &14436540 !ruby/object:Gem::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: *14436540
24
+ version_requirements: *16392680
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: chef
27
- requirement: &14435980 !ruby/object:Gem::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: *14435980
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.17
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: