osm 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## Version 1.0.3
2
+
3
+ * Fix "undefined method 'downcase' for 0:Fixnum" caused by some badge requirement data being a Fixnum when a String contains just numbers.
4
+ * Update to use ActiveAttr gem version 0.8
5
+
1
6
  ## Version 1.0.2
2
7
 
3
8
  * Fix Regex for checking dates from OSM
data/lib/osm/activity.rb CHANGED
@@ -263,8 +263,8 @@ module Osm
263
263
 
264
264
  private
265
265
  class File
266
- include ::ActiveAttr::MassAssignmentSecurity
267
- include ::ActiveAttr::Model
266
+ include ActiveModel::MassAssignmentSecurity
267
+ include ActiveAttr::Model
268
268
 
269
269
  # @!attribute [rw] id
270
270
  # @return [Fixnum] the OSM ID for the file
@@ -301,8 +301,8 @@ module Osm
301
301
  end # Class Activity::File
302
302
 
303
303
  class Badge
304
- include ::ActiveAttr::MassAssignmentSecurity
305
- include ::ActiveAttr::Model
304
+ include ActiveModel::MassAssignmentSecurity
305
+ include ActiveAttr::Model
306
306
 
307
307
  # @!attribute [rw] activity_id
308
308
  # @return [Fixnum] the activity being done
@@ -342,8 +342,8 @@ module Osm
342
342
  end # Class Activity::Badge
343
343
 
344
344
  class Version
345
- include ::ActiveAttr::MassAssignmentSecurity
346
- include ::ActiveAttr::Model
345
+ include ActiveModel::MassAssignmentSecurity
346
+ include ActiveAttr::Model
347
347
 
348
348
  # @!attribute [rw] version
349
349
  # @return [Fixnum] the version of the activity
data/lib/osm/badge.rb CHANGED
@@ -195,8 +195,8 @@ module Osm
195
195
 
196
196
 
197
197
  class Requirement
198
- include ::ActiveAttr::MassAssignmentSecurity
199
- include ::ActiveAttr::Model
198
+ include ActiveModel::MassAssignmentSecurity
199
+ include ActiveAttr::Model
200
200
 
201
201
  # @!attribute [rw] badge
202
202
  # @return [Osm::Badge] the badge the requirement belongs to
@@ -300,7 +300,7 @@ module Osm
300
300
  def total_gained
301
301
  count = 0
302
302
  requirements.each do |field, data|
303
- next if data.blank? || data[0].downcase.eql?('x')
303
+ next if data.blank? || data.to_s[0].downcase.eql?('x')
304
304
  count += 1
305
305
  end
306
306
  return count
@@ -328,7 +328,7 @@ module Osm
328
328
  field = field.split('_')[0]
329
329
  unless field.eql?('y')
330
330
  count[field] ||= 0
331
- next if data.blank? || data[0].downcase.eql?('x')
331
+ next if data.blank? || data.to_s[0].downcase.eql?('x')
332
332
  count[field] += 1
333
333
  else
334
334
  # A total 'section'
@@ -352,7 +352,7 @@ module Osm
352
352
  requirements.each do |key, value|
353
353
  case key.split('_')[0]
354
354
  when 'a'
355
- return true unless value.blank? || value[0].downcase.eql?('x')
355
+ return true unless value.blank? || value.to_s[0].downcase.eql?('x')
356
356
  when 'y'
357
357
  return true if (requirements['y_01'].to_i > 0)
358
358
  end
@@ -386,7 +386,7 @@ module Osm
386
386
  requirements.each do |key, value|
387
387
  next if key[0] < start_group # This stage is marked as completed
388
388
  next if key[0] > started # This stage is after the stage currently started
389
- started = key[0] unless value.blank? || value[0].downcase.eql?('x')
389
+ started = key[0] unless value.blank? || value.to_s[0].downcase.eql?('x')
390
390
  end
391
391
  return started.eql?('z') ? 0 : 'abcde'.index(started)+1
392
392
  end
data/lib/osm/meeting.rb CHANGED
@@ -258,8 +258,8 @@ module Osm
258
258
 
259
259
  private
260
260
  class Activity
261
- include ::ActiveAttr::MassAssignmentSecurity
262
- include ::ActiveAttr::Model
261
+ include ActiveModel::MassAssignmentSecurity
262
+ include ActiveAttr::Model
263
263
 
264
264
  # @!attribute [rw] activity_id
265
265
  # @return [Fixnum] the activity being done
data/lib/osm/model.rb CHANGED
@@ -8,8 +8,8 @@ module Osm
8
8
  # This class is expected to be inherited from.
9
9
  # It provides the caching and permission handling for model objects.
10
10
  class Model
11
- include ::ActiveAttr::MassAssignmentSecurity
12
- include ::ActiveAttr::Model
11
+ include ActiveModel::MassAssignmentSecurity
12
+ include ActiveAttr::Model
13
13
 
14
14
  @@cache = nil # Class to use for caching
15
15
  @@cache_prepend = 'OSMAPI' # Prepended to the key
data/osm.gemspec CHANGED
@@ -20,14 +20,14 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.add_runtime_dependency 'activesupport', '~> 3.2' # Used to parse JSON from OSM
22
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', '< 0.8'
23
+ s.add_runtime_dependency 'active_attr', '~> 0.8'
24
24
  s.add_runtime_dependency 'activemodel', '~> 3.2'
25
- s.add_runtime_dependency 'dirty_hashy', '~> 0.2.1' # Used to trach changed data in Badge::Data and FlexiRecord::Data
25
+ s.add_runtime_dependency 'dirty_hashy', '~> 0.2.1' # Used to track changed data in Badge::Data and FlexiRecord::Data
26
26
 
27
27
  s.add_development_dependency 'rake', '~> 10.0'
28
28
  s.add_development_dependency 'rspec', '~> 2.11'
29
29
  s.add_development_dependency 'fakeweb', '~> 1.3'
30
- s.add_development_dependency 'guard-rspec', '~> 2.4'
30
+ s.add_development_dependency 'guard-rspec', '~> 3.0'
31
31
  s.add_development_dependency 'rb-inotify', '~> 0.9'
32
32
 
33
33
  end
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Osm
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
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: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-10 00:00:00.000000000 Z
12
+ date: 2013-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -49,9 +49,6 @@ dependencies:
49
49
  none: false
50
50
  requirements:
51
51
  - - ~>
52
- - !ruby/object:Gem::Version
53
- version: '0.6'
54
- - - <
55
52
  - !ruby/object:Gem::Version
56
53
  version: '0.8'
57
54
  type: :runtime
@@ -60,9 +57,6 @@ dependencies:
60
57
  none: false
61
58
  requirements:
62
59
  - - ~>
63
- - !ruby/object:Gem::Version
64
- version: '0.6'
65
- - - <
66
60
  - !ruby/object:Gem::Version
67
61
  version: '0.8'
68
62
  - !ruby/object:Gem::Dependency
@@ -152,7 +146,7 @@ dependencies:
152
146
  requirements:
153
147
  - - ~>
154
148
  - !ruby/object:Gem::Version
155
- version: '2.4'
149
+ version: '3.0'
156
150
  type: :development
157
151
  prerelease: false
158
152
  version_requirements: !ruby/object:Gem::Requirement
@@ -160,7 +154,7 @@ dependencies:
160
154
  requirements:
161
155
  - - ~>
162
156
  - !ruby/object:Gem::Version
163
- version: '2.4'
157
+ version: '3.0'
164
158
  - !ruby/object:Gem::Dependency
165
159
  name: rb-inotify
166
160
  requirement: !ruby/object:Gem::Requirement