betty_resource 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTdiYWZmNDY0OTZkNTQ3NDMwMTllMDM1YjkwMDkxMjA1YTNlY2Y0NA==
5
+ data.tar.gz: !binary |-
6
+ Mzc5NmIxMDg0NzUyNmExZWQxOTZkOGUyNjljNTRkOTRjNzZiMzJkOQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YmIxNGMxNGUxNWQ1OGNlMjhiMDdmZjlmZTU2ZTkzZThhMjBkNzU3ODIzYjdh
10
+ NGI3ZjBmNWQyYzBiZjc1ZDNmZmM3ODMyYWQ4NmYwMDNjMmQ2ZDRjZDMxMDc0
11
+ NjEzOGFkOTU5NzVhMTI4MDg4YTM3NGJjOGMxYzg2MTYwYTU3ZjM=
12
+ data.tar.gz: !binary |-
13
+ OWE1MjE5NDI4ODRiY2VhMmU4ZjBlOGE5YTg0M2Q2MmI5ODBkNjU2NGYzZDVi
14
+ YWEyYTdmNmMzMWI3NWNkY2FhZjhkMjM3NTRmNDExNTMxOTUwYTJiOGVlMGM0
15
+ ZTFhYzIyNDYxNDc1YWMwYzczMzU2NGI1YTM1NGVkNGQxODQ1NTI=
data/CHANGELOG.rdoc CHANGED
@@ -1,10 +1,10 @@
1
1
  = BettyResource CHANGELOG
2
2
 
3
- === Version 0.0.5 / 2012-03-01
3
+ === 0.0.8 / 2013-04-04
4
4
 
5
- * Created by Chiel
5
+ * 1 feature:
6
6
 
7
- === Version 0.0.6 / 2013-01-22
7
+ * Add support for fetching a record with conditions
8
8
 
9
9
  === Version 0.0.7 / 2013-01-22
10
10
 
@@ -13,4 +13,11 @@
13
13
  * Add changelog generation script
14
14
  * Adjust author information
15
15
  * Remove some sensitive details
16
- * We have a hard dependency on multi_json
16
+ * We have a hard dependency on multi_json
17
+
18
+ === Version 0.0.6 / 2013-01-22
19
+
20
+ === Version 0.0.5 / 2012-03-01
21
+
22
+ * Created by Chiel
23
+
@@ -15,6 +15,10 @@ module BettyResource
15
15
  @id, @name, @properties = id, name, properties
16
16
  end
17
17
 
18
+ def property(name)
19
+ properties.detect{|p|p.name == name.to_s}
20
+ end
21
+
18
22
  def attributes
19
23
  properties.collect(&:name)
20
24
  end
@@ -37,6 +41,10 @@ module BettyResource
37
41
  end
38
42
  end
39
43
 
44
+ def first(options = {})
45
+ all(options.merge(:limit => 1)).first
46
+ end
47
+
40
48
  def new(attributes = {})
41
49
  BettyResource::Model::Record.new(self, attributes)
42
50
  end
@@ -1,7 +1,7 @@
1
1
  module BettyResource
2
2
  MAJOR = 0
3
3
  MINOR = 0
4
- TINY = 7
4
+ TINY = 8
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join(".")
7
7
  end
@@ -29,6 +29,19 @@ module Unit
29
29
  assert_equal "Willemse", relation.last_name
30
30
  end
31
31
 
32
+ it "should fetch a first record" do
33
+ relation = BettyResource::Relation.first
34
+ assert_equal 1, relation.id
35
+ assert_equal "Daniel", relation.first_name
36
+ assert_equal "Willemse", relation.last_name
37
+
38
+ relation = BettyResource::Relation.first :filters => {:path => BettyResource::Relation.property(:last_name).id, :predicate => "eq", :criteria => "Piet"}
39
+ assert_nil relation
40
+
41
+ relation = BettyResource::Relation.first :filters => {:path => BettyResource::Relation.property(:last_name).id, :predicate => "eq", :criteria => "Willemse"}
42
+ assert_equal 1, relation.id
43
+ end
44
+
32
45
  it "should fetch multiple records" do
33
46
  relations = BettyResource::Relation.all
34
47
  assert_equal 100, relations.size
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: betty_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
5
- prerelease:
4
+ version: 0.0.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Chiel Wester
@@ -12,12 +11,11 @@ authors:
12
11
  autorequire:
13
12
  bindir: bin
14
13
  cert_chain: []
15
- date: 2013-01-22 00:00:00.000000000 Z
14
+ date: 2013-04-04 00:00:00.000000000 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: httparty
19
18
  requirement: !ruby/object:Gem::Requirement
20
- none: false
21
19
  requirements:
22
20
  - - ! '>='
23
21
  - !ruby/object:Gem::Version
@@ -25,7 +23,6 @@ dependencies:
25
23
  type: :runtime
26
24
  prerelease: false
27
25
  version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
26
  requirements:
30
27
  - - ! '>='
31
28
  - !ruby/object:Gem::Version
@@ -33,7 +30,6 @@ dependencies:
33
30
  - !ruby/object:Gem::Dependency
34
31
  name: activesupport
35
32
  requirement: !ruby/object:Gem::Requirement
36
- none: false
37
33
  requirements:
38
34
  - - ! '>='
39
35
  - !ruby/object:Gem::Version
@@ -41,7 +37,6 @@ dependencies:
41
37
  type: :runtime
42
38
  prerelease: false
43
39
  version_requirements: !ruby/object:Gem::Requirement
44
- none: false
45
40
  requirements:
46
41
  - - ! '>='
47
42
  - !ruby/object:Gem::Version
@@ -49,7 +44,6 @@ dependencies:
49
44
  - !ruby/object:Gem::Dependency
50
45
  name: crack
51
46
  requirement: !ruby/object:Gem::Requirement
52
- none: false
53
47
  requirements:
54
48
  - - ! '>='
55
49
  - !ruby/object:Gem::Version
@@ -57,7 +51,6 @@ dependencies:
57
51
  type: :runtime
58
52
  prerelease: false
59
53
  version_requirements: !ruby/object:Gem::Requirement
60
- none: false
61
54
  requirements:
62
55
  - - ! '>='
63
56
  - !ruby/object:Gem::Version
@@ -65,7 +58,6 @@ dependencies:
65
58
  - !ruby/object:Gem::Dependency
66
59
  name: dirty_hashy
67
60
  requirement: !ruby/object:Gem::Requirement
68
- none: false
69
61
  requirements:
70
62
  - - '='
71
63
  - !ruby/object:Gem::Version
@@ -73,7 +65,6 @@ dependencies:
73
65
  type: :runtime
74
66
  prerelease: false
75
67
  version_requirements: !ruby/object:Gem::Requirement
76
- none: false
77
68
  requirements:
78
69
  - - '='
79
70
  - !ruby/object:Gem::Version
@@ -81,7 +72,6 @@ dependencies:
81
72
  - !ruby/object:Gem::Dependency
82
73
  name: multi_json
83
74
  requirement: !ruby/object:Gem::Requirement
84
- none: false
85
75
  requirements:
86
76
  - - ! '>='
87
77
  - !ruby/object:Gem::Version
@@ -89,7 +79,6 @@ dependencies:
89
79
  type: :runtime
90
80
  prerelease: false
91
81
  version_requirements: !ruby/object:Gem::Requirement
92
- none: false
93
82
  requirements:
94
83
  - - ! '>='
95
84
  - !ruby/object:Gem::Version
@@ -97,7 +86,6 @@ dependencies:
97
86
  - !ruby/object:Gem::Dependency
98
87
  name: minitest
99
88
  requirement: !ruby/object:Gem::Requirement
100
- none: false
101
89
  requirements:
102
90
  - - ! '>='
103
91
  - !ruby/object:Gem::Version
@@ -105,7 +93,6 @@ dependencies:
105
93
  type: :development
106
94
  prerelease: false
107
95
  version_requirements: !ruby/object:Gem::Requirement
108
- none: false
109
96
  requirements:
110
97
  - - ! '>='
111
98
  - !ruby/object:Gem::Version
@@ -142,27 +129,26 @@ files:
142
129
  - test/unit/test_model.rb
143
130
  homepage: https://github.com/bettyblocks/betty_resource
144
131
  licenses: []
132
+ metadata: {}
145
133
  post_install_message:
146
134
  rdoc_options: []
147
135
  require_paths:
148
136
  - lib
149
137
  required_ruby_version: !ruby/object:Gem::Requirement
150
- none: false
151
138
  requirements:
152
139
  - - ! '>='
153
140
  - !ruby/object:Gem::Version
154
141
  version: '0'
155
142
  required_rubygems_version: !ruby/object:Gem::Requirement
156
- none: false
157
143
  requirements:
158
144
  - - ! '>='
159
145
  - !ruby/object:Gem::Version
160
146
  version: '0'
161
147
  requirements: []
162
148
  rubyforge_project:
163
- rubygems_version: 1.8.24
149
+ rubygems_version: 2.0.3
164
150
  signing_key:
165
- specification_version: 3
151
+ specification_version: 4
166
152
  summary: Map Betty5 application resources to Ruby objects
167
153
  test_files:
168
154
  - test/test_helper.rb
@@ -170,4 +156,3 @@ test_files:
170
156
  - test/unit/test_base.rb
171
157
  - test/unit/test_configuration.rb
172
158
  - test/unit/test_model.rb
173
- has_rdoc: