anmo 0.0.20 → 0.0.21
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/lib/anmo.rb +14 -7
- data/lib/anmo/version.rb +1 -1
- metadata +1 -1
data/lib/anmo.rb
CHANGED
@@ -14,7 +14,7 @@ module Anmo
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.server_version
|
17
|
-
HTTParty.get("
|
17
|
+
HTTParty.get(anmo_url("__VERSION__")).body
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.launch_server port = 8787
|
@@ -23,28 +23,35 @@ module Anmo
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.create_request options
|
26
|
-
HTTParty.post("
|
26
|
+
HTTParty.post(anmo_url("__CREATE_OBJECT__"), {:body => options.to_json, :headers => {"Content-Type" => "application/json"}})
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.delete_all
|
30
|
-
HTTParty.post("
|
30
|
+
HTTParty.post(anmo_url("__DELETE_ALL_OBJECTS__"))
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.requests
|
34
|
-
json = HTTParty.get("
|
34
|
+
json = HTTParty.get(anmo_url("__REQUESTS__"))
|
35
35
|
JSON.parse(json.body)
|
36
36
|
end
|
37
37
|
|
38
38
|
def self.delete_all_requests
|
39
|
-
HTTParty.post("
|
39
|
+
HTTParty.post(anmo_url("__DELETE_ALL_REQUESTS__"))
|
40
40
|
end
|
41
41
|
|
42
42
|
def self.stored_objects
|
43
|
-
json = HTTParty.get("
|
43
|
+
json = HTTParty.get(anmo_url("__OBJECTS__"))
|
44
44
|
JSON.parse(json.body)
|
45
45
|
end
|
46
46
|
|
47
47
|
def self.running?
|
48
|
-
HTTParty.get("
|
48
|
+
HTTParty.get(anmo_url("__ALIVE__")).code == 200 rescue false
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def self.anmo_url path
|
54
|
+
"#{server}/#{path}"
|
55
|
+
# URI.join(server, path).to_s
|
49
56
|
end
|
50
57
|
end
|
data/lib/anmo/version.rb
CHANGED