osm 1.2.19 → 1.2.20

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
5
  - 2.2.1
6
+ - jruby-1.7.20.1
6
7
  gemfile:
7
8
  - Gemfile
8
9
  - gemfiles/rails3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 1.2.20
2
+
3
+ * Fix to OSM changing the URL to get API permissions from
4
+
1
5
  ## Version 1.2.19
2
6
 
3
7
  * Fix validity checks for member in rails 3
data/README.md CHANGED
@@ -29,6 +29,8 @@ This gem supports the following versions of ruby, it may work on other versions
29
29
 
30
30
  * 1.9.3
31
31
  * 2.0.0
32
+ * 2.2.1
33
+ * jruby-1.7.20.1
32
34
 
33
35
 
34
36
  ## OSM
@@ -37,7 +37,7 @@ module Osm
37
37
  return get_from_ids(api, ids, cache_key, section, options, :get_all)
38
38
  end
39
39
 
40
- data = api.perform_query("users.php?action=getAPIAccess&sectionid=#{section_id}")
40
+ data = api.perform_query("ext/settings/access/?action=getAPIAccess&sectionid=#{section_id}")
41
41
 
42
42
  permissions_map = {
43
43
  10 => [:read],
data/lib/osm/section.rb CHANGED
@@ -379,13 +379,10 @@ module Osm
379
379
 
380
380
  # Compare Section based on group_name type (age order), then name
381
381
  def <=>(another)
382
+ type_order = [:beavers, :cubs, :scouts, :explorers, :network, :adults, :waiting]
382
383
  result = self.group_name <=> another.try(:group_name)
383
- result = 0 if self.type == another.try(:type) && result == 0
384
- [:beavers, :cubs, :scouts, :explorers, :network, :adults, :waiting].each do |type|
385
- if result == 0
386
- result = -1 if self.type == type
387
- result = 1 if another.try(:type) == type
388
- end
384
+ if result == 0
385
+ result = type_order.find_index(self.type) <=> type_order.find_index(another.try(:type))
389
386
  end
390
387
  result = self.name <=> another.try(:name) if result == 0
391
388
  return result
@@ -43,7 +43,7 @@ describe "API Access" do
43
43
  }
44
44
  ]
45
45
  }
46
- FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/users.php?action=getAPIAccess&sectionid=1", :body => body.to_json, :content_type => 'application/json')
46
+ FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/ext/settings/access/?action=getAPIAccess&sectionid=1", :body => body.to_json, :content_type => 'application/json')
47
47
  end
48
48
 
49
49
  describe "Get All" do
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Osm
2
- VERSION = "1.2.19"
2
+ VERSION = "1.2.20"
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.2.19
4
+ version: 1.2.20
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: 2015-07-01 00:00:00.000000000 Z
12
+ date: 2015-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport