uploadcare-ruby 2.1.1 → 2.1.2

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
- SHA1:
3
- metadata.gz: a91d6bc58cb4485cc93ff080fa5f66040b6ab0f0
4
- data.tar.gz: ae95eb7e6d60828a91883c1c481e7a469d49702a
2
+ SHA256:
3
+ metadata.gz: 228937684b8d8c141f9e9d9333b938631f3d8a581164d119925815dad392c6e7
4
+ data.tar.gz: 3bcd8e452aa580499afcd736beb03fb1c6eb8a91e0ea1d17759f2947ac925292
5
5
  SHA512:
6
- metadata.gz: e3b503ac19459939ec38af251f322c3804dec77546deeeba3d192757927a2cf4eef04d4f2b2ac2265efc42e42233f54d0f2fe66d2dcd29ced6ab18c65f6432c8
7
- data.tar.gz: c08f3fb47d507b520c0859ee268ce8926b014fa7895b3a288f881586e857724a825f075899827f07a02c33228c790a26848728294cd5b8add0e323c14c49502f
6
+ metadata.gz: c0d81628907eb8d0c8db49d63c23b1a4c4049eae305536a21cb553a057b2efda95659232ddb67467749b9e24708068f8e3564987eeca6c398be56446ea462542
7
+ data.tar.gz: 838ff37a6ecdbb783fb9677694fc28985ec83054dabaf10a3c932de5aab22d8129612ebdaa6a13dbdba5d8c624fe601a4f6e679763c7c5a30ae345707d378dcb
@@ -4,8 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based now on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [Unreleased] - FIXME
7
+ ## [2.1.2] - 2018-06-11
8
8
 
9
+ ### Fixed
10
+ - Show Uploadcare::USER_AGENT deprecation warning only when the constant is being used
9
11
 
10
12
  ## [2.1.1] - 2018-05-24
11
13
 
@@ -28,6 +30,14 @@ There are **breaking** changes in this release, please read [upgrade notes](UPGR
28
30
  - All POST/PUT/DELETE params are now being sent as JSON instead of being form-encoded
29
31
  - Pagination implementation for files and groups
30
32
 
33
+
34
+ ### [1.2.1] - 2018-05-24
35
+
36
+ ### Changed
37
+ - Allow user to override User-Agent header
38
+ - User-Agent format reports gem name, version and environment
39
+
40
+
31
41
  ## 1.1.0 - 2017-03-21
32
42
 
33
43
  ### Added
@@ -51,4 +61,5 @@ There are **breaking** changes in this release, please read [upgrade notes](UPGR
51
61
 
52
62
 
53
63
  [Unreleased]: https://github.com/uploadcare/uploadcare-ruby/compare/v2.1.1...HEAD
54
- [2.1.1]: https://github.com/uploadcare/uploadcare-ruby/compare/v2.0.0...v2.1.1
64
+ [2.1.1]: https://github.com/uploadcare/uploadcare-ruby/compare/v2.0.0...v2.1.1
65
+ [1.2.1]: https://github.com/uploadcare/uploadcare-ruby/compare/6dde...v1.2.1
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [![Coverage Status][coverals-img]][coverals]
3
3
  [![Uploadcare stack on StackShare][stack-img]][stack]
4
4
 
5
- [travis-img]: https://secure.travis-ci.org/uploadcare/uploadcare-ruby.png?branch=master
5
+ [travis-img]: https://secure.travis-ci.org/uploadcare/uploadcare-ruby.svg?branch=master
6
6
  [travis]: http://travis-ci.org/uploadcare/uploadcare-ruby
7
7
  [coverals-img]: https://coveralls.io/repos/github/uploadcare/uploadcare-ruby/badge.svg?branch=master
8
8
  [coverals]: https://coveralls.io/github/uploadcare/uploadcare-ruby?branch=master
@@ -18,9 +18,6 @@ module Uploadcare
18
18
  auth_scheme: :secure,
19
19
  }
20
20
 
21
- warn '[DEPRECATION] `Uploadcare::USER_AGENT` constant is deprecated and will be removed in version 3.0'
22
- USER_AGENT = "uploadcare-ruby/#{Gem.ruby_version}/#{Uploadcare::VERSION}"
23
-
24
21
  def self.default_settings
25
22
  DEFAULT_SETTINGS
26
23
  end
@@ -29,4 +26,13 @@ module Uploadcare
29
26
  warn '[DEPRECATION] `Uploadcare::user_agent` method is deprecated and will be removed in version 3.0'
30
27
  UserAgent.new.call(options)
31
28
  end
29
+
30
+ def self.const_missing(name)
31
+ if name == :USER_AGENT
32
+ warn '[DEPRECATION] `Uploadcare::USER_AGENT` constant is deprecated and will be removed in version 3.0'
33
+ "uploadcare-ruby/#{Gem.ruby_version}/#{Uploadcare::VERSION}"
34
+ else
35
+ super
36
+ end
37
+ end
32
38
  end
@@ -1,3 +1,3 @@
1
1
  module Uploadcare
2
- VERSION = '2.1.1'.freeze
2
+ VERSION = '2.1.2'.freeze
3
3
  end
@@ -1,6 +1,15 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Uploadcare do
4
+ around do |example|
5
+ orig_stderr = $stderr
6
+ $stderr = StringIO.new
7
+
8
+ example.call
9
+
10
+ $stderr = orig_stderr
11
+ end
12
+
4
13
  describe '::user_agent' do
5
14
  subject(:user_agent) { described_class.user_agent(options) }
6
15
  let(:options) { {user_agent: 'user/agent'} }
@@ -12,5 +21,23 @@ describe Uploadcare do
12
21
 
13
22
  expect(user_agent).to eq('user/agent')
14
23
  end
24
+
25
+ it 'is deprecated' do
26
+ user_agent
27
+
28
+ $stderr.rewind
29
+ expect($stderr.string).to start_with('[DEPRECATION] `Uploadcare::user_agent`')
30
+ end
31
+ end
32
+
33
+ describe '::USER_AGENT' do
34
+ it { expect(described_class::USER_AGENT).not_to be_nil }
35
+
36
+ it 'is deprecated' do
37
+ described_class::USER_AGENT
38
+
39
+ $stderr.rewind
40
+ expect($stderr.string).to start_with('[DEPRECATION] `Uploadcare::USER_AGENT`')
41
+ end
15
42
  end
16
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uploadcare-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - "@rastyagaev (Vadim Rastyagaev)"
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-05-24 00:00:00.000000000 Z
14
+ date: 2018-06-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  version: '0'
224
224
  requirements: []
225
225
  rubyforge_project:
226
- rubygems_version: 2.5.2
226
+ rubygems_version: 2.7.7
227
227
  signing_key:
228
228
  specification_version: 4
229
229
  summary: Ruby gem for Uploadcare