guard-knife 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog ADDED
@@ -0,0 +1,5 @@
1
+ 0.1.0
2
+ - introduce notifications, from Alan Harper
3
+
4
+ 0.0.1
5
+ - initial version
data/README.md CHANGED
@@ -4,6 +4,9 @@ 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.
9
+
7
10
  Install
8
11
  -------
9
12
 
data/Rakefile CHANGED
@@ -64,7 +64,7 @@ task :coverage do
64
64
  sh "open coverage/index.html"
65
65
  end
66
66
 
67
- require 'rake/rdoctask'
67
+ require 'rdoc/task'
68
68
  Rake::RDocTask.new do |rdoc|
69
69
  rdoc.rdoc_dir = 'rdoc'
70
70
  rdoc.title = "#{name} #{version}"
data/guard-knife.gemspec CHANGED
@@ -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.0.1'
9
- s.date = '2012-03-09'
8
+ s.version = '0.1.0'
9
+ s.date = '2012-03-16'
10
10
  s.rubyforge_project = ''
11
11
 
12
12
  s.summary = "Guard for Chef using knife"
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
28
28
 
29
29
  # = MANIFEST =
30
30
  s.files = %w[
31
+ ChangeLog
31
32
  LICENSE
32
33
  README.md
33
34
  Rakefile
data/lib/guard/knife.rb CHANGED
@@ -3,16 +3,14 @@ require 'guard/guard'
3
3
 
4
4
  module Guard
5
5
  class Knife < Guard
6
- VERSION = '0.0.1'
6
+ VERSION = '0.1.0'
7
7
 
8
8
  # Initialize a Guard.
9
9
  # @param [Array<Guard::Watcher>] watchers the Guard file watchers
10
10
  # @param [Hash] options the custom Guard options
11
11
  def initialize(watchers = [], options = {})
12
12
  super
13
- @options = {
14
- :config => '~/.chef/knife.rb'
15
- }.update(options)
13
+ @options = {}.update(options)
16
14
  end
17
15
 
18
16
  # Call once when Guard starts. Please override initialize method to init stuff.
@@ -81,19 +79,35 @@ module Guard
81
79
  end
82
80
 
83
81
  def upload_cookbook(cookbook)
84
- system("knife cookbook upload #{cookbook} #{knife_options}")
82
+ if system("knife cookbook upload #{cookbook} #{knife_options}")
83
+ ::Guard::Notifier.notify("Cookbook #{cookbook} uploaded")
84
+ else
85
+ ::Guard::Notifier.notify("Cookbook #{cookbook} failed to upload", :image => :failed)
86
+ end
85
87
  end
86
88
 
87
89
  def upload_databag(data_bag, item)
88
- system("knife data bag from file #{data_bag} #{item} #{knife_options}")
90
+ if system("knife data bag from file #{data_bag} #{item} #{knife_options}")
91
+ ::Guard::Notifier.notify("Data bag #{data_bag} upload")
92
+ else
93
+ ::Guard::Notifier.notify("Data bag #{data_bag} failed to upload", :image => :failed)
94
+ end
89
95
  end
90
96
 
91
97
  def upload_environment(environment)
92
- system("knife environment from file #{environment} #{knife_options}")
98
+ if system("knife environment from file #{environment} #{knife_options}")
99
+ ::Guard::Notifier.notify("Environment #{environment} uploaded")
100
+ else
101
+ ::Guard::Notifier.notify("Environment #{environment} failed to upload", :image => :failed)
102
+ end
93
103
  end
94
104
 
95
105
  def upload_role(role)
96
- system("knife role from file #{role} #{knife_options}")
106
+ if system("knife role from file #{role} #{knife_options}")
107
+ ::Guard::Notifier.notify("Role #{role} uploaded")
108
+ else
109
+ ::Guard::Notifier.notify("Role #{role} upload failed", :image => :failed)
110
+ end
97
111
  end
98
112
  end
99
113
  end
metadata CHANGED
@@ -1,61 +1,47 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: guard-knife
3
- version: !ruby/object:Gem::Version
4
- hash: 29
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 1
10
- version: 0.0.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Nikolay Sturm
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-03-09 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-03-16 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: guard
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &8503000 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
32
22
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: chef
36
23
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *8503000
25
+ - !ruby/object:Gem::Dependency
26
+ name: chef
27
+ requirement: &8502140 !ruby/object:Gem::Requirement
38
28
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 31
43
- segments:
44
- - 0
45
- - 10
46
- version: "0.10"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0.10'
47
33
  type: :runtime
48
- version_requirements: *id002
34
+ prerelease: false
35
+ version_requirements: *8502140
49
36
  description: Guard for Chef using knife to upload files
50
37
  email: github@erisiandiscord.de
51
38
  executables: []
52
-
53
39
  extensions: []
54
-
55
- extra_rdoc_files:
40
+ extra_rdoc_files:
56
41
  - README.md
57
42
  - LICENSE
58
- files:
43
+ files:
44
+ - ChangeLog
59
45
  - LICENSE
60
46
  - README.md
61
47
  - Rakefile
@@ -64,36 +50,27 @@ files:
64
50
  - lib/guard/knife/templates/Guardfile
65
51
  homepage: https://github.com/nistude/guard-knife
66
52
  licenses: []
67
-
68
53
  post_install_message:
69
- rdoc_options:
54
+ rdoc_options:
70
55
  - --charset=UTF-8
71
- require_paths:
56
+ require_paths:
72
57
  - lib
73
- required_ruby_version: !ruby/object:Gem::Requirement
58
+ required_ruby_version: !ruby/object:Gem::Requirement
74
59
  none: false
75
- requirements:
76
- - - ">="
77
- - !ruby/object:Gem::Version
78
- hash: 3
79
- segments:
80
- - 0
81
- version: "0"
82
- required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
65
  none: false
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- hash: 3
88
- segments:
89
- - 0
90
- version: "0"
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
91
70
  requirements: []
92
-
93
- rubyforge_project: ""
94
- rubygems_version: 1.8.17
71
+ rubyforge_project: ''
72
+ rubygems_version: 1.8.10
95
73
  signing_key:
96
74
  specification_version: 2
97
75
  summary: Guard for Chef using knife
98
76
  test_files: []
99
-