osm 1.3.0 → 1.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 651a0cdcdd3d694935cd01e1500494bf8cd4c7cf
4
- data.tar.gz: 3e28fa840b8b180292c469f068f6667c01f9bbc9
3
+ metadata.gz: 67e1f0345412482f0042df2e2c01cfcfcf3b4898
4
+ data.tar.gz: bc3cdb62a5cc7f084c4c47d299ea075a6651456f
5
5
  SHA512:
6
- metadata.gz: 6a31dd0a2da75b15f7c53fb2346e238d0044c3ecca6f04ad14c49bd06818f856987d185474f88a016b76f5df76e889e10464012ace57829bad3d6e049cf8c617
7
- data.tar.gz: 0bf8a3ac116819ddda8b030c5caad9b6e77896be6b0e9d075ff92905bc82fda39c536d9ca215d58e221a1e40e9e5bbbba830feaff57abda82488c8e84d4f934b
6
+ metadata.gz: 439ce355dcb274fca820926190d6cb82d2f32296ceeb038784e10ed674db4661ce0fff618f99ad108bacdd30e31ce6ed65e1dd47737ac77fcd625284482e7dda
7
+ data.tar.gz: 68a847aea26f457ce6625e40d6acbd11256a3291b1447fc00735cfc6927e14d675343939cfd0d2e36fe2c0ed2d39047df33ec664e18797c7ba27072bbb4e253c
@@ -1,3 +1,9 @@
1
+ ## Version 1.3.1
2
+
3
+ * Fix "undefined method '<=' for nil:NilClass" when testing if member is current
4
+ * Update httparty gem (CVE 2013-1801)
5
+
6
+
1
7
  ## Version 1.3.0
2
8
 
3
9
  * Add fetching of file names for events (unable to download)
data/Guardfile CHANGED
@@ -1,7 +1,7 @@
1
1
  # A sample Guardfile
2
2
  # More info at https://github.com/guard/guard#readme
3
3
 
4
- guard 'rspec', all_on_start: true, all_after_pass: true do
4
+ guard 'rspec', all_on_start: true, all_after_pass: true, cmd: 'bundle exec rspec' do
5
5
  watch(%r{^spec/.+_spec\.rb$})
6
6
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
7
7
  watch(%r{^lib/([^/]+)/(.+)\.rb$}) { |m| "spec/#{m[1]}/#{m[2]}_spec.rb" }
@@ -452,13 +452,16 @@ module Osm
452
452
  end
453
453
 
454
454
  # Check if this is a current member of the section they were retrieved for
455
- # @param [Date] date The date to check membership status for
456
- # @return [Boolean]
455
+ # @param date [Date] The date to check membership status for
456
+ # @return true, false
457
457
  def current?(date=Date.today)
458
+ return nil if started_section.nil? and finished_section.nil?
458
459
  if finished_section.nil?
459
- return (started_section <= date)
460
+ started_section <= date
461
+ elsif started_section.nil?
462
+ finished_section >= date
460
463
  else
461
- return (started_section <= date) && (finished_section >= date)
464
+ (started_section <= date) && (finished_section >= date)
462
465
  end
463
466
  end
464
467
 
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.require_paths = ["lib"]
21
21
 
22
22
  s.add_runtime_dependency 'activesupport', '>= 3.2', '< 5' # Used to parse JSON from OSM
23
- s.add_runtime_dependency 'httparty', '~> 0.9' # Used to make web requests to the API
23
+ s.add_runtime_dependency 'httparty', '~> 0.10' # Used to make web requests to the API
24
24
  s.add_runtime_dependency 'active_attr', '~> 0.8'
25
25
  s.add_runtime_dependency 'activemodel', '>= 3.2', '< 5'
26
26
  s.add_runtime_dependency 'dirty_hashy', '~> 0.2.1' # Used to track changed data in Badge::Data and FlexiRecord::Data
@@ -112,28 +112,52 @@ describe "Member" do
112
112
  end
113
113
 
114
114
 
