osm 1.3.2 → 1.3.3
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 +4 -4
- data/.travis.yml +29 -25
- data/CHANGELOG.md +4 -0
- data/lib/osm/section.rb +4 -3
- data/spec/array_of_validator_spec.rb +6 -6
- data/spec/hash_validator_spec.rb +6 -6
- data/spec/osm/section_spec.rb +2 -2
- data/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a7cefac5a329080926e39e4c7ea159140bdaf62
|
4
|
+
data.tar.gz: 4815f91adf15799318b1ac6152237bcc3ca1ab99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bfc9afd8c0883e8082634a2a74c9a0cf62aa029176e302047d0fde0a2f34496af97496272ea119f5fdd0f373bd8674fc15a973fa302c8d3ef4b13454f802ef4
|
7
|
+
data.tar.gz: eac2fefb23834d536a0426aa22b92b268e224f086af500e538b965d8aed7fbc04d8e5ea7299518952842773d11b47bf6b12ecf2dfdee62891c439718d789c839
|
data/.travis.yml
CHANGED
@@ -1,32 +1,36 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
3
|
+
- 1.9.3
|
4
|
+
- 2.0.0
|
5
|
+
- 2.2.1
|
6
|
+
- 2.2.2
|
7
|
+
- 2.2.3
|
8
|
+
- 2.2.4
|
9
|
+
- 2.2.5
|
10
|
+
- 2.2.6
|
11
|
+
- 2.2.7
|
12
|
+
- 2.2.8
|
13
|
+
- 2.2.9
|
14
|
+
- 2.3.0
|
15
|
+
- 2.3.1
|
16
|
+
- 2.3.2
|
17
|
+
- 2.3.3
|
18
|
+
- 2.3.4
|
19
|
+
- 2.3.5
|
20
|
+
- 2.3.6
|
21
|
+
- jruby-1.7.20.1
|
22
22
|
gemfile:
|
23
|
-
|
24
|
-
|
23
|
+
- Gemfile
|
24
|
+
- gemfiles/rails3
|
25
25
|
branches:
|
26
26
|
only:
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
- master
|
28
|
+
- staging
|
29
|
+
- "/gh(?:\\d)+(?:-.+)?/"
|
30
|
+
- "/dev_ver_\\d+\\.\\d+/"
|
31
31
|
before_install: gem update bundler
|
32
32
|
script: rake ci:travis
|
33
|
+
notifications:
|
34
|
+
slack:
|
35
|
+
on_success: always
|
36
|
+
secure: SIgV9OYZYskwEJfUJQBh+fDtaa0vIhSwMZZ6DfVu6EyrHh61NlTzPwf9n9uYT14VeQ9lMNWNDB2Gu7AI+HDQF8YbUZxfINR506BLuXYXkDiPPTWN61BP+UjC0v+w3fQrvGrLsvRPyQfBRwVqKrsavzX9ubxQbs2iosfX9K8I2Mo=
|
data/CHANGELOG.md
CHANGED
data/lib/osm/section.rb
CHANGED
@@ -269,8 +269,9 @@ module Osm
|
|
269
269
|
|
270
270
|
notepad = ''
|
271
271
|
notepads.each do |key, value|
|
272
|
-
|
273
|
-
notepad
|
272
|
+
raw_value = value.fetch('raw', '')
|
273
|
+
cache_write(api, ['notepad', key.to_i], raw_value)
|
274
|
+
notepad = raw_value if key.to_i == id
|
274
275
|
end
|
275
276
|
|
276
277
|
return notepad
|
@@ -282,7 +283,7 @@ module Osm
|
|
282
283
|
# @return [Boolean] whether the notepad was sucessfully updated
|
283
284
|
def set_notepad(api, content)
|
284
285
|
require_access_to_section(api, self)
|
285
|
-
data = api.perform_query("users.php?action=updateNotepad§ionid=#{id}", {'
|
286
|
+
data = api.perform_query("users.php?action=updateNotepad§ionid=#{id}", {'raw' => content})
|
286
287
|
|
287
288
|
if data.is_a?(Hash) && data['ok'] # Success
|
288
289
|
cache_write(api, ['notepad', id], content)
|
@@ -4,9 +4,9 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
module ArrayOfValidatorSpec
|
6
6
|
|
7
|
-
class
|
7
|
+
class IntegerTestModel < Osm::Model
|
8
8
|
attribute :array
|
9
|
-
validates :array, :array_of => {:item_type =>
|
9
|
+
validates :array, :array_of => {:item_type => Integer}
|
10
10
|
end
|
11
11
|
|
12
12
|
class TestItem
|
@@ -37,7 +37,7 @@ module ArrayOfValidatorSpec
|
|
37
37
|
describe "Array of validator" do
|
38
38
|
|
39
39
|
it "Allows an empty array" do
|
40
|
-
i =
|
40
|
+
i = IntegerTestModel.new(array: [])
|
41
41
|
i.valid?.should == true
|
42
42
|
i.errors.count.should == 0
|
43
43
|
end
|
@@ -45,16 +45,16 @@ module ArrayOfValidatorSpec
|
|
45
45
|
describe ":item_type option" do
|
46
46
|
|
47
47
|
it "Allows arrays of the right type" do
|
48
|
-
i =
|
48
|
+
i = IntegerTestModel.new(array: [1, 2, 3])
|
49
49
|
i.valid?.should == true
|
50
50
|
i.errors.count.should == 0
|
51
51
|
end
|
52
52
|
|
53
53
|
it "Forbids arrays containing >= 1 incorrect type" do
|
54
|
-
i =
|
54
|
+
i = IntegerTestModel.new(array: [1, '2', 3])
|
55
55
|
i.valid?.should == false
|
56
56
|
i.errors.count.should == 1
|
57
|
-
i.errors.messages.should == {:array=>["items in the Array must be a
|
57
|
+
i.errors.messages.should == {:array=>["items in the Array must be a Integer"]}
|
58
58
|
end
|
59
59
|
|
60
60
|
end
|
data/spec/hash_validator_spec.rb
CHANGED
@@ -6,7 +6,7 @@ module HashValidatorSpec
|
|
6
6
|
class KeyTypeTestModel
|
7
7
|
include ActiveAttr::Model
|
8
8
|
attribute :hash_attr
|
9
|
-
validates :hash_attr, :hash => {:key_type =>
|
9
|
+
validates :hash_attr, :hash => {:key_type => Integer}
|
10
10
|
end
|
11
11
|
|
12
12
|
class KeyInTestModel
|
@@ -18,7 +18,7 @@ module HashValidatorSpec
|
|
18
18
|
class ValueTypeTestModel
|
19
19
|
include ActiveAttr::Model
|
20
20
|
attribute :hash_attr
|
21
|
-
validates :hash_attr, :hash => {:value_type =>
|
21
|
+
validates :hash_attr, :hash => {:value_type => Integer}
|
22
22
|
end
|
23
23
|
|
24
24
|
class ValueInTestModel
|
@@ -43,14 +43,14 @@ module HashValidatorSpec
|
|
43
43
|
model = KeyTypeTestModel.new(hash_attr: {1=>'1', 2=>'2', '3'=>'3'})
|
44
44
|
model.valid?.should == false
|
45
45
|
model.errors.count.should == 1
|
46
|
-
model.errors.messages.should == {hash_attr: ['keys must be a
|
46
|
+
model.errors.messages.should == {hash_attr: ['keys must be a Integer ("3" is not).']}
|
47
47
|
end
|
48
48
|
|
49
49
|
it "Has several incorrect keys" do
|
50
50
|
model = KeyTypeTestModel.new(hash_attr: {1=>'1', 2=>'2', '3'=>'3', '4'=>'4'})
|
51
51
|
model.valid?.should == false
|
52
52
|
model.errors.count.should == 2
|
53
|
-
model.errors.messages.should == {hash_attr: ['keys must be a
|
53
|
+
model.errors.messages.should == {hash_attr: ['keys must be a Integer ("3" is not).', 'keys must be a Integer ("4" is not).']}
|
54
54
|
end
|
55
55
|
|
56
56
|
end
|
@@ -93,14 +93,14 @@ module HashValidatorSpec
|
|
93
93
|
model = ValueTypeTestModel.new(hash_attr: {'1'=>1, '2'=>2, '3'=>'3'})
|
94
94
|
model.valid?.should == false
|
95
95
|
model.errors.count.should == 1
|
96
|
-
model.errors.messages.should == {hash_attr: ['values must be a
|
96
|
+
model.errors.messages.should == {hash_attr: ['values must be a Integer ("3" for key "3" is not).']}
|
97
97
|
end
|
98
98
|
|
99
99
|
it "Has several incorrect keys" do
|
100
100
|
model = ValueTypeTestModel.new(hash_attr: {'1'=>1, '2'=>2, '3'=>'3', '4'=>'4'})
|
101
101
|
model.valid?.should == false
|
102
102
|
model.errors.count.should == 2
|
103
|
-
model.errors.messages.should == {hash_attr: ['values must be a
|
103
|
+
model.errors.messages.should == {hash_attr: ['values must be a Integer ("3" for key "3" is not).', 'values must be a Integer ("4" for key "4" is not).']}
|
104
104
|
end
|
105
105
|
|
106
106
|
end
|
data/spec/osm/section_spec.rb
CHANGED
@@ -167,7 +167,7 @@ describe "Section" do
|
|
167
167
|
'userid' => 'user_id',
|
168
168
|
'secret' => 'secret',
|
169
169
|
}
|
170
|
-
HTTParty.should_receive(:post).with(url, {:body => post_data}) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>{"1" => "Section 1", "2" => "Section 2"}.to_json}) }
|
170
|
+
HTTParty.should_receive(:post).with(url, {:body => post_data}) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>{"1" => {"raw" => "Section 1", "html" => "<p>Section 1</p>"}, "2" => {"raw" => "Section 2", "html" => "<p>Section 2</p>"}}.to_json}) }
|
171
171
|
section = Osm::Section.new(:id => 1)
|
172
172
|
section.get_notepad(@api).should == 'Section 1'
|
173
173
|
end
|
@@ -179,7 +179,7 @@ describe "Section" do
|
|
179
179
|
'token' => @CONFIGURATION[:api][:osm][:token],
|
180
180
|
'userid' => 'user_id',
|
181
181
|
'secret' => 'secret',
|
182
|
-
'
|
182
|
+
'raw' => 'content'
|
183
183
|
}
|
184
184
|
HTTParty.should_receive(:post).with(url, {:body => post_data}) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>'{"ok":true}'}) }
|
185
185
|
section = Osm::Section.new(:id => 1)
|
data/version.rb
CHANGED
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.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Gauld
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -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.6.14
|
310
|
+
rubygems_version: 2.6.14.1
|
311
311
|
signing_key:
|
312
312
|
specification_version: 4
|
313
313
|
summary: Use the Online Scout Manager API
|