daikon 0.5.7 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -2,7 +2,6 @@ source "http://rubygems.org"
2
2
 
3
3
  gem "daemons", "~> 1.1.0"
4
4
  gem "json_pure", "~> 1.4.6"
5
- gem "net-http-persistent", "~> 1.4.1"
6
5
  gem "redis", "~> 2.1.1"
7
6
 
8
7
  group :development do
data/Gemfile.lock CHANGED
@@ -26,7 +26,6 @@ GEM
26
26
  json_pure (1.4.6)
27
27
  mocha (0.9.8)
28
28
  rake
29
- net-http-persistent (1.4.1)
30
29
  rake (0.8.7)
31
30
  redis (2.1.1)
32
31
  rspec (2.1.0)
@@ -52,7 +51,6 @@ DEPENDENCIES
52
51
  daemons (~> 1.1.0)
53
52
  jeweler
54
53
  json_pure (~> 1.4.6)
55
- net-http-persistent (~> 1.4.1)
56
54
  redis (~> 2.1.1)
57
55
  rspec
58
56
  timecop
data/daikon.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{daikon}
8
- s.version = "0.5.7"
8
+ s.version = "0.5.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nick Quaranto"]
@@ -66,7 +66,6 @@ Gem::Specification.new do |s|
66
66
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
67
67
  s.add_runtime_dependency(%q<daemons>, ["~> 1.1.0"])
68
68
  s.add_runtime_dependency(%q<json_pure>, ["~> 1.4.6"])
69
- s.add_runtime_dependency(%q<net-http-persistent>, ["~> 1.4.1"])
70
69
  s.add_runtime_dependency(%q<redis>, ["~> 2.1.1"])
71
70
  s.add_development_dependency(%q<bourne>, [">= 0"])
72
71
  s.add_development_dependency(%q<cucumber>, [">= 0"])
@@ -77,7 +76,6 @@ Gem::Specification.new do |s|
77
76
  else
78
77
  s.add_dependency(%q<daemons>, ["~> 1.1.0"])
79
78
  s.add_dependency(%q<json_pure>, ["~> 1.4.6"])
80
- s.add_dependency(%q<net-http-persistent>, ["~> 1.4.1"])
81
79
  s.add_dependency(%q<redis>, ["~> 2.1.1"])
82
80
  s.add_dependency(%q<bourne>, [">= 0"])
83
81
  s.add_dependency(%q<cucumber>, [">= 0"])
@@ -89,7 +87,6 @@ Gem::Specification.new do |s|
89
87
  else
90
88
  s.add_dependency(%q<daemons>, ["~> 1.1.0"])
91
89
  s.add_dependency(%q<json_pure>, ["~> 1.4.6"])
92
- s.add_dependency(%q<net-http-persistent>, ["~> 1.4.1"])
93
90
  s.add_dependency(%q<redis>, ["~> 2.1.1"])
94
91
  s.add_dependency(%q<bourne>, [">= 0"])
95
92
  s.add_dependency(%q<cucumber>, [">= 0"])
data/lib/daikon.rb CHANGED
@@ -9,7 +9,6 @@ require 'stringio'
9
9
  require 'daemons'
10
10
  require 'json'
11
11
  require 'net/https'
12
- require 'net/http/persistent'
13
12
  require 'redis'
14
13
 
15
14
  __DIR__ = File.dirname(__FILE__)
@@ -26,5 +25,5 @@ require 'daikon/monitor'
26
25
  require 'daikon/redis_hacks'
27
26
 
28
27
  module Daikon
29
- VERSION = "0.5.7"
28
+ VERSION = "0.5.8"
30
29
  end
data/lib/daikon/client.rb CHANGED
@@ -9,7 +9,6 @@ module Daikon
9
9
  Net::HTTPBadResponse,
10
10
  Net::HTTPHeaderSyntaxError,
11
11
  Net::ProtocolError,
12
- Net::HTTP::Persistent::Error,
13
12
  JSON::ParserError]
14
13
 
15
14
  attr_accessor :redis, :logger, :config, :http, :monitor
@@ -20,10 +19,13 @@ module Daikon
20
19
  self.redis = connect
21
20
  self.monitor = Monitor.new(connect, logger)
22
21
 
23
- self.http = Net::HTTP::Persistent.new
24
- self.http.verify_mode = OpenSSL::SSL::VERIFY_PEER
25
- self.http.use_ssl = true
26
- self.http.headers['Authorization'] = config.api_key
22
+ server_uri = URI.parse(config.server_prefix)
23
+ self.http = Net::HTTP.new(server_uri.host, server_uri.port)
24
+
25
+ if server_uri.scheme == "https"
26
+ self.http.verify_mode = OpenSSL::SSL::VERIFY_PEER
27
+ self.http.use_ssl = true
28
+ end
27
29
 
