bitflyer 1.0.0 → 1.0.1

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
2
  SHA256:
3
- metadata.gz: e017b1fb5befa1653ab22b3333a94e9d59e2168ea7f0d5dd58acdcb143dd3eea
4
- data.tar.gz: d06a630e375806601b5cdc0d1d23f0c5d5574bc847d23e5156092e20f101baab
3
+ metadata.gz: 3b414a7e2a6dd054ca0aff1d217dc8c8e712f8969daa03d91dbf795e33111e94
4
+ data.tar.gz: cb365b45701c9a23bf6d6f7b4818f04e6eeef1e709909802feca8d62779cb7f1
5
5
  SHA512:
6
- metadata.gz: 58f8ca8dfe138dd4d0d6a22883bca134ef94f6abef0474f6e3a30dc9c4ae1a123cdd88a67a32daa6b940e814872535f8140472683ac6b8ccf9dcb98f2f3d573a
7
- data.tar.gz: 675d662fe2f2667c3d733a82a04af407891132d5afd31fadd43a10c95f32d36a65fde231fb45297e5122aba1341c1e4677e2511faf4d44a664aa39e33f7b8369
6
+ metadata.gz: 66beabfdb8ba7893f44b16c41a6371b6eb0cfd131138055d6d72a02ac90af17ffa450a155c4dac0f19433705228319714111464af07159e56c7f0bd08f456b0e
7
+ data.tar.gz: 56ac4fe5e16694a3c4d2b4049c4fefa9b1fa7a9412133ce9c5596d9ec53dd664ccd5d155af54df3645cfab655f790105b62c18c3e73e562bd44e481f68a687d6
@@ -1,5 +1,10 @@
1
1
  version: 2.1
2
2
 
3
+ update_bundler: &update_bundler
4
+ run:
5
+ name: update bundler
6
+ command: gem update bundler
7
+
3
8
  bundle_install: &bundle_install
4
9
  run:
5
10
  name: bundle install
@@ -16,6 +21,7 @@ jobs:
16
21
  steps:
17
22
  - checkout
18
23
  - *restore_bundle_cache
24
+ - *update_bundler
19
25
  - *bundle_install
20
26
  - save_cache:
21
27
  key: cache-bundler-{{ checksum "Gemfile.lock" }}
@@ -27,6 +33,7 @@ jobs:
27
33
  steps:
28
34
  - checkout
29
35
  - *restore_bundle_cache
36
+ - *update_bundler
30
37
  - *bundle_install
31
38
  - run: bundle exec rubocop
32
39
  rspec:
@@ -35,6 +42,7 @@ jobs:
35
42
  steps:
36
43
  - checkout
37
44
  - *restore_bundle_cache
45
+ - *update_bundler
38
46
  - *bundle_install
39
47
  - run: bundle exec rspec
40
48
  workflows:
@@ -1,6 +1,7 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
+ NewCops: enable
4
5
  Include:
5
6
  - 'lib/**/*.rb'
6
7
  Style/Documentation:
@@ -1,26 +1,23 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-07-08 01:59:32 +0900 using RuboCop version 0.72.0.
3
+ # on 2020-08-08 12:17:16 UTC using RuboCop version 0.89.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 3
9
+ # Offense count: 2
10
+ # Configuration parameters: IgnoredMethods.
10
11
  Metrics/AbcSize:
11
- Max: 29
12
+ Max: 32
12
13
 
13
14
  # Offense count: 2
14
- # Configuration parameters: CountComments.
15
+ # Configuration parameters: CountComments, CountAsOne.
15
16
  Metrics/ClassLength:
16
- Max: 150
17
-
18
- # Offense count: 1
19
- Metrics/CyclomaticComplexity:
20
- Max: 7
17
+ Max: 146
21
18
 
22
19
  # Offense count: 2
23
- # Configuration parameters: CountComments, ExcludedMethods.
20
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
24
21
  Metrics/MethodLength:
25
22
  Max: 20
26
23
 
@@ -28,3 +25,11 @@ Metrics/MethodLength:
28
25
  # Configuration parameters: CountKeywordArgs.
29
26
  Metrics/ParameterLists:
30
27
  Max: 7
28
+
29
+ # Offense count: 1
30
+ # Cop supports --auto-correct.
31
+ # Configuration parameters: EnforcedStyle.
32
+ # SupportedStyles: always, always_true, never
33
+ Style/FrozenStringLiteralComment:
34
+ Exclude:
35
+ - 'bin/console'
@@ -1,55 +1,62 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bitflyer (1.0.0)
5
- faraday (~> 0.14.0)
6
- faraday_middleware (~> 0.12.0)
4
+ bitflyer (1.0.1)
5
+ faraday (>= 0.14, < 1.2)
6
+ faraday_middleware (>= 0.12, < 1.1)
7
7
  websocket-client-simple (~> 0.3.0)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- ast (2.4.0)
