apphunkd 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/apphunkd.gemspec +4 -3
- data/lib/apphunkd/api/service.rb +1 -0
- data/lib/apphunkd/queue.rb +9 -2
- data/lib/apphunkd/remote.rb +1 -1
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
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.
|
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-
|
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",
|
data/lib/apphunkd/api/service.rb
CHANGED
data/lib/apphunkd/queue.rb
CHANGED
@@ -15,7 +15,8 @@ module Apphunkd
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def store(message = {})
|
18
|
-
|
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
|
-
|
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
|
data/lib/apphunkd/remote.rb
CHANGED
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.
|
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-
|
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
|