osm 0.0.20 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,15 +1,19 @@
1
+ ## Version 0.0.21
2
+
3
+ * Fix getting section\_id and grouping\_id for api.get\_members
4
+
1
5
  ## Version 0.0.20
2
6
 
3
- * Start deprecation of api\_data option in Api methods (raise a warning and adjust documentation)
7
+ * Start deprecation of api\_data option in api methods (raise a warning and adjust documentation)
4
8
  * Hide sesitive information when printing data sent to OSM in debug mode
5
9
  * Add archived attribute to Event
6
- * Add :include\_archived option to Api.get\_events method
10
+ * Add :include\_archived option to api.get\_events method
7
11
  * Add retreival of Flexi Records
8
12
  * Make set\_user method of Api public
9
13
 
10
14
  ## Version 0.0.19
11
15
 
12
- * Fix caching error in Api.get\_register\_data
16
+ * Fix caching error in api.get\_register\_data
13
17
 
14
18
  ## Version 0.0.18
15
19
 
@@ -51,7 +55,7 @@
51
55
 
52
56
  ## Version 0.0.14
53
57
 
54
- * Fix Api.get_register\_data\ returning wrong object
58
+ * Fix api.get_register\_data\ returning wrong object
55
59
  * Fix check of :num\_scouts in Section.initalize
56
60
 
57
61
  ## Version 0.0.13
@@ -66,8 +70,8 @@
66
70
  * Activity.files now returns an array of Osm::Activity::File objects
67
71
  * Activity.versions now returns an array of Osm::Activity::Version objects
68
72
  * Section.flexi_records now returns an array of Osm::Section::FlexiRecord objects
69
- * Api.get\_register\_structure now returns an array of RegisterField objects
70
- * Api.get\_register becomes Api.get\_register\_data and now returns an array of RegisterData objects
73
+ * api.get\_register\_structure now returns an array of RegisterField objects
74
+ * api.get\_register becomes api.get\_register\_data and now returns an array of RegisterData objects
71
75
  * Attribute name changes:
72
76
  * Activity::Badge.section becomes section\_type
73
77
  * Activity::File.file\_id becomes id
@@ -375,7 +375,7 @@ module Osm
375
375
 
376
376
  result = Array.new
377
377
  data['items'].each do |item|
378
- result.push Osm::Member.from_api(item)
378
+ result.push Osm::Member.from_api(item, section_id)
379
379
  end
380
380
  self.user_can_access :member, section_id, api_data
381
381
  cache_write(cache_key, result, :expires_in => @@default_cache_ttl)
@@ -119,10 +119,10 @@ module Osm
119
119
 
120
120
  # Initialize a new Member from api data
121
121
  # @param [Hash] data the hash of data provided by the API
122
- def self.from_api(data)
122
+ def self.from_api(data, section_id)
123
123
  new({
124
+ :section_id => section_id,
124
125
  :id => Osm::to_i_or_nil(data['scoutid']),
125
- :section_id => Osm::to_i_or_nil(data['sectionidO']),
126
126
  :type => data['type'],
127
127
  :first_name => data['firstname'],
128
128
  :last_name => data['lastname'],
@@ -146,8 +146,8 @@ module Osm
146
146
  :school => data['school'],
147
147
  :ethnicity => data['ethnicity'],
148
148
  :subs => data['subs'],
149
- :grouping_id => Osm::to_i_or_nil(data['patrolidO']),
150
- :grouping_leader => Osm::to_i_or_nil(data['patrolleaderO']),
149
+ :grouping_id => Osm::to_i_or_nil(data['patrolid']),
150
+ :grouping_leader => Osm::to_i_or_nil(data['patrolleader']),
151
151
  :joined => Osm::parse_date(data['joined']),
152
152
  :age => data['age'],
153
153
  :joined_years => data['yrs'].to_i,
@@ -18,13 +18,13 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_runtime_dependency 'activesupport', '>= 3.2' # Used to parse JSON from OSM
22
- s.add_runtime_dependency 'httparty' # Used to make web requests to the API
23
- s.add_runtime_dependency 'active_attr'
24
- s.add_runtime_dependency 'activemodel'
21
+ s.add_runtime_dependency 'activesupport', '~> 3.2' # Used to parse JSON from OSM
22
+ s.add_runtime_dependency 'httparty', '~> 0.9' # Used to make web requests to the API
23
+ s.add_runtime_dependency 'active_attr', '~> 0.6'
24
+ s.add_runtime_dependency 'activemodel', '~> 3.2'
25
25
 
26
- s.add_development_dependency 'rake'
27
- s.add_development_dependency 'rspec'
28
- s.add_development_dependency 'fakeweb'
26
+ s.add_development_dependency 'rake', '~> 0.9'
27
+ s.add_development_dependency 'rspec', '~> 2.11'
28
+ s.add_development_dependency 'fakeweb', '~> 1.3'
29
29
 
30
30
  end
@@ -36,10 +36,10 @@ describe "Member" do
36
36
  'age' => '06/07',
37
37
  'yrs' => 1,
38
38
  'patrol' => 'Blue',
39
- 'patrolidO' => '3',
39
+ 'patrolidO' => '4',
40
40
  'patrolleaderO' => 0,
41
41
  }
42
- member = Osm::Member.from_api(data)
42
+ member = Osm::Member.from_api(data, 2)
43
43
 
44
44
  member.id.should == 1
45
45
  member.section_id.should == 2
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Osm
2
- VERSION = "0.0.20"
2
+ VERSION = "0.0.21"
3
3
  end
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.0.20
4
+ version: 0.0.21
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,81 +13,81 @@ date: 2012-09-24 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &80777240 !ruby/object:Gem::Requirement
16
+ requirement: &84462520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - ~>
20
20
  - !ruby/object:Gem::Version
21
21
  version: '3.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *80777240
24
+ version_requirements: *84462520
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: httparty
27
- requirement: &80776920 !ruby/object:Gem::Requirement
27
+ requirement: &84461050 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
- - - ! '>='
30
+ - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: '0'
32
+ version: '0.9'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *80776920
35
+ version_requirements: *84461050
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: active_attr
38
- requirement: &80776570 !ruby/object:Gem::Requirement
38
+ requirement: &84459560 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
- - - ! '>='
41
+ - - ~>
42
42
  - !ruby/object:Gem::Version
43
- version: '0'
43
+ version: '0.6'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *80776570
46
+ version_requirements: *84459560
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: activemodel
49
- requirement: &80776260 !ruby/object:Gem::Requirement
49
+ requirement: &84432320 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
- - - ! '>='
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '3.2'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *80776260
57
+ version_requirements: *84432320
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rake
60
- requirement: &80775920 !ruby/object:Gem::Requirement
60
+ requirement: &84430640 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
- - - ! '>='
63
+ - - ~>
64
64
  - !ruby/object:Gem::Version
65
- version: '0'
65
+ version: '0.9'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *80775920
68
+ version_requirements: *84430640
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
- requirement: &80775540 !ruby/object:Gem::Requirement
71
+ requirement: &84429660 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
- - - ! '>='
74
+ - - ~>
75
75
  - !ruby/object:Gem::Version
76
- version: '0'
76
+ version: '2.11'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *80775540
79
+ version_requirements: *84429660
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: fakeweb
82
- requirement: &80775080 !ruby/object:Gem::Requirement
82
+ requirement: &84429240 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
- - - ! '>='
85
+ - - ~>
86
86
  - !ruby/object:Gem::Version
87
- version: '0'
87
+ version: '1.3'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *80775080
90
+ version_requirements: *84429240
91
91
  description: Use the Online Scout Manager API (https://www.onlinescoutmanager.co.uk)
92
92
  to retrieve and save data.
93
93
  email: