apphunkd 0.9.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.2
1
+ 0.10.0
data/apphunkd.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{apphunkd}
8
- s.version = "0.9.2"
8
+ s.version = "0.10.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andreas Wolff"]
12
- s.date = %q{2009-11-17}
12
+ s.date = %q{2009-11-20}
13
13
  s.default_executable = %q{apphunkd}
14
14
  s.description = %q{
15
15
  Apphunkd is a ruby based daemon that runs on your application-servers and acts as local proxy between your apps and apphunk.com.
@@ -19,7 +19,8 @@ Gem::Specification.new do |s|
19
19
  s.executables = ["apphunkd"]
20
20
  s.extra_rdoc_files = [
21
21
  "LICENSE",
22
- "README.rdoc"
22
+ "README.rdoc",
23
+ "TODO"
23
24
  ]
24
25
  s.files = [
25
26
  ".document",
@@ -10,6 +10,7 @@ module Apphunkd
10
10
  status 201
11
11
  else
12
12
  status 400
13
+ "Body or Token missing."
13
14
  end
14
15
  end
15
16
 
@@ -15,7 +15,8 @@ module Apphunkd
15
15
  end
16
16
 
17
17
  def store(message = {})
18
- return false if message[:body].blank? || message[:token].blank?
18
+ debug "Receive: #{message.inspect}"
19
+ return false if message[:message].blank? || message[:token].blank?
19
20
  message[:stored_at] = Time.now
20
21
 
21
22
  @mutex.synchronize do
@@ -38,7 +39,7 @@ module Apphunkd
38
39
  if result.status == :ok
39
40
  case result.response.code
40
41
  when '201'
41
- # Everything fine
42
+ debug "Message successfully stored."
42
43
  when '400', '403'
43
44
  log_error "Remote Service refused to store item: #{result.response.code} / #{result.response.body}. Dropped."
44
45
  else
@@ -89,6 +90,12 @@ module Apphunkd
89
90
  end
90
91
  end
91
92
 
93
+ def debug(message)
94
+ if DaemonKit.env.to_s == 'development' || ENV['DEBUG']
95
+ DaemonKit.logger.debug message
96
+ end
97
+ end
98
+
92
99
  def log_error(message)
93
100
  DaemonKit.logger.info message
94
101
  end
@@ -17,7 +17,7 @@ module Apphunkd
17
17
  result.status = :ok
18
18
  return result
19
19
  end
20
- rescue SocketError
20
+ rescue SocketError, Errno::ECONNREFUSED
21
21
  Remote::Result.new(:status => :connection_error)
22
22
  rescue Timeout::Error
23
23
  Remote::Result.new(:status => :timeout)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apphunkd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Wolff
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-17 00:00:00 +01:00
12
+ date: 2009-11-20 00:00:00 +01:00
13
13
  default_executable: apphunkd
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -41,6 +41,7 @@ extensions: []
41
41
  extra_rdoc_files:
42
42
  - LICENSE
43
43
  - README.rdoc
44
+ - TODO
44
45
  files:
45
46
  - .document
46
47
  - .gitignore