bitflyer 1.4.0 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b29fa40669e3131fb53fa6f878fd53b0a0a9fb8e4e2f0e29923cd85288b95c6
4
- data.tar.gz: 10dfdb3120b030ce9aeca642bfc700be01ec8824270e998dae3f53d845b48fa5
3
+ metadata.gz: 9b7d3681f63edf4ec68d0d5958e386100fdb49771f6e9effc6b02b94c9c5c577
4
+ data.tar.gz: 12dfafaa76aec07e11c2abc2386ab19cd04cd821c208dd928f36923f9eb102a0
5
5
  SHA512:
6
- metadata.gz: c4cf3537edc91a5de46622a5fb0e7082f17364317f9fea569bf6a32d277ef0de0fd3b35e8b0c13a0e09713fef3c6a8f5f7ebd1c2ddf56edecf6cf0006dc2ca8f
7
- data.tar.gz: d04b272d9f7f268c1b683db172a47c27fea800db2afb9d4513b4aaef746d1fd5fa5dfe317f7c1590db6832c0939548b3c1de8b22bfd67558efda854b31690414
6
+ metadata.gz: 9b0a95bc8cc1d80d8b3581c36990c076da8d6345a73548e59f54a7d4907f3e665fccf127fe7c503ef175d45d268aa83218e6fb619fa021733914e944b29fc91d
7
+ data.tar.gz: 63a055d9b5f1e975546d8afccdf434fe210952b10a91847a1d28f260dbc856f393b9564555c6275237eb499819289543767f18c8d8fde93a173a85a9f0c9920e
@@ -0,0 +1,41 @@
1
+ name: release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version:
7
+ description: Release version
8
+ required: true
9
+ type: choice
10
+ options:
11
+ - major
12
+ - minor
13
+ - patch
14
+ jobs:
15
+ push:
16
+ name: Push gem to RubyGems.org
17
+ runs-on: ubuntu-latest
18
+ environment:
19
+ name: release
20
+ permissions:
21
+ id-token: write
22
+ contents: write
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - name: Set up Ruby
26
+ uses: ruby/setup-ruby@v1
27
+ with:
28
+ bundler-cache: true
29
+ ruby-version: .ruby-version
30
+ - name: Setup Git
31
+ run: |
32
+ git config --global user.email "unhappychoice@gmail.com"
33
+ git config --global user.name "unhappychoice"
34
+ - name: Install gem-release
35
+ run: gem install gem-release
36
+ - name: Bump version
37
+ run: |
38
+ gem bump --version ${{inputs.version}} --message ':tada: Bump %{name} to %{version}'
39
+ bundle config set frozen false && bundle install
40
+ git add . && git commit --amend --no-edit
41
+ - uses: rubygems/release-gem@v1
@@ -0,0 +1,41 @@
1
+ name: test
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ lint:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@master
10
+ - name: Set up Ruby
11
+ uses: ruby/setup-ruby@v1
12
+ with:
13
+ ruby-version: .ruby-version
14
+ - name: Install bundler
15
+ run: gem install bundler
16
+ - name: Install dependencies
17
+ run: bundle install --jobs 4
18
+ - name: Run lint
19
+ run: bundle exec rubocop lib
20
+ test:
21
+ runs-on: ubuntu-latest
22
+ strategy:
23
+ matrix:
24
+ ruby: ['3.4.4', '3.3.8', '3.2.8', '3.1.7']
25
+ steps:
26
+ - uses: actions/checkout@master
27
+ - name: Set up Ruby
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby }}
31
+ rubygems: latest
32
+ - name: Install bundler
33
+ run: gem install bundler
34
+ - name: Install dependencies
35
+ run: bundle install --jobs 4
36
+ - name: Run test
37
+ env:
38
+ RAILS_ENV: test
39
+ COVERAGE: true
40
+ CODECOV_TOKEN: d9091f65-2e14-4029-86e6-f6ec9c59ecec
41
+ run: bundle exec rspec
data/.gitignore ADDED
@@ -0,0 +1,57 @@
1
+ # Created by https://www.gitignore.io/api/ruby
2
+ # Edit at https://www.gitignore.io/?templates=ruby
3
+
4
+ ### Ruby ###
5
+ *.gem
6
+ *.rbc
7
+ /.config
8
+ /coverage/
9
+ /InstalledFiles
10
+ /pkg/
11
+ /spec/reports/
12
+ /spec/examples.txt
13
+ /test/tmp/
14
+ /test/version_tmp/
15
+ /tmp/
16
+
17
+ # Used by dotenv library to load environment variables.
18
+ # .env
19
+
20
+ ## Specific to RubyMotion:
21
+ .dat*
22
+ .repl_history
23
+ build/
24
+ *.bridgesupport
25
+ build-iPhoneOS/
26
+ build-iPhoneSimulator/
27
+
28
+ ## Specific to RubyMotion (use of CocoaPods):
29
+ #
30
+ # We recommend against adding the Pods directory to your .gitignore. However
31
+ # you should judge for yourself, the pros and cons are mentioned at:
32
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
33
+ #
34
+ # vendor/Pods/
35
+
36
+ ## Documentation cache and generated files:
37
+ /.yardoc/
38
+ /_yardoc/
39
+ /doc/
40
+ /rdoc/
41
+
42
+ ## Environment normalization:
43
+ /.bundle/
44
+ /vendor/bundle
45
+ /lib/bundler/man/
46
+ vendor/bundle
47
+
48
+ # for a library or gem, you might want to ignore these files since the code is
49
+ # intended to run in multiple environments; otherwise, check them in:
50
+ # Gemfile.lock
51
+ # .ruby-version
52
+ # .ruby-gemset
53
+
54
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
55
+ .rvmrc
56
+
57
+ # End of https://www.gitignore.io/api/ruby
data/.rubocop.yml CHANGED
@@ -4,7 +4,8 @@ AllCops:
4
4
  NewCops: enable