115
- describe "Tells if the member is currently in the section" do
116
- it "Today" do
117
- Osm::Member.new(started_section: Date.yesterday).current?.should == true
118
- Osm::Member.new(started_section: Date.today).current?.should == true
119
- Osm::Member.new(started_section: Date.tomorrow).current?.should == false
120
- Osm::Member.new(started_section: Date.yesterday, finished_section: Date.yesterday).current?.should == false
121
- Osm::Member.new(started_section: Date.yesterday, finished_section: Date.today).current?.should == true
122
- Osm::Member.new(started_section: Date.yesterday, finished_section: Date.tomorrow).current?.should == true
115
+ describe 'Tells if the member is currently in the section' do
116
+ context 'Using the current date' do
117
+ it 'Has a started_section and a finished_section date' do
118
+ expect(Osm::Member.new(started_section: Date.yesterday, finished_section: Date.yesterday).current?).to eq(false)
119
+ expect(Osm::Member.new(started_section: Date.yesterday, finished_section: Date.today).current?).to eq(true)
120
+ expect(Osm::Member.new(started_section: Date.yesterday, finished_section: Date.tomorrow).current?).to eq(true)
121
+ end
122
+ it 'Only has a started_section date' do
123
+ expect(Osm::Member.new(started_section: Date.yesterday).current?).to eq(true)
124
+ expect(Osm::Member.new(started_section: Date.today).current?).to eq(true)
125
+ expect(Osm::Member.new(started_section: Date.tomorrow).current?).to eq(false)
126
+ end
127
+ it 'Only has a finished_section date' do
128
+ expect(Osm::Member.new(finished_section: Date.yesterday).current?).to eq(false)
129
+ expect(Osm::Member.new(finished_section: Date.today).current?).to eq(true)
130
+ expect(Osm::Member.new(finished_section: Date.tomorrow).current?).to eq(true)
131
+ end
132
+ it 'Has neither a started_section or finished_section date' do
133
+ expect(Osm::Member.new().current?).to be_nil
134
+ end
123
135
  end
124
136
 
125
- it "Another date" do
126
- yesterday = Date.new(2014, 10, 15)
127
- today = Date.new(2014, 10, 16)
128
- tomorrow = Date.new(2014, 10, 17)
129
- Osm::Member.new(started_section: yesterday).current?(today).should == true
130
- Osm::Member.new(started_section: today).current?(today).should == true
131
- Osm::Member.new(started_section: tomorrow).current?(today).should == false
132
- Osm::Member.new(started_section: yesterday, finished_section: yesterday).current?(today).should == false
133
- Osm::Member.new(started_section: yesterday, finished_section: today).current?(today).should == true
134
- Osm::Member.new(started_section: yesterday, finished_section: tomorrow).current?(today).should == true
135
- end
136
- end
137
+ context 'Using another date' do
138
+ let(:yesterday) { Date.new(2014, 10, 15) }
139
+ let(:today) { Date.new(2014, 10, 16) }
140
+ let(:tomorrow) { Date.new(2014, 10, 17) }
141
+ it 'Has a started_section and a finished_section date' do
142
+ expect(Osm::Member.new(started_section: yesterday, finished_section: yesterday).current?(today)).to eq(false)
143
+ expect(Osm::Member.new(started_section: yesterday, finished_section: today).current?(today)).to eq(true)
144
+ expect(Osm::Member.new(started_section: yesterday, finished_section: tomorrow).current?(today)).to eq(true)
145
+ end
146
+ it 'Only has a started_section date' do
147
+ expect(Osm::Member.new(started_section: yesterday).current?(today)).to eq(true)
148
+ expect(Osm::Member.new(started_section: today).current?(today)).to eq(true)
149
+ expect(Osm::Member.new(started_section: tomorrow).current?(today)).to eq(false)
150
+ end
151
+ it 'Only has a finished_section date' do
152
+ expect(Osm::Member.new(finished_section: yesterday).current?(today)).to eq(false)
153
+ expect(Osm::Member.new(finished_section: today).current?(today)).to eq(true)
154
+ expect(Osm::Member.new(finished_section: tomorrow).current?(today)).to eq(true)
155
+ end
156
+ it 'Has neither a started_section or finished_section date' do
157
+ expect(Osm::Member.new().current?(today)).to be_nil
158
+ end
159
+ end # context Using another date
160
+ end # describe Tells if the member is currently in the section
137
161
 
138
162
 
139
163
  it "Sorts by section_id, grouping_id, grouping_leader (descending), last_name then first_name" do
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Osm
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Gauld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-02 00:00:00.000000000 Z
11
+ date: 2017-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.9'
39
+ version: '0.10'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.9'
46
+ version: '0.10'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: active_attr
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -307,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
307
  version: '0'
308
308
  requirements: []
309
309
  rubyforge_project: osm
310
- rubygems_version: 2.5.1
310
+ rubygems_version: 2.6.13
311
311
  signing_key:
312
312
  specification_version: 4
313
313
  summary: Use the Online Scout Manager API