deputy 0.1.50 → 0.1.51

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/Rakefile +0 -1
  2. data/Readme.md +10 -10
  3. data/VERSION +1 -1
  4. data/deputy.gemspec +3 -6
  5. data/spec/deputy_spec.rb +9 -1
  6. metadata +7 -20
data/Rakefile CHANGED
@@ -13,7 +13,6 @@ begin
13
13
  gem.email = "mirko@dawanda.com"
14
14
  gem.homepage = "http://github.com/dawanda/#{project_name}"
15
15
  gem.authors = ["Michael Grosser"]
16
- gem.add_dependency 'SystemTimer'
17
16
  end
18
17
 
19
18
  Jeweler::GemcutterTasks.new
data/Readme.md CHANGED
@@ -1,26 +1,26 @@
1
- Work in progress do not use.
1
+ Report values to [Sheriff](https://github.com/dawanda/sheriff) or run plugins from sheriff.
2
2
 
3
- Install
4
- #######
5
- Use with [sheriff](http://github.com/dawanda/sheriff).
3
+ # Install
6
4
 
7
5
  sudo gem install deputy
8
6
 
9
- Put sheriff url into `~/.deputy.yml`
7
+ Put into `~/.deputy.yml` or `/etc/deputy.yml`
10
8
  sheriff_url: http://sheriff.mydomain.com
11
- # Optional
9
+ # overwrite defaults if needed
12
10
  max_random_start_delay: 30
13
11
  timeout: 10
14
12
 
15
- Add deputy to cron with deputy --install-cron (logs to /tmp/deputy.log)
13
+ Basic auth login can be added to the url:
14
+ sheriff_url: http://username:password@sheriff.mydomain.com
16
15
 
17
- Usage
18
- #####
16
+ Add deputy to cron with `deputy --install-cron` (logs to /tmp/deputy.log)
17
+
18
+ # Usage
19
19
 
20
20
  ### Report something
21
21
  deputy Cronjob.ran
22
22
  deputy Cronjob.users_found 123
23
- Cron: xxx 2>&1 ; deputy Cron.success $?
23
+ dump_database.sh 2>&1 ; deputy Cron.database_dumped $?
24
24
 
25
25
  ### Run plugins by hand for debugging
26
26
  deputy --run-plugins --no-wait
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.50
1
+ 0.1.51
data/deputy.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{deputy}
8
- s.version = "0.1.50"
8
+ s.version = "0.1.51"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Grosser"]
12
- s.date = %q{2011-04-12}
12
+ s.date = %q{2011-05-05}
13
13
  s.default_executable = %q{deputy}
14
14
  s.email = %q{mirko@dawanda.com}
15
15
  s.executables = ["deputy"]
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
  ]
28
28
  s.homepage = %q{http://github.com/dawanda/deputy}
29
29
  s.require_paths = ["lib"]
30
- s.rubygems_version = %q{1.4.2}
30
+ s.rubygems_version = %q{1.6.2}
31
31
  s.summary = %q{Report to the sheriff}
32
32
  s.test_files = [
33
33
  "spec/deputy_spec.rb",
@@ -38,12 +38,9 @@ Gem::Specification.new do |s|
38
38
  s.specification_version = 3
39
39
 
40
40
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
41
- s.add_runtime_dependency(%q<SystemTimer>, [">= 0"])
42
41
  else
43
- s.add_dependency(%q<SystemTimer>, [">= 0"])
44
42
  end
45
43
  else
46
- s.add_dependency(%q<SystemTimer>, [">= 0"])
47
44
  end
48
45
  end
49
46
 
data/spec/deputy_spec.rb CHANGED
@@ -45,7 +45,7 @@ describe Deputy do
45
45
  <<-CODE
46
46
  module TEMP_#{options[:rand]||rand(11111)}
47
47
  def self.interval
48
- 60
48
+ #{options[:interval] || 60}
49
49
  end
50
50
 
51
51
  class #{name} < Scout::Plugin
@@ -171,6 +171,14 @@ describe Deputy do
171
171
  $notify.should == 1
172
172
  end
173
173
 
174
+ it "does not execute not-running plugins" do
175
+ $notify = 0
176
+ FakeWeb.register_uri(:get, "http://sheri.ff/plugins.rb?hostname=my_host", :body => klass('C', :code => '$notify=1', :interval => 9999999))
177
+ FakeWeb.register_uri(:get, "http://sheri.ff/notify?group=Deputies.finished&value=OK&hostname=my_host", :body => 'OK')
178
+ Deputy.run_plugins
179
+ $notify.should == 0
180
+ end
181
+
174
182
  it "sleeps a random interval if given in config" do
175
183
  Socket.stub!(:gethostname).and_return 'foo'
176
184
  Deputy.stub!(:config).and_return('max_random_start_delay' => 30)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deputy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 127
4
+ hash: 125
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 50
10
- version: 0.1.50
9
+ - 51
10
+ version: 0.1.51
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Grosser
@@ -15,23 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-12 00:00:00 +02:00
18
+ date: 2011-05-05 00:00:00 +02:00
19
19
  default_executable: deputy
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
23
- none: false
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- hash: 3
28
- segments:
29
- - 0
30
- version: "0"
31
- type: :runtime
32
- requirement: *id001
33
- name: SystemTimer
34
- prerelease: false
20
+ dependencies: []
21
+
35
22
  description:
36
23
  email: mirko@dawanda.com
37
24
  executables:
@@ -81,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
68
  requirements: []
82
69
 
83
70
  rubyforge_project:
84
- rubygems_version: 1.4.2
71
+ rubygems_version: 1.6.2
85
72
  signing_key:
86
73
  specification_version: 3
87
74
  summary: Report to the sheriff