osm 1.2.23 → 1.2.24

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: 5a1c77bba99130c55b0574c0a890c685e99611c2
4
- data.tar.gz: 5b81b4165fbd1244ae170f310e5968aa5ffa76ad
3
+ metadata.gz: c000055060e9bf9c68a29ee0a70c9904f65a632d
4
+ data.tar.gz: b3ea3125f4a8e0cd3af8cd79f7adeaa8a2c497d9
5
5
  SHA512:
6
- metadata.gz: 996af429a7bc3cebae38f122bffc7b3201e16f61d55a54c4320f83ac1501023bb94ff87d23da474bdf92883828741fdf91b832dc82c01c89aed995eb9bf69631
7
- data.tar.gz: 087c903f06680b4216c16809dad00b3303b689814c6dc631a25d796154eaf48e39ea9c2a98f3e9cba364e3e1e81cad08e2517a6a94710b62488386c9975b0034
6
+ metadata.gz: 014a4e51a7e8ab1b2d85beeeeb58bfe440bcbeabdbe489d52b020b07620da2916f55aed25b5b2342a8b4db3a9ac6614e173f78c66e98d588d2f7ad8affc8a383
7
+ data.tar.gz: f559e2d25bbb91459322012301a61bdaf5e9a29d766727e94b8ee6db9343194b2312a74c83d25c6abe5607d57d61ce3ff2f3368e3f24877b708b78e18a9b79a6
@@ -1,3 +1,7 @@
1
+ ## Version 1.2.24
2
+
3
+ * Fix detection of no roles in api.get_user_roles!
4
+
1
5
  ## Version 1.2.23
2
6
 
3
7
  * Geting list of user roles for getting sections and permissions now done using the get_user_roles method of api instances
@@ -194,8 +194,12 @@ module Osm
194
194
 
195
195
  begin
196
196
  data = perform_query('api.php?action=getUserRoles')
197
- Osm::Model.cache_write(self, cache_key, data)
198
- return data
197
+ unless data.eql?(false)
198
+ # false equates to no roles
199
+ Osm::Model.cache_write(self, cache_key, data)
200
+ return data
201
+ end
202
+ fail Osm::NoActiveRoles, "You do not have any active roles in OSM."
199
203
 
200
204
  rescue Osm::Error => e
201
205
  if e.message.eql?('false')
@@ -84,7 +84,7 @@ describe "API" do
84
84
  end
85
85
 
86
86
  it "User has no roles in OSM" do
87
- @api.stub(:perform_query).with('api.php?action=getUserRoles'){ raise Osm::Error, 'false' }
87
+ @api.stub(:perform_query).with('api.php?action=getUserRoles'){ false }
88
88
  expect{ @api.get_user_roles! }.to raise_error(Osm::NoActiveRoles)
89
89
  @api.get_user_roles.should == []
90
90
  end
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Osm
2
- VERSION = "1.2.23"
2
+ VERSION = "1.2.24"
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.2.23
4
+ version: 1.2.24
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-04-20 00:00:00.000000000 Z
11
+ date: 2016-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport