osm 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +11 -0
- data/lib/osm/event.rb +24 -0
- data/lib/osm/grouping.rb +11 -9
- data/lib/osm/member.rb +27 -7
- data/lib/osm/register.rb +30 -22
- data/spec/osm/event_spec.rb +103 -0
- data/spec/osm/grouping_spec.rb +27 -17
- data/spec/osm/member_spec.rb +25 -12
- data/spec/osm/register_spec.rb +13 -0
- data/version.rb +1 -1
- metadata +16 -16
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## Version 0.1.16
|
2
|
+
|
3
|
+
* Member's grouping attribute:
|
4
|
+
* Renamed to grouping\_label
|
5
|
+
* Virtual attribute grouping added (maps to grouping\_label currently) marked as depricated as it will use a Grouping object not a String in the future
|
6
|
+
* Fix exception when OSM returns empty string when requesting groupings for a section
|
7
|
+
* Fix exception when OSM returns empty string when requesting register structure for a section
|
8
|
+
* Fix updating of grouping for Member
|
9
|
+
* Fix validation error for Member - a leader's joining\_in\_years is -1
|
10
|
+
* Add spaces and spaces? methods to Event
|
11
|
+
|
1
12
|
## Version 0.1.15
|
2
13
|
|
3
14
|
* Rename grouping\_name attribute of Member to grouping
|
data/lib/osm/event.rb
CHANGED
@@ -325,8 +325,32 @@ module Osm
|
|
325
325
|
(attendance_limit != 0)
|
326
326
|
end
|
327
327
|
|
328
|
+
# Whether there are spaces left for the event
|
329
|
+
# @param [Osm::Api] api The api to use to make the request
|
330
|
+
# @return [Boolean] whether there are spaces left for the event
|
331
|
+
def spaces?(api)
|
332
|
+
return true unless limited_attendance?
|
333
|
+
return attendance_limit > attendees(api)
|
334
|
+
end
|
335
|
+
|
336
|
+
# Get the number of spaces left for the event
|
337
|
+
# @param [Osm::Api] api The api to use to make the request
|
338
|
+
# @return [Fixnum, nil] the number of spaces left (nil if there is no attendance limit)
|
339
|
+
def spaces(api)
|
340
|
+
return nil unless limited_attendance?
|
341
|
+
return attendance_limit - attendees(api)
|
342
|
+
end
|
343
|
+
|
328
344
|
|
329
345
|
private
|
346
|
+
def attendees(api)
|
347
|
+
attendees = 0
|
348
|
+
get_attendance(api).each do |a|
|
349
|
+
attendees += 1 unless attendance_limit_includes_leaders && (a.grouping_id == -2)
|
350
|
+
end
|
351
|
+
return attendees
|
352
|
+
end
|
353
|
+
|
330
354
|
def self.new_event_from_data(event_data)
|
331
355
|
event = Osm::Event.new(
|
332
356
|
:id => Osm::to_i_or_nil(event_data['eventid']),
|
data/lib/osm/grouping.rb
CHANGED
@@ -44,16 +44,18 @@ module Osm
|
|
44
44
|
data = api.perform_query("users.php?action=getPatrols§ionid=#{section_id}")
|
45
45
|
|
46
46
|
result = Array.new
|
47
|
-
data['patrols'].
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
47
|
+
if data.is_a?(Hash) && data['patrols'].is_a?(Array)
|
48
|
+
data['patrols'].each do |item|
|
49
|
+
result.push Osm::Grouping.new({
|
50
|
+
:id => Osm::to_i_or_nil(item['patrolid']),
|
51
|
+
:section_id => section_id,
|
52
|
+
:name => item['name'],
|
53
|
+
:active => (item['active'] == 1),
|
54
|
+
:points => Osm::to_i_or_nil(item['points']),
|
55
|
+
})
|
56
|
+
end
|
57
|
+
cache_write(api, cache_key, result)
|
55
58
|
end
|
56
|
-
cache_write(api, cache_key, result)
|
57
59
|
|
58
60
|
return result
|
59
61
|
end
|
data/lib/osm/member.rb
CHANGED
@@ -74,7 +74,7 @@ module Osm
|
|
74
74
|
# @return [Fixnum] the grouping within the section that the member belongs to
|
75
75
|
# @!attribute [rw] grouping_leader
|
76
76
|
# @return [Fixnum] whether the member is the grouping leader (0=no, 1=seconder/APL, 2=sixer/PL)
|
77
|
-
# @!attribute [rw]
|
77
|
+
# @!attribute [rw] grouping_label
|
78
78
|
# @return [Fixnum] the grouping within the section that the member belongs to (as displayed in OSM, if member was retrieved from OSM)
|
79
79
|
# @!attribute [rw] joined
|
80
80
|
# @return [Date] when the member joined the section
|
@@ -118,7 +118,7 @@ module Osm
|
|
118
118
|
attribute :custom8, :type => String, :default => ''
|
119
119
|
attribute :custom9, :type => String, :default => ''
|
120
120
|
attribute :grouping_id, :type => Integer
|
121
|
-
attribute :
|
121
|
+
attribute :grouping_label, :type => String, :default => ''
|
122
122
|
attribute :grouping_leader, :type => Integer
|
123
123
|
attribute :joined, :type => Date
|
124
124
|
attribute :age, :type => String
|
@@ -128,14 +128,14 @@ module Osm
|
|
128
128
|
:phone1, :phone2, :phone3, :phone4, :address, :address2, :date_of_birth, :started,
|
129
129
|
:joining_in_years, :parents, :notes, :medical, :religion, :school, :ethnicity, :subs,
|
130
130
|
:custom1, :custom2, :custom3, :custom4, :custom5, :custom6, :custom7, :custom8, :custom9,
|
131
|
-
:grouping_id, :
|
131
|
+
:grouping_id, :grouping_label, :grouping_leader, :joined, :age, :joined_years
|
132
132
|
|
133
133
|
validates_numericality_of :id, :only_integer=>true, :greater_than=>0, :unless => Proc.new { |r| r.id.nil? }
|
134
134
|
validates_numericality_of :section_id, :only_integer=>true, :greater_than=>0
|
135
135
|
validates_numericality_of :grouping_id, :only_integer=>true, :greater_than_or_equal_to=>-2
|
136
136
|
validates_numericality_of :grouping_leader, :only_integer=>true, :greater_than_or_equal_to=>0, :less_than_or_equal_to=>2
|
137
137
|
validates_numericality_of :joined_years, :only_integer=>true, :greater_than_or_equal_to=>-1, :allow_nil=>true
|
138
|
-
validates_numericality_of :joining_in_years, :only_integer=>true, :greater_than_or_equal_to
|
138
|
+
validates_numericality_of :joining_in_years, :only_integer=>true, :greater_than_or_equal_to=>-1, :allow_nil=>true
|
139
139
|
validates_presence_of :first_name
|
140
140
|
validates_presence_of :last_name
|
141
141
|
validates_presence_of :date_of_birth
|
@@ -200,7 +200,7 @@ module Osm
|
|
200
200
|
:custom8 => item['custom8'],
|
201
201
|
:custom9 => item['custom9'],
|
202
202
|
:grouping_id => Osm::to_i_or_nil(item['patrolid']),
|
203
|
-
:
|
203
|
+
:grouping_label => item['patrol'],
|
204
204
|
:grouping_leader => Osm::to_i_or_nil(item['patrolleader']),
|
205
205
|
:joined => Osm::parse_date(item['joined']),
|
206
206
|
:age => item['age'].gsub(' ', ''),
|
@@ -213,6 +213,20 @@ module Osm
|
|
213
213
|
end
|
214
214
|
|
215
215
|
|
216
|
+
# @deprecated use grouping_label instead
|
217
|
+
# @return [String] the grouping as displayed in OSM
|
218
|
+
# TODO - Use a Grouping object not String when upping the version
|
219
|
+
def grouping
|
220
|
+
return self.grouping_label
|
221
|
+
end
|
222
|
+
# @deprecated use grouping_label instead
|
223
|
+
# TODO - Use a Grouping object not String when upping the version
|
224
|
+
def grouping=(new_grouping)
|
225
|
+
return self.grouping_label = new_grouping
|
226
|
+
end
|
227
|
+
|
228
|
+
|
229
|
+
|
216
230
|
# @!method initialize
|
217
231
|
# Initialize a new Member
|
218
232
|
# @param [Hash] attributes the hash of attributes (see attributes for descriptions, use Symbol of attribute name as the key)
|
@@ -286,8 +300,6 @@ module Osm
|
|
286
300
|
'dob' => date_of_birth.strftime(Osm::OSM_DATE_FORMAT),
|
287
301
|
'started' => started.strftime(Osm::OSM_DATE_FORMAT),
|
288
302
|
'startedsection' => joined.strftime(Osm::OSM_DATE_FORMAT),
|
289
|
-
'patrolid' => grouping_id,
|
290
|
-
'patrolleader' => grouping_leader,
|
291
303
|
'email1' => email1,
|
292
304
|
'email2' => email2,
|
293
305
|
'email3' => email3,
|
@@ -327,6 +339,14 @@ module Osm
|
|
327
339
|
result &= (data[column] == value.to_s)
|
328
340
|
end
|
329
341
|
|
342
|
+
data = api.perform_query("users.php?action=updateMemberPatrol", {
|
343
|
+
'scoutid' => self.id,
|
344
|
+
'patrolid' => grouping_id,
|
345
|
+
'pl' => grouping_leader,
|
346
|
+
'sectionid' => section_id,
|
347
|
+
})
|
348
|
+
result &= ((data['patrolid'].to_i == grouping_id) && (data['patrolleader'].to_i == grouping_leader))
|
349
|
+
|
330
350
|
return result
|
331
351
|
end
|
332
352
|
|
data/lib/osm/register.rb
CHANGED
@@ -20,17 +20,21 @@ module Osm
|
|
20
20
|
data = api.perform_query("users.php?action=registerStructure§ionid=#{section_id}&termid=#{term_id}")
|
21
21
|
|
22
22
|
structure = []
|
23
|
-
data.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
if data.is_a?(Array)
|
24
|
+
data.each do |item|
|
25
|
+
if item.is_a?(Hash) && item['rows'].is_a?(Array)
|
26
|
+
item['rows'].each do |row|
|
27
|
+
structure.push Field.new(
|
28
|
+
:id => row['field'],
|
29
|
+
:name => row['name'],
|
30
|
+
:tooltip => row['tooltip'],
|
31
|
+
)
|
32
|
+
end
|
33
|
+
end
|
30
34
|
end
|
31
35
|
end
|
32
|
-
Osm::Model.cache_write(api, cache_key, structure)
|
33
36
|
|
37
|
+
Osm::Model.cache_write(api, cache_key, structure) unless structure.nil?
|
34
38
|
return structure
|
35
39
|
end
|
36
40
|
|
@@ -51,23 +55,27 @@ module Osm
|
|
51
55
|
|
52
56
|
data = api.perform_query("users.php?action=register§ionid=#{section_id}&termid=#{term_id}")
|
53
57
|
|
54
|
-
data = data['items']
|
55
58
|
to_return = []
|
56
|
-
data.
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
59
|
+
if data.is_a?(Hash) && data['items'].is_a?(Array)
|
60
|
+
data = data['items']
|
61
|
+
data.each do |item|
|
62
|
+
if item.is_a?(Hash)
|
63
|
+
unless item['scoutid'].to_i < 0 # It's a total row
|
64
|
+
to_return.push Osm::Register::Attendance.new(
|
65
|
+
:member_id => Osm::to_i_or_nil(item['scoutid']),
|
66
|
+
:grouping_id => Osm::to_i_or_nil(item ['patrolid']),
|
67
|
+
:section_id => section_id,
|
68
|
+
:first_name => item['firstname'],
|
69
|
+
:last_name => item['lastname'],
|
70
|
+
:total => item['total'].to_i,
|
71
|
+
:attendance => item.select { |key, value| key.to_s.match(Osm::OSM_DATE_REGEX) }.
|
72
|
+
inject({}){ |new_hash,(date, attendance)| new_hash[Date.strptime(date, Osm::OSM_DATE_FORMAT)] = attendance; new_hash },
|
73
|
+
)
|
74
|
+
end
|
75
|
+
end
|
68
76
|
end
|
77
|
+
Osm::Model.cache_write(api, cache_key, to_return)
|
69
78
|
end
|
70
|
-
Osm::Model.cache_write(api, cache_key, to_return)
|
71
79
|
return to_return
|
72
80
|
end
|
73
81
|
|
data/spec/osm/event_spec.rb
CHANGED
@@ -51,6 +51,7 @@ describe "Event" do
|
|
51
51
|
Osm::Event.new(:attendance_limit => 1).limited_attendance?.should be_true
|
52
52
|
end
|
53
53
|
|
54
|
+
|
54
55
|
it "Create Event::Attendance" do
|
55
56
|
data = {
|
56
57
|
:member_id => 1,
|
@@ -204,6 +205,108 @@ describe "Event" do
|
|
204
205
|
event.id.should == 2
|
205
206
|
end
|
206
207
|
|
208
|
+
describe "Tells if there are spaces" do
|
209
|
+
|
210
|
+
it "No limit" do
|
211
|
+
event = Osm::Event.new(:attendance_limit => 0, :id => 1, :section_id => 2)
|
212
|
+
event.spaces?(@api).should be_true
|
213
|
+
event.spaces(@api).should == nil
|
214
|
+
end
|
215
|
+
|
216
|
+
it "Under limit" do
|
217
|
+
FakeWeb.register_uri(:post, 'https://www.onlinescoutmanager.co.uk/events.php?action=getEventAttendance&eventid=1§ionid=2&termid=3', :body => {
|
218
|
+
'identifier' => 'scoutid',
|
219
|
+
'eventid' => '1',
|
220
|
+
'items' => [
|
221
|
+
{
|
222
|
+
'scoutid' => '4',
|
223
|
+
'attending' => 'Yes',
|
224
|
+
'firstname' => 'First',
|
225
|
+
'lastname' => 'Last',
|
226
|
+
'dob' => '1980-01-02',
|
227
|
+
'patrolid' => '2',
|
228
|
+
'f_1' => 'a',
|
229
|
+
},
|
230
|
+
]
|
231
|
+
}.to_json)
|
232
|
+
Osm::Term.stub(:get_current_term_for_section) { Osm::Term.new(:id => 3) }
|
233
|
+
|
234
|
+
event = Osm::Event.new(:attendance_limit => 2, :id => 1, :section_id => 2)
|
235
|
+
event.spaces?(@api).should be_true
|
236
|
+
event.spaces(@api).should == 1
|
237
|
+
end
|
238
|
+
|
239
|
+
it "Over limit" do
|
240
|
+
FakeWeb.register_uri(:post, 'https://www.onlinescoutmanager.co.uk/events.php?action=getEventAttendance&eventid=1§ionid=2&termid=3', :body => {
|
241
|
+
'identifier' => 'scoutid',
|
242
|
+
'eventid' => '1',
|
243
|
+
'items' => [
|
244
|
+
{
|
245
|
+
'scoutid' => '4',
|
246
|
+
'attending' => 'Yes',
|
247
|
+
'firstname' => 'First',
|
248
|
+
'lastname' => 'Last',
|
249
|
+
'dob' => '1980-01-02',
|
250
|
+
'patrolid' => '2',
|
251
|
+
'f_1' => 'a',
|
252
|
+
},{
|
253
|
+
'scoutid' => '5',
|
254
|
+
'attending' => 'Yes',
|
255
|
+
'firstname' => 'First',
|
256
|
+
'lastname' => 'Last',
|
257
|
+
'dob' => '1980-01-02',
|
258
|
+
'patrolid' => '2',
|
259
|
+
'f_1' => 'a',
|
260
|
+
},{
|
261
|
+
'scoutid' => '6',
|
262
|
+
'attending' => 'Yes',
|
263
|
+
'firstname' => 'First',
|
264
|
+
'lastname' => 'Last',
|
265
|
+
'dob' => '1980-01-02',
|
266
|
+
'patrolid' => '2',
|
267
|
+
'f_1' => 'a',
|
268
|
+
}
|
269
|
+
]
|
270
|
+
}.to_json)
|
271
|
+
Osm::Term.stub(:get_current_term_for_section) { Osm::Term.new(:id => 3) }
|
272
|
+
|
273
|
+
event = Osm::Event.new(:attendance_limit => 2, :id => 1, :section_id => 2)
|
274
|
+
event.spaces?(@api).should be_false
|
275
|
+
event.spaces(@api).should == -1
|
276
|
+
end
|
277
|
+
|
278
|
+
it "At limit" do
|
279
|
+
FakeWeb.register_uri(:post, 'https://www.onlinescoutmanager.co.uk/events.php?action=getEventAttendance&eventid=1§ionid=2&termid=3', :body => {
|
280
|
+
'identifier' => 'scoutid',
|
281
|
+
'eventid' => '1',
|
282
|
+
'items' => [
|
283
|
+
{
|
284
|
+
'scoutid' => '4',
|
285
|
+
'attending' => 'Yes',
|
286
|
+
'firstname' => 'First',
|
287
|
+
'lastname' => 'Last',
|
288
|
+
'dob' => '1980-01-02',
|
289
|
+
'patrolid' => '2',
|
290
|
+
'f_1' => 'a',
|
291
|
+
},{
|
292
|
+
'scoutid' => '5',
|
293
|
+
'attending' => 'Yes',
|
294
|
+
'firstname' => 'First',
|
295
|
+
'lastname' => 'Last',
|
296
|
+
'dob' => '1980-01-02',
|
297
|
+
'patrolid' => '2',
|
298
|
+
'f_1' => 'a',
|
299
|
+
}
|
300
|
+
]
|
301
|
+
}.to_json)
|
302
|
+
Osm::Term.stub(:get_current_term_for_section) { Osm::Term.new(:id => 3) }
|
303
|
+
|
304
|
+
event = Osm::Event.new(:attendance_limit => 2, :id => 1, :section_id => 2)
|
305
|
+
event.spaces?(@api).should be_false
|
306
|
+
event.spaces(@api).should == 0
|
307
|
+
end
|
308
|
+
|
309
|
+
end
|
207
310
|
|
208
311
|
it "Create (succeded)" do
|
209
312
|
url = 'https://www.onlinescoutmanager.co.uk/events.php?action=addEvent§ionid=1'
|
data/spec/osm/grouping_spec.rb
CHANGED
@@ -3,24 +3,34 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
describe "Grouping" do
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
'
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
describe "Using the API" do
|
7
|
+
|
8
|
+
it "Create" do
|
9
|
+
body = {'patrols' => [{
|
10
|
+
'patrolid' => 1,
|
11
|
+
'name' => 'Patrol Name',
|
12
|
+
'active' => 1,
|
13
|
+
'points' => '3',
|
14
|
+
}]}
|
15
|
+
FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/users.php?action=getPatrols§ionid=2", :body => body.to_json)
|
16
|
+
|
17
|
+
patrols = Osm::Grouping.get_for_section(@api, 2)
|
18
|
+
patrols.size.should == 1
|
19
|
+
patrol = patrols[0]
|
20
|
+
patrol.id.should == 1
|
21
|
+
patrol.section_id.should == 2
|
22
|
+
patrol.name.should == 'Patrol Name'
|
23
|
+
patrol.active.should == true
|
24
|
+
patrol.points.should == 3
|
25
|
+
patrol.valid?.should be_true
|
26
|
+
end
|
27
|
+
|
28
|
+
it "Handles no data" do
|
29
|
+
FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/users.php?action=getPatrols§ionid=2", :body => '')
|
30
|
+
patrols = Osm::Grouping.get_for_section(@api, 2)
|
31
|
+
patrols.size.should == 0
|
32
|
+
end
|
14
33
|
|
15
|
-
patrols = Osm::Grouping.get_for_section(@api, 2)
|
16
|
-
patrols.size.should == 1
|
17
|
-
patrol = patrols[0]
|
18
|
-
patrol.id.should == 1
|
19
|
-
patrol.section_id.should == 2
|
20
|
-
patrol.name.should == 'Patrol Name'
|
21
|
-
patrol.active.should == true
|
22
|
-
patrol.points.should == 3
|
23
|
-
patrol.valid?.should be_true
|
24
34
|
end
|
25
35
|
|
26
36
|
end
|
data/spec/osm/member_spec.rb
CHANGED
@@ -41,7 +41,7 @@ describe "Member" do
|
|
41
41
|
:custom9 => 'Custom Field 9',
|
42
42
|
:grouping_id => '3',
|
43
43
|
:grouping_leader => 0,
|
44
|
-
:
|
44
|
+
:grouping_label => 'Grouping',
|
45
45
|
:joined => '2006-01-07',
|
46
46
|
:age => '06/07',
|
47
47
|
:joined_years => 1,
|
@@ -83,7 +83,7 @@ describe "Member" do
|
|
83
83
|
member.custom8.should == 'Custom Field 8'
|
84
84
|
member.custom9.should == 'Custom Field 9'
|
85
85
|
member.grouping_id.should == 3
|
86
|
-
member.
|
86
|
+
member.grouping_label.should == 'Grouping'
|
87
87
|
member.grouping_leader.should == 0
|
88
88
|
member.joined.should == Date.new(2006, 1, 7)
|
89
89
|
member.age.should == '06/07'
|
@@ -374,17 +374,30 @@ describe "Member" do
|
|
374
374
|
body = (body_data.inject({}) {|h,(k,v)| h[k]=v.to_s; h}).to_json
|
375
375
|
|
376
376
|
body_data.each do |column, value|
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
377
|
+
unless ['patrolid', 'patrolleader'].include?(column)
|
378
|
+
HTTParty.should_receive(:post).with(url, {:body => {
|
379
|
+
'apiid' => @CONFIGURATION[:api][:osm][:id],
|
380
|
+
'token' => @CONFIGURATION[:api][:osm][:token],
|
381
|
+
'userid' => 'user_id',
|
382
|
+
'secret' => 'secret',
|
383
|
+
'scoutid' => member.id,
|
384
|
+
'column' => column,
|
385
|
+
'value' => value,
|
386
|
+
'sectionid' => member.section_id,
|
387
|
+
}}) { DummyHttpResult.new(:response=>{:code=>'200', :body=>body}) }
|
388
|
+
end
|
387
389
|
end
|
390
|
+
HTTParty.should_receive(:post).with('https://www.onlinescoutmanager.co.uk/users.php?action=updateMemberPatrol', {:body => {
|
391
|
+
'apiid' => @CONFIGURATION[:api][:osm][:id],
|
392
|
+
'token' => @CONFIGURATION[:api][:osm][:token],
|
393
|
+
'userid' => 'user_id',
|
394
|
+
'secret' => 'secret',
|
395
|
+
'scoutid' => member.id,
|
396
|
+
'patrolid' => member.grouping_id,
|
397
|
+
'pl' => member.grouping_leader,
|
398
|
+
'sectionid' => member.section_id,
|
399
|
+
}}) { DummyHttpResult.new(:response=>{:code=>'200', :body=>body}) }
|
400
|
+
|
388
401
|
member.update(@api).should be_true
|
389
402
|
end
|
390
403
|
|
data/spec/osm/register_spec.rb
CHANGED
@@ -152,6 +152,19 @@ describe "Register" do
|
|
152
152
|
reg.last_name.should == 'Last'
|
153
153
|
end
|
154
154
|
|
155
|
+
it "Handles no data" do
|
156
|
+
FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/users.php?action=registerStructure§ionid=1&termid=2", :body => '')
|
157
|
+
register_structure = Osm::Register.get_structure(@api, 1, 2)
|
158
|
+
register_structure.is_a?(Array).should be_true
|
159
|
+
register_structure.size.should == 0
|
160
|
+
|
161
|
+
|
162
|
+
FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/users.php?action=register§ionid=1&termid=2", :body => '')
|
163
|
+
register = Osm::Register.get_attendance(@api, 1, 2)
|
164
|
+
register.is_a?(Array).should be_true
|
165
|
+
register.size.should == 0
|
166
|
+
end
|
167
|
+
|
155
168
|
end
|
156
169
|
|
157
170
|
end
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: osm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
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: 2013-
|
12
|
+
date: 2013-02-02 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &88296760 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *88296760
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: httparty
|
27
|
-
requirement: &
|
27
|
+
requirement: &88296420 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0.9'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *88296420
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: active_attr
|
38
|
-
requirement: &
|
38
|
+
requirement: &88296130 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0.6'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *88296130
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: activemodel
|
49
|
-
requirement: &
|
49
|
+
requirement: &88295670 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '3.2'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *88295670
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rake
|
60
|
-
requirement: &
|
60
|
+
requirement: &88295400 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '10.0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *88295400
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
|
-
requirement: &
|
71
|
+
requirement: &88295160 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '2.11'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *88295160
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: fakeweb
|
82
|
-
requirement: &
|
82
|
+
requirement: &88294750 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '1.3'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *88294750
|
91
91
|
description: Use the Online Scout Manager API (https://www.onlinescoutmanager.co.uk)
|
92
92
|
to retrieve and save data.
|
93
93
|
email:
|