maremma 3.5.11 → 3.6

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: 5b8f969f78c26a475d372166a81ea6736ae1f5db
4
- data.tar.gz: 27a1989d26df74d78895a3a623593dac983c5526
3
+ metadata.gz: 64c7b8e828375f7fab850b6701b489c9a173ebc3
4
+ data.tar.gz: f3e6c5bf75e6ed1c27eae86a428aa1f44cf2f5f3
5
5
  SHA512:
6
- metadata.gz: f5fde5cd1213b310cc4aab9f5d6f08b1e687c3d2ee3ae435e484247a972b7fc5003b500c8dcc7c6a54e9b8b5d6c44a897207092e6d6b5bcac64ffdff7ecc2220
7
- data.tar.gz: c3a59bd63c74e9eb65bf7a12cfacd8e78fff9fa2f18d461a14fca59f306b84d01514c6e6532b3ccff6872a9da7b268f44876930b65df8524541c0962e578add0
6
+ metadata.gz: c4453d002050d51af43304e691f4132d14397565960c6b740ed691607666273aa0e3abb6ae1cdb61bd863ef3f0e69f9ec607107b320dd4e970d2bf1a505fb1ef
7
+ data.tar.gz: dacd09e525ea2cbdbee7a351b60f841fd54340f3bde663d653af062699244457939e1ad5ad91587ba1623a519bb72daf42ab0ca8f47d5fcf9b0d7be367fa1ba6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v.3.6 (October 14, 2017)
2
+
3
+ [maremma 3.6](https://github.com/datacite/maremma/releases/tag/v.3.6) was released on October 14, 2017:
4
+
5
+ * added support for `patch` verb
6
+
1
7
  ## v.3.5 (February 14, 2017)
2
8
 
3
9
  [maremma 3.5](https://github.com/datacite/maremma/releases/tag/v.3.5) was released on February 14, 2017:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maremma (3.5.11)
4
+ maremma (3.6)
5
5
  activesupport (>= 4.2.5, < 6)
6
6
  addressable (>= 2.3.6)
7
7
  builder (~> 3.2, >= 3.2.2)
@@ -16,13 +16,13 @@ PATH
16
16
  GEM
17
17
  remote: https://rubygems.org/
18
18
  specs:
19
- activesupport (5.1.3)
19
+ activesupport (5.1.4)
20
20
  concurrent-ruby (~> 1.0, >= 1.0.2)
21
21
  i18n (~> 0.7)
22
22
  minitest (~> 5.1)
23
23
  tzinfo (~> 1.1)
24
- addressable (2.5.1)
25
- public_suffix (~> 2.0, >= 2.0.2)
24
+ addressable (2.5.2)
25
+ public_suffix (>= 2.0.2, < 4.0)
26
26
  builder (3.2.3)
27
27
  codeclimate-test-reporter (1.0.8)
28
28
  simplecov (<= 0.13)
@@ -38,21 +38,21 @@ GEM
38
38
  faraday
39
39
  faraday_middleware (0.10.1)
40
40
  faraday (>= 0.7.4, < 1.0)
41
- hashdiff (0.3.5)
41
+ hashdiff (0.3.7)
42
42
  i18n (0.8.6)
43
43
  json (2.1.0)
44
- mini_portile2 (2.2.0)
44
+ mini_portile2 (2.3.0)
45
45
  minitest (5.10.3)
46
- multi_json (1.12.1)
46
+ multi_json (1.12.2)
47
47
  multipart-post (2.0.0)
48
- nokogiri (1.8.0)
49
- mini_portile2 (~> 2.2.0)
50
- oj (3.3.4)
51
- public_suffix (2.0.5)
48
+ nokogiri (1.8.1)
49
+ mini_portile2 (~> 2.3.0)
50
+ oj (3.3.8)
51
+ public_suffix (3.0.0)
52
52
  rack (2.0.3)
53
53
  rack-test (0.7.0)
54
54
  rack (>= 1.0, < 3)
55
- rake (12.0.0)
55
+ rake (12.1.0)
56
56
  rspec (3.6.0)
57
57
  rspec-core (~> 3.6.0)
58
58
  rspec-expectations (~> 3.6.0)
@@ -71,12 +71,12 @@ GEM
71
71
  docile (~> 1.1.0)
72
72
  json (>= 1.8, < 3)
73
73
  simplecov-html (~> 0.10.0)
74
- simplecov-html (0.10.1)
74
+ simplecov-html (0.10.2)
75
75
  thread_safe (0.3.6)
76
76
  tzinfo (1.2.3)
77
77
  thread_safe (~> 0.1)
78
78
  vcr (3.0.3)
79
- webmock (3.0.1)
79
+ webmock (3.1.0)
80
80
  addressable (>= 2.3.6)
81
81
  crack (>= 0.3.2)
82
82
  hashdiff
data/lib/maremma.rb CHANGED
@@ -29,6 +29,10 @@ module Maremma
29
29
  self.method(url, options.merge(method: "put"))
30
30
  end
31
31
 
32
+ def self.patch(url, options={})
33
+ self.method(url, options.merge(method: "patch"))
34
+ end
35
+
32
36
  def self.delete(url, options={})
33
37
  self.method(url, options.merge(method: "delete"))
34
38
  end
@@ -55,6 +59,7 @@ module Maremma
55
59
  when "get" then conn.get url, {}, options[:headers]
56
60
  when "post" then conn.post url, {}, options[:headers] { |request| request.body = options[:data] }
57
61
  when "put" then conn.put url, {}, options[:headers] { |request| request.body = options[:data] }
62
+ when "patch" then conn.patch url, {}, options[:headers] { |request| request.body = options[:data] }
58
63
  when "delete" then conn.delete url, {}, options[:headers]
59
64
  when "head" then conn.head url, {}, options[:headers]
60
65
  end
@@ -1,3 +1,3 @@
1
1
  module Maremma
2
- VERSION = "3.5.11"
2
+ VERSION = "3.6"
3
3
  end
data/spec/maremma_spec.rb CHANGED
@@ -106,6 +106,20 @@ describe Maremma do
106
106
  end
107
107
  end
108
108
 
109
+ context "patch" do
110
+ it "patch json" do
111
+ stub = stub_request(:patch, url).with(:body => post_data.to_json).to_return(:body => data.to_json, :status => 200, :headers => { "Content-Type" => "application/json" })
112
+ subject.patch(url, content_type: 'json', data: post_data.to_json) { |response| expect(JSON.parse(response.body.to_s)).to eq(data) }
113
+ expect(stub).to have_been_requested
114
+ end
115
+
116
+ it "patch xml" do
117
+ stub = stub_request(:patch, url).with(:body => post_data.to_xml).to_return(:body => data.to_xml, :status => 200, :headers => { "Content-Type" => "text/html" })
118
+ subject.patch(url, content_type: 'xml', data: post_data.to_xml) { |response| expect(Hash.from_xml(response.body.to_s)["hash"]).to eq(data) }
119
+ expect(stub).to have_been_requested
120
+ end
121
+ end
122
+
109
123
  context "empty response" do
110
124
  it "get json" do
111
125
  stub = stub_request(:get, url).to_return(:body => nil, :status => 200, :headers => { "Content-Type" => "application/json" })
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maremma
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.11
4
+ version: '3.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-10 00:00:00.000000000 Z
11
+ date: 2017-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -342,7 +342,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
342
342
  version: '0'
343
343
  requirements: []
344
344
  rubyforge_project:
345
- rubygems_version: 2.4.5
345
+ rubygems_version: 2.6.14
346
346
  signing_key:
347
347
  specification_version: 4
348
348
  summary: Simplified network calls