nodevent 3.1.6 → 3.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/nodevent/net_publisher.rb +14 -11
- data/lib/nodevent/version.rb +1 -1
- metadata +2 -2
@@ -9,7 +9,7 @@ module NoDevent
|
|
9
9
|
format :json
|
10
10
|
default_timeout 5
|
11
11
|
|
12
|
-
HOSTNAME="
|
12
|
+
HOSTNAME="spigot.io"
|
13
13
|
|
14
14
|
attr_accessor :namespace
|
15
15
|
attr_accessor :secret
|
@@ -21,7 +21,9 @@ module NoDevent
|
|
21
21
|
self.secret = opts["secret"]
|
22
22
|
|
23
23
|
unless self.namespace
|
24
|
-
|
24
|
+
body = generate_namespace.body
|
25
|
+
p "body :#{body}"
|
26
|
+
resp = JSON.parse body
|
25
27
|
self.namespace = "/" + resp["id"]
|
26
28
|
self.secret = resp["secret"]
|
27
29
|
end
|
@@ -42,16 +44,17 @@ module NoDevent
|
|
42
44
|
end
|
43
45
|
|
44
46
|
def generate_namespace
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
p "generate_namespace"
|
48
|
+
require "socket"
|
49
|
+
hostname = Socket.gethostname
|
50
|
+
suffix = " (#{Rails.env})" if defined?(Rails)
|
51
|
+
req = {
|
52
|
+
:body => {
|
53
|
+
:api_key => api_key,
|
54
|
+
:namespace => {"name" => "#{hostname}#{suffix}"}
|
53
55
|
}
|
54
|
-
|
56
|
+
}
|
57
|
+
self.class.post("http://#{HOSTNAME}/namespaces",req)
|
55
58
|
end
|
56
59
|
end
|
57
60
|
end
|
data/lib/nodevent/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nodevent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redis
|