gom-script 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/gom/remote/connection.rb +14 -0
- data/lib/gom/remote/daemon.rb +6 -0
- data/lib/gom/remote/entry.rb +23 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
@@ -66,6 +66,20 @@ module Gom
|
|
66
66
|
raise "not yet implemented"
|
67
67
|
end
|
68
68
|
|
69
|
+
def destroy path
|
70
|
+
url = "#{@target_url}#{path}"
|
71
|
+
uri = URI.parse url
|
72
|
+
req = Net::HTTP::Delete.new uri.path
|
73
|
+
|
74
|
+
session = (Net::HTTP.new uri.host, uri.port)
|
75
|
+
case res = session.start { |http| http.request req }
|
76
|
+
when Net::HTTPSuccess, Net::HTTPRedirection
|
77
|
+
# OK
|
78
|
+
else
|
79
|
+
res.error!
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
69
83
|
def read path
|
70
84
|
url = "#{@target_url}#{path}"
|
71
85
|
open(url).read
|
data/lib/gom/remote/daemon.rb
CHANGED
data/lib/gom/remote/entry.rb
CHANGED
@@ -10,6 +10,29 @@ module Gom
|
|
10
10
|
Gom::Remote.connection
|
11
11
|
end
|
12
12
|
|
13
|
+
=begin
|
14
|
+
def initialize
|
15
|
+
@path = nil
|
16
|
+
@attributes = {}
|
17
|
+
@children = {}
|
18
|
+
end
|
19
|
+
|
20
|
+
def new_record?
|
21
|
+
@path.nil?
|
22
|
+
end
|
23
|
+
|
24
|
+
def create path
|
25
|
+
@path.nil || raise ""
|
26
|
+
end
|
27
|
+
|
28
|
+
def save
|
29
|
+
end
|
30
|
+
|
31
|
+
def attributes
|
32
|
+
@attributes
|
33
|
+
end
|
34
|
+
=end
|
35
|
+
|
13
36
|
def gnode path
|
14
37
|
json = (connection.read "#{path}.json")
|
15
38
|
(JSON.parse json)["node"]["entries"].select do |entry|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gom-script
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- art+com/dirk luesebrink
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-08 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|