5
5
  Include:
6
6
  - 'lib/**/*.rb'
7
+ TargetRubyVersion: 3.1
7
8
  Style/Documentation:
8
9
  Enabled: false
9
- Metrics/LineLength:
10
- Max: 120
10
+ Layout/LineLength:
11
+ Max: 120
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.4
data/Gemfile.lock CHANGED
@@ -1,79 +1,104 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bitflyer (1.4.0)
5
- faraday (>= 0.14, < 1.5)
6
- faraday_middleware (>= 0.12, < 1.1)
7
- websocket-client-simple (~> 0.3.0)
4
+ bitflyer (2.0.1)
5
+ faraday (>= 1.0)
6
+ faraday_middleware (>= 1.2)
7
+ websocket-client-simple (>= 0.9)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- ast (2.4.2)
12
+ ast (2.4.3)
13
+ base64 (0.3.0)
13
14
  coderay (1.1.3)
14
- diff-lcs (1.4.4)
15
+ diff-lcs (1.6.2)
15
16
  event_emitter (0.2.6)
16
- faraday (1.4.2)
17
+ faraday (1.10.4)
17
18
  faraday-em_http (~> 1.0)
18
19
  faraday-em_synchrony (~> 1.0)
19
20
  faraday-excon (~> 1.1)
21
+ faraday-httpclient (~> 1.0)
22
+ faraday-multipart (~> 1.0)
20
23
  faraday-net_http (~> 1.0)
21
- faraday-net_http_persistent (~> 1.1)
22
- multipart-post (>= 1.2, < 3)
24
+ faraday-net_http_persistent (~> 1.0)
25
+ faraday-patron (~> 1.0)
26
+ faraday-rack (~> 1.0)
27
+ faraday-retry (~> 1.0)
23
28
  ruby2_keywords (>= 0.0.4)
24
29
  faraday-em_http (1.0.0)
25
- faraday-em_synchrony (1.0.0)
30
+ faraday-em_synchrony (1.0.1)
26
31
  faraday-excon (1.1.0)
27
- faraday-net_http (1.0.1)
28
- faraday-net_http_persistent (1.1.0)
29
- faraday_middleware (1.0.0)
32
+ faraday-httpclient (1.0.1)
33
+ faraday-multipart (1.1.1)
34
+ multipart-post (~> 2.0)
35
+ faraday-net_http (1.0.2)
36
+ faraday-net_http_persistent (1.2.0)
37
+ faraday-patron (1.0.0)
38
+ faraday-rack (1.0.0)
39
+ faraday-retry (1.0.3)
40
+ faraday_middleware (1.2.1)
30
41
  faraday (~> 1.0)