28
30
  log "Started Daikon v#{VERSION}"
29
31
  end
@@ -41,14 +43,15 @@ module Daikon
41
43
  end
42
44
 
43
45
  def http_request(method, url)
44
- request_uri = URI.parse("#{config.server_prefix}/#{url}")
46
+ uri = URI.parse("#{config.server_prefix}/#{url}")
45
47
  request_method = Net::HTTP.const_get method.to_s.capitalize
46
- request = request_method.new request_uri.path
48
+ request = request_method.new uri.request_uri
49
+ request.add_field 'Authorization', config.api_key
47
50
 
48
51
  yield request if block_given?
49
52
 
50
- log "#{method.to_s.upcase} #{request_uri}"
51
- http.request request_uri, request
53
+ log "#{method.to_s.upcase} #{uri.to_s}"
54
+ http.request request
52
55
  end
53
56
 
54
57
  def fetch_commands
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 7
9
- version: 0.5.7
8
+ - 8
9
+ version: 0.5.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nick Quaranto
@@ -48,37 +48,35 @@ dependencies:
48
48
  prerelease: false
49
49
  version_requirements: *id002
50
50
  - !ruby/object:Gem::Dependency
51
- name: net-http-persistent
51
+ name: redis
52
52
  requirement: &id003 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
55
  - - ~>
56
56
  - !ruby/object:Gem::Version
57
57
  segments:
58
+ - 2
58
59
  - 1
59
- - 4
60
60
  - 1
61
- version: 1.4.1
61
+ version: 2.1.1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: *id003
65
65
  - !ruby/object:Gem::Dependency
66
- name: redis
66
+ name: bourne
67
67
  requirement: &id004 !ruby/object:Gem::Requirement
68
68
  none: false
69
69
  requirements:
70
- - - ~>
70
+ - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  segments:
73
- - 2
74
- - 1
75
- - 1
76
- version: 2.1.1
77
- type: :runtime
73
+ - 0
74
+ version: "0"
75
+ type: :development
78
76
  prerelease: false
79
77
  version_requirements: *id004
80
78
  - !ruby/object:Gem::Dependency
81
- name: bourne
79
+ name: cucumber
82
80
  requirement: &id005 !ruby/object:Gem::Requirement
83
81
  none: false
84
82
  requirements:
@@ -91,7 +89,7 @@ dependencies:
91
89
  prerelease: false
92
90
  version_requirements: *id005
93
91
  - !ruby/object:Gem::Dependency
94
- name: cucumber
92
+ name: jeweler
95
93
  requirement: &id006 !ruby/object:Gem::Requirement
96
94
  none: false
97
95
  requirements:
@@ -104,7 +102,7 @@ dependencies:
104
102
  prerelease: false
105
103
  version_requirements: *id006
106
104
  - !ruby/object:Gem::Dependency
107
- name: jeweler
105
+ name: rspec
108
106
  requirement: &id007 !ruby/object:Gem::Requirement
109
107
  none: false
110
108
  requirements:
@@ -117,7 +115,7 @@ dependencies:
117
115
  prerelease: false
118
116
  version_requirements: *id007
119
117
  - !ruby/object:Gem::Dependency
120
- name: rspec
118
+ name: timecop
121
119
  requirement: &id008 !ruby/object:Gem::Requirement
122
120
  none: false
123
121
  requirements:
@@ -130,7 +128,7 @@ dependencies:
130
128
  prerelease: false
131
129
  version_requirements: *id008
132
130
  - !ruby/object:Gem::Dependency
133
- name: timecop
131
+ name: webmock
134
132
  requirement: &id009 !ruby/object:Gem::Requirement
135
133
  none: false
136
134
  requirements:
@@ -142,19 +140,6 @@ dependencies:
142
140
  type: :development
143
141
  prerelease: false
144
142
  version_requirements: *id009
145
- - !ruby/object:Gem::Dependency
146
- name: webmock
147
- requirement: &id010 !ruby/object:Gem::Requirement
148
- none: false
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- segments:
153
- - 0
154
- version: "0"
155
- type: :development
156
- prerelease: false
157
- version_requirements: *id010
158
143
  description: daikon, a radishapp.com client
159
144
  email: nick@quaran.to
160
145
  executables: