uploadcare-ruby 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ad96fa0d1ad6cea7d89b3b1bab8c78b9cf065491
4
- data.tar.gz: 34783372b519d4b381b915ddcfe95a0e379d69ab
2
+ SHA256:
3
+ metadata.gz: 9363abb3c073881cc706fb59bc0b3d3b537a5db0fc53f4a186a726873bf622a6
4
+ data.tar.gz: ebdda4fafed6775f6904a9b4e1737241234d244ed42bed8c00a9fe1368d32027
5
5
  SHA512:
6
- metadata.gz: 9336a0ae85297a8e41ad81de42438f4590bb5a08aa0fb1766cbc2d48a09df260a2f38f63174b7549f9fad00961306bf38fa29fb69503fe75d79a394f1ef3520b
7
- data.tar.gz: 7d1caa97fdd3126394ddfa57dfed635ecd4b7c564331e5e92b072b8425d72a4f4a40a1ab2c592e00fd733aa7430733fd0e3d973fb3b404866e11da0d448b65c3
6
+ metadata.gz: 9065fb7d524d457237d6ed507c405e4c83c8fb0de0f9a194dd259b35726353c6ea3dd96c23fd26f4a968784108cc6d8b2c6c593fb487345465e77c6b7960d9fb
7
+ data.tar.gz: f265a7b3fbcd3fcf716019edd99668b9b763463feaf46aeecc69accbe81bd5585b24ab6a31592fc8badac78c109228271ab95862ff811044beb4585d7c75e9c7
@@ -4,6 +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
+ ### [1.2.2] - 2018-06-11
8
+
9
+ ### Fixed
10
+ - Show Uploadcare::USER_AGENT deprecation warning only when the constant is being used
7
11
 
8
12
  ### [1.2.1] - 2018-05-24
9
13
 
@@ -17,10 +17,6 @@ module Uploadcare
17
17
  auth_scheme: :secure
18
18
  }
19
19
 
20
- warn '[DEPRECATION] `Uploadcare::USER_AGENT` constant is deprecated and will be removed in version 3.0'
21
- USER_AGENT = "uploadcare-ruby/#{Gem.ruby_version}/#{Uploadcare::VERSION}"
22
-
23
-
24
20
  def self.default_settings
25
21
  DEFAULT_SETTINGS
26
22
  end
@@ -29,4 +25,13 @@ module Uploadcare
29
25
  warn '[DEPRECATION] `Uploadcare::user_agent` method is deprecated and will be removed in version 3.0'
30
26
  UserAgent.new.call(options)
31
27
  end
28
+
29
+ def self.const_missing(name)
30
+ if name == :USER_AGENT
31
+ warn '[DEPRECATION] `Uploadcare::USER_AGENT` constant is deprecated and will be removed in version 3.0'
32
+ "uploadcare-ruby/#{Gem.ruby_version}/#{Uploadcare::VERSION}"
33
+ else
34
+ super
35
+ end
36
+ end
32
37
  end
@@ -1,3 +1,3 @@
1
1
  module Uploadcare
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
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: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - "@rastyagaev (Vadim Rastyagaev)"
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-05-24 00:00:00.000000000 Z
13
+ date: 2018-06-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  version: '0'
197
197
  requirements: []
198
198
  rubyforge_project:
199
- rubygems_version: 2.5.2
199
+ rubygems_version: 2.7.7
200
200
  signing_key:
201
201
  specification_version: 4
202
202
  summary: Ruby gem for Uploadcare