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 ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - jruby-19mode # JRuby in 1.9 mode
5
+ - rbx-19mode
data/AUTHORS ADDED
@@ -0,0 +1,2 @@
1
+ Norbert Crombach
2
+ Matthijs Langenberg
data/Gemfile CHANGED
@@ -1,3 +1,9 @@
1
1
  source "http://rubygems.org"
2
2
 
3
+ gem 'rake'
4
+
5
+ platforms :jruby do
6
+ gem 'jruby-openssl'
7
+ end
8
+
3
9
  gemspec
data/Rakefile CHANGED
@@ -5,3 +5,5 @@ Bundler::GemHelper.install_tasks
5
5
  Rake::TestTask.new do |t|
6
6
  t.pattern = 'test/**/*_test.rb'
7
7
  end
8
+
9
+ task :default => :test
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Ahora
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
  <userPosts type="array">
3
3
  <userPost>
4
- <hidden>false</hidden>
4
+ <hidden>false</hidden>
5
5
  <objectId>1</objectId>
6
6
  <userObjectId>1</userObjectId>
7
7
  <user>
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.1
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-04-12 00:00:00.000000000 Z
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: &70160681904060 !ruby/object:Gem::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: *70160681904060
24
+ version_requirements: *70334212827160
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: faraday
27
- requirement: &70160681901920 !ruby/object:Gem::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: *70160681901920
35
+ version_requirements: *70334212826660
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: nokogiri
38
- requirement: &70160681900040 !ruby/object:Gem::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: *70160681900040
46
+ version_requirements: *70334212826200
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: activesupport
49
- requirement: &70160681898560 !ruby/object:Gem::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: *70160681898560
57
+ version_requirements: *70334212825820
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: fakeweb
60
- requirement: &70160681897280 !ruby/object:Gem::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: *70160681897280
68
+ version_requirements: *70334212825360
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest
71
- requirement: &70160681896360 !ruby/object:Gem::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: *70160681896360
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