wewoo 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/wewoo/adapter.rb +5 -5
- data/lib/wewoo/configuration.rb +4 -0
- data/lib/wewoo/graph.rb +2 -9
- data/lib/wewoo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca2c71074d0a49510b9b19d342bd038d7f66930a
|
4
|
+
data.tar.gz: bf68fcde21277ac49343c7f9d1acce8256b31dd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75144191a050a06ae769dd44d2b677e5c10a44063f2514b32b5f71b703d7ff2eb14272e892bf0021f8bfa88116b55c8d3ce9bceb097989832e62e6fbfdb06f93
|
7
|
+
data.tar.gz: e4ad78a97121801d945987587e0709183aa0a7a4d6128b28c4b7548037fe86ee7eba443e96f9eaf30d85468091d45946e890bc73a34e3c7b22ecaf47f191969a
|
data/README.md
CHANGED
@@ -162,6 +162,8 @@ g.q( "g.E.has( 'weight', T.lt, 0.5f)" ) #=> [e(1xSj-tve-2W) [113412-friend-11341
|
|
162
162
|
* 0.1.3 Spec'ed out Gremlin API
|
163
163
|
* 0.1.4 Refactor graph elements
|
164
164
|
* 0.1.5 Beef up specs + README
|
165
|
+
* 0.1.6 Clean up
|
166
|
+
* 0.1.7 Added logger
|
165
167
|
|
166
168
|
## Contributing
|
167
169
|
|
data/lib/wewoo/adapter.rb
CHANGED
@@ -29,11 +29,7 @@ module Wewoo
|
|
29
29
|
return unless Configuration.debug
|
30
30
|
|
31
31
|
msg = "[Wewoo] #{title} -- #{message}"
|
32
|
-
|
33
|
-
Rails.logger.info msg
|
34
|
-
else
|
35
|
-
puts msg
|
36
|
-
end
|
32
|
+
logger.debug msg
|
37
33
|
end
|
38
34
|
|
39
35
|
def handle_response( resp )
|
@@ -54,5 +50,9 @@ module Wewoo
|
|
54
50
|
results = body['results'] || body
|
55
51
|
results.is_a?(Hash) ? Map[results] : results
|
56
52
|
end
|
53
|
+
|
54
|
+
def logger
|
55
|
+
@logger ||= Logger.new( Configuration.log_file )
|
56
|
+
end
|
57
57
|
end
|
58
58
|
end
|
data/lib/wewoo/configuration.rb
CHANGED
data/lib/wewoo/graph.rb
CHANGED
@@ -112,6 +112,7 @@ module Wewoo
|
|
112
112
|
find_first_vertex( :gid, gid )
|
113
113
|
end
|
114
114
|
def find_vertex( id )
|
115
|
+
raise "You must provide a valid vertex id" unless id
|
115
116
|
Vertex.from_hash( self, get( u %W[vertices #{id}] ) )
|
116
117
|
rescue InvalidRequestError => ex
|
117
118
|
raise GraphElementNotFoundError, ex.message
|
@@ -162,6 +163,7 @@ module Wewoo
|
|
162
163
|
end
|
163
164
|
|
164
165
|
def find_edge( id )
|
166
|
+
raise "You must provide a valid edge id" unless id
|
165
167
|
Edge.from_hash( self, get( u %W[edges #{id}] ) )
|
166
168
|
rescue InvalidRequestError => ex
|
167
169
|
raise GraphElementNotFoundError, ex.message
|
@@ -186,15 +188,6 @@ module Wewoo
|
|
186
188
|
end
|
187
189
|
alias :E :edges
|
188
190
|
|
189
|
-
def to_s
|
190
|
-
res = get( url, headers: { 'Content-Type' =>
|
191
|
-
'application/vnd.rexster-typed-v1+json' } )
|
192
|
-
stats = res.graph.match( /.*\[vertices:(\d+) edges:(\d+)\]/ ).captures
|
193
|
-
|
194
|
-
"#{name} [Vertices:#{stats.first}, Edges:#{stats.last}]"
|
195
|
-
end
|
196
|
-
alias inspect to_s
|
197
|
-
|
198
191
|
private
|
199
192
|
|
200
193
|
def map_value( value )
|
data/lib/wewoo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wewoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- derailed
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|