ahora 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +5 -0
- data/AUTHORS +2 -0
- data/Gemfile +6 -0
- data/Rakefile +2 -0
- data/lib/ahora/representation.rb +9 -2
- data/lib/ahora/version.rb +1 -1
- data/test/ahora_test.rb +4 -0
- data/test/fixtures/user_posts.xml +1 -1
- metadata +16 -14
data/.travis.yml
ADDED
data/AUTHORS
ADDED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/ahora/representation.rb
CHANGED
@@ -29,7 +29,7 @@ module Ahora
|
|
29
29
|
if name.is_a? Hash
|
30
30
|
selector, name = name.first
|
31
31
|
end
|
32
|
-
element selector.to_s.camelcase(:lower) => name.to_s, :with => parser
|
32
|
+
element to_selector(selector.to_s.camelcase(:lower)) => name.to_s, :with => parser
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -63,10 +63,17 @@ module Ahora
|
|
63
63
|
def time(*names)
|
64
64
|
attribute(names, TIME_PARSER)
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
67
|
def boolean(*names)
|
68
68
|
attribute(names, BOOL_PARSER)
|
69
69
|
end
|
70
|
+
|
71
|
+
private
|
72
|
+
# Convert to XPATH selector for current node or
|
73
|
+
# one level deep.
|
74
|
+
def to_selector(name)
|
75
|
+
"./*/#{name}|./#{name}"
|
76
|
+
end
|
70
77
|
end
|
71
78
|
|
72
79
|
extend Definition
|
data/lib/ahora/version.rb
CHANGED
data/test/ahora_test.rb
CHANGED
@@ -113,6 +113,10 @@ describe "requesting a collection" do
|
|
113
113
|
subject.user_id.must_equal 1
|
114
114
|
end
|
115
115
|
|
116
|
+
it "returns nil for elements not in the resource" do
|
117
|
+
subject.parent_id.must_equal nil
|
118
|
+
end
|
119
|
+
|
116
120
|
it "must handle date conversion" do
|
117
121
|
subject.created_at.must_equal Date.parse("2011-10-26T17:01:52+02:00")
|
118
122
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ahora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nibbler
|
16
|
-
requirement: &
|
16
|
+
requirement: &70334212827160 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.3.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70334212827160
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: faraday
|
27
|
-
requirement: &
|
27
|
+
requirement: &70334212826660 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0.7'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70334212826660
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: nokogiri
|
38
|
-
requirement: &
|
38
|
+
requirement: &70334212826200 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '1.5'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70334212826200
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: activesupport
|
49
|
-
requirement: &
|
49
|
+
requirement: &70334212825820 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70334212825820
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: fakeweb
|
60
|
-
requirement: &
|
60
|
+
requirement: &70334212825360 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70334212825360
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: minitest
|
71
|
-
requirement: &
|
71
|
+
requirement: &70334212824940 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70334212824940
|
80
80
|
description: Consume Java-ish XML HTTP Resources easily
|
81
81
|
email:
|
82
82
|
- matthijs.langenberg@nedap.com
|
@@ -85,6 +85,8 @@ extensions: []
|
|
85
85
|
extra_rdoc_files: []
|
86
86
|
files:
|
87
87
|
- .gitignore
|
88
|
+
- .travis.yml
|
89
|
+
- AUTHORS
|
88
90
|
- Gemfile
|
89
91
|
- README.md
|
90
92
|
- Rakefile
|