13
- coderay (1.1.2)
14
- diff-lcs (1.3)
12
+ ast (2.4.1)
13
+ coderay (1.1.3)
14
+ diff-lcs (1.4.4)
15
15
  event_emitter (0.2.6)
16
- faraday (0.14.0)
16
+ faraday (1.1.0)
17
17
  multipart-post (>= 1.2, < 3)
18
- faraday_middleware (0.12.2)
19
- faraday (>= 0.7.4, < 1.0)
20
- jaro_winkler (1.5.3)
21
- method_source (0.9.2)
18
+ ruby2_keywords
19
+ faraday_middleware (1.0.0)
20
+ faraday (~> 1.0)
21
+ method_source (1.0.0)
22
22
  multipart-post (2.1.1)
23
- parallel (1.17.0)
24
- parser (2.6.3.0)
25
- ast (~> 2.4.0)
26
- pry (0.12.2)
27
- coderay (~> 1.1.0)
28
- method_source (~> 0.9.0)
23
+ parallel (1.19.2)
24
+ parser (2.7.2.0)
25
+ ast (~> 2.4.1)
26
+ pry (0.13.1)
27
+ coderay (~> 1.1)
28
+ method_source (~> 1.0)
29
29
  rainbow (3.0.0)
30
- rake (12.3.0)
31
- rspec (3.7.0)
32
- rspec-core (~> 3.7.0)
33
- rspec-expectations (~> 3.7.0)
34
- rspec-mocks (~> 3.7.0)
35
- rspec-core (3.7.1)
36
- rspec-support (~> 3.7.0)
37
- rspec-expectations (3.7.0)
30
+ rake (13.0.1)
31
+ regexp_parser (1.8.2)
32
+ rexml (3.2.4)
33
+ rspec (3.10.0)
34
+ rspec-core (~> 3.10.0)
35
+ rspec-expectations (~> 3.10.0)
36
+ rspec-mocks (~> 3.10.0)
37
+ rspec-core (3.10.0)
38
+ rspec-support (~> 3.10.0)
39
+ rspec-expectations (3.10.0)
38
40
  diff-lcs (>= 1.2.0, < 2.0)
39
- rspec-support (~> 3.7.0)
40
- rspec-mocks (3.7.0)
41
+ rspec-support (~> 3.10.0)
42
+ rspec-mocks (3.10.0)
41
43
  diff-lcs (>= 1.2.0, < 2.0)
42
- rspec-support (~> 3.7.0)
43
- rspec-support (3.7.1)
44
- rubocop (0.72.0)
45
- jaro_winkler (~> 1.5.1)
44
+ rspec-support (~> 3.10.0)
45
+ rspec-support (3.10.0)
46
+ rubocop (1.2.0)
46
47
  parallel (~> 1.10)
47
- parser (>= 2.6)
48
+ parser (>= 2.7.1.5)
48
49
  rainbow (>= 2.2.2, < 4.0)
50
+ regexp_parser (>= 1.8)
51
+ rexml
52
+ rubocop-ast (>= 1.0.1)
49
53
  ruby-progressbar (~> 1.7)
50
- unicode-display_width (>= 1.4.0, < 1.7)
54
+ unicode-display_width (>= 1.4.0, < 2.0)
55
+ rubocop-ast (1.1.1)
56
+ parser (>= 2.7.1.5)
51
57
  ruby-progressbar (1.10.1)
52
- unicode-display_width (1.6.0)
58
+ ruby2_keywords (0.0.2)
59
+ unicode-display_width (1.7.0)
53
60
  websocket (1.2.8)
54
61
  websocket-client-simple (0.3.0)
55
62
  event_emitter
@@ -60,11 +67,11 @@ PLATFORMS
60
67
 
61
68
  DEPENDENCIES
62
69
  bitflyer!
63
- bundler (~> 1.12)
70
+ bundler (~> 2.0)
64
71
  pry
65
72
  rake
66
73
  rspec
67
74
  rubocop
68
75
 
69
76
  BUNDLED WITH
70
- 1.17.3
77
+ 2.0.2
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
  [![Gem Version](https://badge.fury.io/rb/bitflyer.svg)](https://badge.fury.io/rb/bitflyer)
3
3
  [![Circle CI](https://circleci.com/gh/unhappychoice/bitflyer.svg?style=shield)](https://circleci.com/gh/unhappychoice/bitflyer)
4
4
  [![Code Climate](https://codeclimate.com/github/unhappychoice/bitflyer/badges/gpa.svg)](https://codeclimate.com/github/unhappychoice/bitflyer)
5
+ [![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/unhappychoice/bitflyer.svg)](https://libraries.io/github/unhappychoice/bitflyer)
5
6
  ![](http://ruby-gem-downloads-badge.herokuapp.com/bitflyer?type=total)
7
+ ![GitHub](https://img.shields.io/github/license/unhappychoice/bitflyer.svg)
6
8
 
7
9
  bitflyer is a wrapper interface of [Bitflyer lightning API](https://lightning.bitflyer.jp/docs)
8
10
 
@@ -17,10 +17,10 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ['lib']
19
19
 
20
- spec.add_dependency 'faraday', '~> 0.14.0'
21
- spec.add_dependency 'faraday_middleware', '~> 0.12.0'
20
+ spec.add_dependency 'faraday', '>= 0.14', '< 1.2'
21
+ spec.add_dependency 'faraday_middleware', '>= 0.12', '< 1.1'
22
22
  spec.add_dependency 'websocket-client-simple', '~> 0.3.0'
23
- spec.add_development_dependency 'bundler', '~> 1.12'
23
+ spec.add_development_dependency 'bundler', '~> 2.0'
24
24
  spec.add_development_dependency 'pry'
25
25
  spec.add_development_dependency 'rake'
26
26
  spec.add_development_dependency 'rspec'
@@ -36,7 +36,7 @@ module Bitflyer
36
36
 
37
37
  timestamp = Time.now.to_i.to_s
38
38
  method = env[:method].to_s.upcase
39
- path = env[:url].path + (env[:url].query ? '?' + env[:url].query : '')
39
+ path = env[:url].path + (env[:url].query ? "?#{env[:url].query}" : '')
40
40
  body = env[:body] || ''
41
41
  signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), @secret, timestamp + method + path + body)
42
42
  env[:request_headers]['ACCESS-KEY'] = @key if @key
@@ -6,7 +6,7 @@ module Bitflyer
6
6
  module Realtime
7
7
  EVENT_NAMES = %w[lightning_board_snapshot lightning_board lightning_ticker lightning_executions].freeze
8
8
  MARKETS = %w[BTC_JPY FX_BTC_JPY ETH_BTC BCH_BTC BTCJPY_MAT3M BTCJPY_MAT1WK BTCJPY_MAT2WK].freeze
9
- CHANNEL_NAMES = EVENT_NAMES.product(MARKETS).map { |e, m| e + '_' + m }
9
+ CHANNEL_NAMES = EVENT_NAMES.product(MARKETS).map { |e, m| "#{e}_#{m}" }
10
10
 
11
11
  SOCKET_HOST = 'https://io.lightstream.bitflyer.com'
12
12
 
@@ -63,7 +63,7 @@ module Bitflyer
63
63
 
64
64
  def wait_pong
65
65
  return unless @last_pong_at && @ping_timeout
66
- return unless Time.now.to_i - @last_pong_at > @ping_timeout / 1000
66
+ return unless Time.now.to_i - @last_pong_at > (@ping_interval + @ping_timeout) / 1000
67
67
 
68
68
  debug_log 'Timed out waiting pong'
69
69
  @websocket_client.close
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitflyer
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
metadata CHANGED
@@ -1,43 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitflyer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Ueki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-11 00:00:00.000000000 Z
11
+ date: 2020-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.14'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: 0.14.0
22
+ version: '1.2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.14'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: 0.14.0
32
+ version: '1.2'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: faraday_middleware
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0.12'
40
+ - - "<"
32
41
  - !ruby/object:Gem::Version
33
- version: 0.12.0
42
+ version: '1.1'
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - "~>"
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0.12'
50
+ - - "<"
39
51
  - !ruby/object:Gem::Version
40
- version: 0.12.0
52
+ version: '1.1'
41
53
  - !ruby/object:Gem::Dependency
42
54
  name: websocket-client-simple
43
55
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +70,14 @@ dependencies:
58
70
  requirements:
59
71
  - - "~>"
60
72
  - !ruby/object:Gem::Version
61
- version: '1.12'
73
+ version: '2.0'
62
74
  type: :development
63
75
  prerelease: false
64
76
  version_requirements: !ruby/object:Gem::Requirement
65
77
  requirements:
66
78
  - - "~>"
67
79
  - !ruby/object:Gem::Version
68
- version: '1.12'
80
+ version: '2.0'
69
81
  - !ruby/object:Gem::Dependency
70
82
  name: pry
71
83
  requirement: !ruby/object:Gem::Requirement
@@ -166,8 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
178
  - !ruby/object:Gem::Version
167
179
  version: '0'
168
180
  requirements: []
169
- rubyforge_project:
170
- rubygems_version: 2.7.6
181
+ rubygems_version: 3.0.3
171
182
  signing_key:
172
183
  specification_version: 4
173
184
  summary: Bitflyer API wrapper