gocardless 1.10.0 → 1.10.1
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/CHANGELOG.md +5 -0
- data/Rakefile +1 -1
- data/lib/gocardless/client.rb +14 -1
- data/lib/gocardless/version.rb +1 -1
- data/spec/client_spec.rb +23 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e22096b949c5df3105ed9060a58824e185fd993
|
4
|
+
data.tar.gz: 1cc708492608cf07feb13e391e11c6b1e9411925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5a4f60f99788d941ad2e0d5444fd3a83f9e26ffcb1e601fdc137de1b9c7a474f5101b183b83672180aae15bb9664393dbf5663234293defaef080c85299e099
|
7
|
+
data.tar.gz: 4e2e79bd303380b67722277a242f533887630d8f3cb9c4259a699c5da64d3aa24b48c9bd2c5ac18929c7facf97d87a3274aae65b2704d34e800e3871b585775b
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -43,7 +43,7 @@ def update_version_file(new_version)
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def bump_version(part)
|
46
|
-
last_version = `git tag -l | tail -1`.strip.sub(/^v/, '')
|
46
|
+
last_version = `git tag -l --sort=v:refname | tail -1`.strip.sub(/^v/, '')
|
47
47
|
major, minor, patch = last_version.scan(/\d+/).map(&:to_i)
|
48
48
|
|
49
49
|
case part
|
data/lib/gocardless/client.rb
CHANGED
@@ -313,6 +313,19 @@ module GoCardless
|
|
313
313
|
"#{base_url}#{API_PATH}"
|
314
314
|
end
|
315
315
|
|
316
|
+
def user_agent
|
317
|
+
@user_agent ||=
|
318
|
+
begin
|
319
|
+
gem_info = "gocardless-ruby/v#{GoCardless::VERSION}"
|
320
|
+
ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
|
321
|
+
ruby_version = RUBY_VERSION
|
322
|
+
ruby_version += " p#{RUBY_PATCHLEVEL}" if defined?(RUBY_PATCHLEVEL)
|
323
|
+
comment = ["#{ruby_engine} #{ruby_version}"]
|
324
|
+
comment << RUBY_PLATFORM if defined?(RUBY_PLATFORM)
|
325
|
+
"#{gem_info} (#{comment.join("; ")})"
|
326
|
+
end
|
327
|
+
end
|
328
|
+
|
316
329
|
private
|
317
330
|
|
318
331
|
# Pull the merchant id out of the access scope
|
@@ -332,7 +345,7 @@ module GoCardless
|
|
332
345
|
opts[:headers] = {} if opts[:headers].nil?
|
333
346
|
opts[:headers]['Accept'] = 'application/json'
|
334
347
|
opts[:headers]['Content-Type'] = 'application/json' unless method == :get
|
335
|
-
opts[:headers]['User-Agent'] =
|
348
|
+
opts[:headers]['User-Agent'] = user_agent
|
336
349
|
opts[:body] = MultiJson.encode(opts[:data]) if !opts[:data].nil?
|
337
350
|
|
338
351
|
# Reset the URL in case the environment / base URL has been changed.
|
data/lib/gocardless/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -512,5 +512,28 @@ describe GoCardless::Client do
|
|
512
512
|
@client.base_url.should == 'http://gc.com/'
|
513
513
|
end
|
514
514
|
end
|
515
|
+
|
516
|
+
describe "#user_agent" do
|
517
|
+
let(:user_agent) { @client.user_agent }
|
518
|
+
|
519
|
+
it "includes the gem name" do
|
520
|
+
expect(user_agent).to include("gocardless-ruby")
|
521
|
+
puts(user_agent)
|
522
|
+
end
|
523
|
+
|
524
|
+
it "includes the gem version" do
|
525
|
+
expect(user_agent).to include("v#{GoCardless::VERSION}")
|
526
|
+
end
|
527
|
+
|
528
|
+
it "includes the ruby version" do
|
529
|
+
expect(user_agent).to include(RUBY_VERSION)
|
530
|
+
end
|
531
|
+
|
532
|
+
if defined?(RUBY_PLATFORM)
|
533
|
+
it "includes the ruby platform" do
|
534
|
+
expect(user_agent).to include(RUBY_PLATFORM)
|
535
|
+
end
|
536
|
+
end
|
537
|
+
end
|
515
538
|
end
|
516
539
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gocardless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harry Marr
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth2
|