graphite-notify 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 1.9.3-p327
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 1.8.7
5
+ - 2.0.0
data/Changelog.md ADDED
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## 0.0.3
4
+
5
+ * ruby 2.0 compatibility (kovyrin)
6
+
7
+ ## 0.0.2
8
+
9
+ * initial release
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Graphite Notify
2
2
 
3
3
  Send deployment events to graphite
4
+ [![Build Status](https://travis-ci.org/hellvinz/graphite-notify.png)](https://travis-ci.org/hellvinz/graphite-notify)
4
5
 
5
6
  More information about events https://code.launchpad.net/~lucio.torre/graphite/add-events/+merge/69142
6
7
 
data/Rakefile CHANGED
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env rake
2
2
  require 'bundler/gem_tasks'
3
- require 'spec/rake/spectask'
4
3
  require 'yard'
5
4
 
6
- Spec::Rake::SpecTask.new(:spec) do |spec|
7
- spec.spec_files = FileList['spec/*_spec.rb']
8
- spec.spec_opts = ['--options', 'spec/spec.opts']
9
- end
10
-
11
5
  YARD::Rake::YardocTask.new do |t|
12
6
  t.files = ['lib/**/*.rb']
13
7
  end
8
+
9
+ begin
10
+ require 'rspec/core/rake_task'
11
+ RSpec::Core::RakeTask.new(:spec)
12
+ task :default => :spec
13
+ rescue LoadError
14
+ end
@@ -22,9 +22,10 @@ Gem::Specification.new do |s|
22
22
  s.require_paths = ["lib"]
23
23
 
24
24
  s.add_dependency "capistrano"
25
- s.add_development_dependency "rspec", "~> 1.3.2"
26
- s.add_development_dependency "webmock"
27
- s.add_development_dependency "capistrano-spec"
25
+ s.add_development_dependency "rake"
26
+ s.add_development_dependency "rspec", "~> 2.14"
27
+ s.add_development_dependency "webmock", "~> 1.13"
28
+ s.add_development_dependency "capistrano-spec", "~>0.6"
28
29
  s.add_development_dependency "yard"
29
- s.add_development_dependency "redcarpet"
30
+ s.add_development_dependency "redcarpet", "~>2.3.0"
30
31
  end
@@ -1,5 +1,7 @@
1
1
  require 'net/http'
2
2
  require 'capistrano'
3
+ require 'uri'
4
+
3
5
  module Capistrano
4
6
  module Graphite
5
7
  # Called when a Capistrano::Configuration.instance exists. Will define two tasks:
@@ -17,7 +19,7 @@ module Capistrano
17
19
  namespace :graphite do
18
20
  desc 'notify graphite that a deployment occured'
19
21
  task :notify_deploy, :on_error => :continue do
20
- uri = URI(graphite_url)
22
+ uri = URI::parse(graphite_url)
21
23
  Net::HTTP.start(uri.host, uri.port) do |http|
22
24
  if respond_to?(:stage)
23
25
  http.post(uri.path, "{\"what\": \"deploy #{application} in #{stage}\", \"tags\": \"#{application},#{stage},#{real_revision},deploy\", \"data\": \"#{local_user}\"}")
@@ -29,7 +31,7 @@ module Capistrano
29
31
 
30
32
  desc 'notify graphite that a rollback occured'
31
33
  task :notify_rollback, :on_error => :continue do
32
- uri = URI(graphite_url)
34
+ uri = URI::parse(graphite_url)
33
35
  Net::HTTP.start(uri.host, uri.port) do |http|
34
36
  if respond_to?(:stage)
35
37
  http.post(uri.path, "{\"what\": \"rollback #{application} in #{stage}\", \"tags\": \"#{application},#{stage},#{real_revision},rollback\", \"data\": \"#{local_user}\"}")
@@ -1,3 +1,3 @@
1
1
  module GraphiteNotify
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -14,14 +14,13 @@ describe Capistrano::Graphite, "loaded into a configuration" do
14
14
 
15
15
  it 'should define callbacks' do
16
16
  @configuration.should callback('graphite:notify_deploy').after('deploy:restart')
17
- @configuration.should callback('graphite:notify_rollback').after('deploy:rollback')
17
+ @configuration.should callback('graphite:notify_rollback').after('rollback:restart')
18
18
  end
19
19
 
20
20
  context 'without capistrano-multistage support' do
21
21
  it 'should notify graphite of a deploy' do
22
22
  stub_request(:post, "http://localhost/").
23
- with(:body => "{\"what\": \"deploy testapp\", \"tags\": \"testapp,randomsha,deploy\", \"data\": \"testuser\"}",
24
- :headers => {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}).
23
+ with(:body => "{\"what\": \"deploy testapp\", \"tags\": \"testapp,randomsha,deploy\", \"data\": \"testuser\"}").
25
24
  to_return(:status => 200, :body => "", :headers => {})
26
25
  @configuration.find_and_execute_task('graphite:notify_deploy')
27
26
 
@@ -29,8 +28,7 @@ describe Capistrano::Graphite, "loaded into a configuration" do
29
28
 
30
29
  it 'should notify graphite of a rollback' do
31
30
  stub_request(:post, "http://localhost/").
32
- with(:body => "{\"what\": \"rollback testapp\", \"tags\": \"testapp,randomsha,rollback\", \"data\": \"testuser\"}",
33
- :headers => {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}).
31
+ with(:body => "{\"what\": \"rollback testapp\", \"tags\": \"testapp,randomsha,rollback\", \"data\": \"testuser\"}").
34
32
  to_return(:status => 200, :body => "", :headers => {})
35
33
  @configuration.find_and_execute_task('graphite:notify_rollback')
36
34
  end
@@ -42,8 +40,7 @@ describe Capistrano::Graphite, "loaded into a configuration" do
42
40
  end
43
41
  it 'should notify graphite of a deploy' do
44
42
  stub_request(:post, "http://localhost/").
45
- with(:body => "{\"what\": \"deploy testapp in test\", \"tags\": \"testapp,test,randomsha,deploy\", \"data\": \"testuser\"}",
46
- :headers => {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}).
43
+ with(:body => "{\"what\": \"deploy testapp in test\", \"tags\": \"testapp,test,randomsha,deploy\", \"data\": \"testuser\"}").
47
44
  to_return(:status => 200, :body => "", :headers => {})
48
45
  @configuration.find_and_execute_task('graphite:notify_deploy')
49
46
 
@@ -51,8 +48,7 @@ describe Capistrano::Graphite, "loaded into a configuration" do
51
48
 
52
49
  it 'should notify graphite of a rollback' do
53
50
  stub_request(:post, "http://localhost/").
54
- with(:body => "{\"what\": \"rollback testapp in test\", \"tags\": \"testapp,test,randomsha,rollback\", \"data\": \"testuser\"}",
55
- :headers => {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}).
51
+ with(:body => "{\"what\": \"rollback testapp in test\", \"tags\": \"testapp,test,randomsha,rollback\", \"data\": \"testuser\"}").
56
52
  to_return(:status => 200, :body => "", :headers => {})
57
53
  @configuration.find_and_execute_task('graphite:notify_rollback')
58
54
  end
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,11 @@
1
+ require 'rubygems'
1
2
  require 'webmock/rspec'
2
3
  require 'capistrano-spec'
3
4
 
4
- Spec::Runner.configure do |config|
5
+ RSpec.configure do |config|
5
6
  config.include Capistrano::Spec::Matchers
6
7
  config.include Capistrano::Spec::Helpers
8
+ config.mock_with :rspec
9
+ config.expect_with :rspec
10
+ config.treat_symbols_as_metadata_keys_with_true_values = true
7
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphite-notify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
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-10-01 00:00:00.000000000 Z
12
+ date: 2013-09-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
16
- requirement: &70344867339180 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,43 +21,79 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70344867339180
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
25
46
  - !ruby/object:Gem::Dependency
26
47
  name: rspec
27
- requirement: &70344867338620 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
28
49
  none: false
29
50
  requirements:
30
51
  - - ~>
31
52
  - !ruby/object:Gem::Version
32
- version: 1.3.2
53
+ version: '2.14'
33
54
  type: :development
34
55
  prerelease: false
35
- version_requirements: *70344867338620
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.14'
36
62
  - !ruby/object:Gem::Dependency
37
63
  name: webmock
38
- requirement: &70344867338160 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
39
65
  none: false
40
66
  requirements:
41
- - - ! '>='
67
+ - - ~>
42
68
  - !ruby/object:Gem::Version
43
- version: '0'
69
+ version: '1.13'
44
70
  type: :development
45
71
  prerelease: false
46
- version_requirements: *70344867338160
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '1.13'
47
78
  - !ruby/object:Gem::Dependency
48
79
  name: capistrano-spec
49
- requirement: &70344867337680 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
50
81
  none: false
51
82
  requirements:
52
- - - ! '>='
83
+ - - ~>
53
84
  - !ruby/object:Gem::Version
54
- version: '0'
85
+ version: '0.6'
55
86
  type: :development
56
87
  prerelease: false
57
- version_requirements: *70344867337680
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '0.6'
58
94
  - !ruby/object:Gem::Dependency
59
95
  name: yard
60
- requirement: &70344867337260 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
61
97
  none: false
62
98
  requirements:
63
99
  - - ! '>='
@@ -65,18 +101,28 @@ dependencies:
65
101
  version: '0'
66
102
  type: :development
67
103
  prerelease: false
68
- version_requirements: *70344867337260
69
- - !ruby/object:Gem::Dependency
70
- name: redcarpet
71
- requirement: &70344867336820 !ruby/object:Gem::Requirement
104
+ version_requirements: !ruby/object:Gem::Requirement
72
105
  none: false
73
106
  requirements:
74
107
  - - ! '>='
75
108
  - !ruby/object:Gem::Version
76
109
  version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: redcarpet
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 2.3.0
77
118
  type: :development
78
119
  prerelease: false
79
- version_requirements: *70344867336820
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 2.3.0
80
126
  description: notify graphite on deploy or rollback
81
127
  email:
82
128
  - hellvinz@gmail.com
@@ -85,6 +131,9 @@ extensions: []
85
131
  extra_rdoc_files: []
86
132
  files:
87
133
  - .gitignore
134
+ - .ruby-version
135
+ - .travis.yml
136
+ - Changelog.md
88
137
  - Gemfile
89
138
  - README.md
90
139
  - Rakefile
@@ -115,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
164
  version: 1.3.6
116
165
  requirements: []
117
166
  rubyforge_project:
118
- rubygems_version: 1.8.11
167
+ rubygems_version: 1.8.23
119
168
  signing_key:
120
169
  specification_version: 3
121
170
  summary: notify graphite on deploy or rollback