31
- method_source (1.0.0)
32
- multipart-post (2.1.1)
33
- parallel (1.20.1)
34
- parser (3.0.1.1)
42
+ json (2.12.2)
43
+ language_server-protocol (3.17.0.5)
44
+ lint_roller (1.1.0)
45
+ method_source (1.1.0)
46
+ multipart-post (2.4.1)
47
+ mutex_m (0.3.0)
48
+ parallel (1.27.0)
49
+ parser (3.3.8.0)
35
50
  ast (~> 2.4.1)
36
- pry (0.14.1)
51
+ racc
52
+ prism (1.4.0)
53
+ pry (0.15.2)
37
54
  coderay (~> 1.1)
38
55
  method_source (~> 1.0)
39
- rainbow (3.0.0)
40
- rake (13.0.3)
41
- regexp_parser (2.1.1)
42
- rexml (3.2.5)
43
- rspec (3.10.0)
44
- rspec-core (~> 3.10.0)
45
- rspec-expectations (~> 3.10.0)
46
- rspec-mocks (~> 3.10.0)
47
- rspec-core (3.10.1)
48
- rspec-support (~> 3.10.0)
49
- rspec-expectations (3.10.1)
56
+ racc (1.8.1)
57
+ rainbow (3.1.1)
58
+ rake (13.3.0)
59
+ regexp_parser (2.10.0)
60
+ rspec (3.13.1)
61
+ rspec-core (~> 3.13.0)
62
+ rspec-expectations (~> 3.13.0)
63
+ rspec-mocks (~> 3.13.0)
64
+ rspec-core (3.13.4)
65
+ rspec-support (~> 3.13.0)
66
+ rspec-expectations (3.13.5)
50
67
  diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.10.0)
52
- rspec-mocks (3.10.2)
68
+ rspec-support (~> 3.13.0)
69
+ rspec-mocks (3.13.5)
53
70
  diff-lcs (>= 1.2.0, < 2.0)
54
- rspec-support (~> 3.10.0)
55
- rspec-support (3.10.2)
56
- rubocop (1.15.0)
71
+ rspec-support (~> 3.13.0)
72
+ rspec-support (3.13.4)
73
+ rubocop (1.77.0)
74
+ json (~> 2.3)
75
+ language_server-protocol (~> 3.17.0.2)
76
+ lint_roller (~> 1.1.0)
57
77
  parallel (~> 1.10)
58
- parser (>= 3.0.0.0)
78
+ parser (>= 3.3.0.2)
59
79
  rainbow (>= 2.2.2, < 4.0)
60
- regexp_parser (>= 1.8, < 3.0)
61
- rexml
62
- rubocop-ast (>= 1.5.0, < 2.0)
80
+ regexp_parser (>= 2.9.3, < 3.0)
81
+ rubocop-ast (>= 1.45.1, < 2.0)
63
82
  ruby-progressbar (~> 1.7)
64
- unicode-display_width (>= 1.4.0, < 3.0)
65
- rubocop-ast (1.5.0)
66
- parser (>= 3.0.1.1)
67
- ruby-progressbar (1.11.0)
68
- ruby2_keywords (0.0.4)
69
- unicode-display_width (2.0.0)
70
- websocket (1.2.9)
71
- websocket-client-simple (0.3.0)
83
+ unicode-display_width (>= 2.4.0, < 4.0)
84
+ rubocop-ast (1.45.1)
85
+ parser (>= 3.3.7.2)
86
+ prism (~> 1.4)
87
+ ruby-progressbar (1.13.0)
88
+ ruby2_keywords (0.0.5)
89
+ unicode-display_width (3.1.4)
90
+ unicode-emoji (~> 4.0, >= 4.0.4)
91
+ unicode-emoji (4.0.4)
92
+ websocket (1.2.11)
93
+ websocket-client-simple (0.9.0)
94
+ base64
72
95
  event_emitter
96
+ mutex_m
73
97
  websocket
74
98
 
75
99
  PLATFORMS
76
100
  ruby
101
+ x86_64-darwin-24
77
102
 
78
103
  DEPENDENCIES
79
104
  bitflyer!
@@ -84,4 +109,4 @@ DEPENDENCIES
84
109
  rubocop
85
110
 
86
111
  BUNDLED WITH
87
- 2.2.4
112
+ 2.6.9
data/bitflyer.gemspec CHANGED
@@ -6,20 +6,21 @@ require 'bitflyer/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'bitflyer'
8
8
  spec.version = Bitflyer::VERSION
9
+ spec.required_ruby_version = '>= 3.1'
9
10
  spec.authors = ['Yuji Ueki']
10
11
  spec.email = ['unhappychoice@gmail.com']
11
12
  spec.summary = %q{Bitflyer API wrapper}
12
13
  spec.description = %q{Bitflyer API wrapper}
13
- spec.homepage = 'https://github.com/unhappychoice/bitflyer'
14
+ spec.homepage = 'https://github.com/bitflyer-tools/bitflyer'
14
15
  spec.license = 'MIT'
15
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
17
  spec.bindir = 'exe'
17
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
19
  spec.require_paths = ['lib']
19
20
 
20
- spec.add_dependency 'faraday', '>= 0.14', '< 1.5'
21
- spec.add_dependency 'faraday_middleware', '>= 0.12', '< 1.1'
22
- spec.add_dependency 'websocket-client-simple', '~> 0.3.0'
21
+ spec.add_dependency 'faraday', '>= 1.0'
22
+ spec.add_dependency 'faraday_middleware', '>= 1.2'
23
+ spec.add_dependency 'websocket-client-simple', '>= 0.9'
23
24
  spec.add_development_dependency 'bundler', '~> 2.0'
24
25
  spec.add_development_dependency 'pry'
25
26
  spec.add_development_dependency 'rake'
@@ -34,7 +34,7 @@ module Bitflyer
34
34
  @connection.get('/v1/executions', query).body
35
35
  end
36
36
 
37
- def chats(from_date: (Time.now - 5 * 24 * 60 * 60))
37
+ def chats(from_date: (Time.now - (5 * 24 * 60 * 60)))
38
38
  @connection.get('/v1/getchats', from_date: from_date).body
39
39
  end
40
40
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative './websocket'
3
+ require_relative 'websocket'
4
4
 
5
5
  module Bitflyer
6
6
  module Realtime
@@ -110,10 +110,10 @@ module Bitflyer
110
110
  @disconnected&.call(error)
111
111
  end
112
112
 
113
- def setup_by_response(json:)
113
+ def setup_by_response(json:) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
114
114
  body = JSON.parse json
115
- @ping_interval = body['pingInterval'].to_i || 25_000
116
- @ping_timeout = body['pingTimeout'].to_i || 60_000
115
+ @ping_interval = body['pingInterval']&.to_i || 25_000
116
+ @ping_timeout = body['pingTimeout']&.to_i || 60_000
117
117
  @last_ping_at = Time.now.to_i
118
118
  @last_pong_at = Time.now.to_i
119
119
  if @key && @secret
@@ -147,7 +147,7 @@ module Bitflyer
147
147
  end
148
148
 
149
149
  def subscribe_channels
150
- @channel_callbacks.each do |channel_name, _|
150
+ @channel_callbacks.each_key do |channel_name|
151
151
  debug_log "42#{{ subscribe: channel_name }.to_json}"
152
152
  @websocket_client.send "42#{['subscribe', channel_name].to_json}"
153
153
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitflyer
4
- VERSION = '1.4.0'
4
+ VERSION = '2.0.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitflyer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Ueki
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2021-05-23 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: faraday
@@ -16,54 +15,42 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '0.14'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '1.5'
18
+ version: '1.0'
23
19
  type: :runtime
24
20
  prerelease: false
25
21
  version_requirements: !ruby/object:Gem::Requirement
26
22
  requirements:
27
23
  - - ">="
28
24
  - !ruby/object:Gem::Version
29
- version: '0.14'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '1.5'
25
+ version: '1.0'
33
26
  - !ruby/object:Gem::Dependency
34
27
  name: faraday_middleware
35
28
  requirement: !ruby/object:Gem::Requirement
36
29
  requirements:
37
30
  - - ">="
38
31
  - !ruby/object:Gem::Version
39
- version: '0.12'
40
- - - "<"
41
- - !ruby/object:Gem::Version
42
- version: '1.1'
32
+ version: '1.2'
43
33
  type: :runtime
44
34
  prerelease: false
45
35
  version_requirements: !ruby/object:Gem::Requirement
46
36
  requirements:
47
37
  - - ">="
48
38
  - !ruby/object:Gem::Version
49
- version: '0.12'
50
- - - "<"
51
- - !ruby/object:Gem::Version
52
- version: '1.1'
39
+ version: '1.2'
53
40
  - !ruby/object:Gem::Dependency
54
41
  name: websocket-client-simple
55
42
  requirement: !ruby/object:Gem::Requirement
56
43
  requirements:
57
- - - "~>"
44
+ - - ">="
58
45
  - !ruby/object:Gem::Version
59
- version: 0.3.0
46
+ version: '0.9'
60
47
  type: :runtime
61
48
  prerelease: false
62
49
  version_requirements: !ruby/object:Gem::Requirement
63
50
  requirements:
64
- - - "~>"
51
+ - - ">="
65
52
  - !ruby/object:Gem::Version
66
- version: 0.3.0
53
+ version: '0.9'
67
54
  - !ruby/object:Gem::Dependency
68
55
  name: bundler
69
56
  requirement: !ruby/object:Gem::Requirement
@@ -142,10 +129,13 @@ extensions: []
142
129
  extra_rdoc_files: []
143
130
  files:
144
131
  - ".all-contributorsrc"
145
- - ".circleci/config.yml"
146
132
  - ".github/dependabot.yml"
133
+ - ".github/workflows/release.yaml"
134
+ - ".github/workflows/test.yml"
135
+ - ".gitignore"
147
136
  - ".rubocop.yml"
148
137
  - ".rubocop_todo.yml"
138
+ - ".ruby-version"
149
139
  - CODE_OF_CONDUCT.md
150
140
  - Gemfile
151
141
  - Gemfile.lock
@@ -161,11 +151,10 @@ files:
161
151
  - lib/bitflyer/realtime/client.rb
162
152
  - lib/bitflyer/realtime/websocket.rb
163
153
  - lib/bitflyer/version.rb
164
- homepage: https://github.com/unhappychoice/bitflyer
154
+ homepage: https://github.com/bitflyer-tools/bitflyer
165
155
  licenses:
166
156
  - MIT
167
157
  metadata: {}
168
- post_install_message:
169
158
  rdoc_options: []
170
159
  require_paths:
171
160
  - lib
@@ -173,15 +162,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
173
162
  requirements:
174
163
  - - ">="
175
164
  - !ruby/object:Gem::Version
176
- version: '0'
165
+ version: '3.1'
177
166
  required_rubygems_version: !ruby/object:Gem::Requirement
178
167
  requirements:
179
168
  - - ">="
180
169
  - !ruby/object:Gem::Version
181
170
  version: '0'
182
171
  requirements: []
183
- rubygems_version: 3.0.3
184
- signing_key:
172
+ rubygems_version: 3.6.7
185
173
  specification_version: 4
186
174
  summary: Bitflyer API wrapper
187
175
  test_files: []
data/.circleci/config.yml DELETED
@@ -1,54 +0,0 @@
1
- version: 2.1
2
-
3
- update_bundler: &update_bundler
4
- run:
5
- name: update bundler
6
- command: gem update bundler
7
-
8
- bundle_install: &bundle_install
9
- run:
10
- name: bundle install
11
- command: bundle update --bundler && bundle install --path vendor/bundle --jobs 4
12
-
13
- restore_bundle_cache: &restore_bundle_cache
14
- restore_cache:
15
- key: cache-bundler-{{ checksum "Gemfile.lock" }}
16
-
17
- jobs:
18
- build:
19
- docker:
20
- - image: circleci/ruby:2.7.2
21
- steps:
22
- - checkout
23
- - *restore_bundle_cache
24
- - *update_bundler
25
- - *bundle_install
26
- - save_cache:
27
- key: cache-bundler-{{ checksum "Gemfile.lock" }}
28
- paths:
29
- - vendor/bundle
30
- rubocop:
31
- docker:
32
- - image: circleci/ruby:2.7.2
33
- steps:
34
- - checkout
35
- - *restore_bundle_cache
36
- - *update_bundler
37
- - *bundle_install
38
- - run: bundle exec rubocop
39
- rspec:
40
- docker:
41
- - image: circleci/ruby:2.7.2
42
- steps:
43
- - checkout
44
- - *restore_bundle_cache
45
- - *update_bundler
46
- - *bundle_install
47
- - run: bundle exec rspec
48
- workflows:
49
- version: 2.1
50
- rspec:
51
- jobs:
52
- - build
53
- - rubocop
54
- - rspec