bitget.rb 0.3.0 → 0.3.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: 9b1ea6c7d91ff48cbcd7e70f6dd5c3aaf43231bd6eac34050c6b0fc9c1c33cfd
4
- data.tar.gz: d53e337eef7ed2b324ec29e64b36bcd82314c75f069761c13d5ef71f01a5abe9
3
+ metadata.gz: 2d2751725e270a3466b6fb00e665fefcc824fad5817f45f6805e4f2abe4ce4ed
4
+ data.tar.gz: 69e156c08596016abae4b32252da43a687f487740f0a347a0c6dc605e295da5b
5
5
  SHA512:
6
- metadata.gz: a66581d1bf3312c2826055eec6e4fdfc73a49ff1bcef8950ba7fe0f9ab067811983b960eecb979619a5e907c4561498525a15f4a113caf8d76826debf7543a18
7
- data.tar.gz: 1f3b6e5288b51858423b470f7139be1bc7aba01e3719c54fe170833986d5784887ceda5c6719f2c5b43da795d5f0b54a26c6b2b4c0205cd8ef4b0d230ba181e1
6
+ metadata.gz: 56798524a003cfa167d2993dcfc59fb2fc76788e6260495577c677ed00faeebab1f1f48495a1d1fd1064ff909f2b79867a618fa9179a7441f8ce8dc000989f8c
7
+ data.tar.gz: 4108e6fbc9dc198054605cefd79d51ca9cd02fdb3fe3f96c43b29e4f67c399bffe481fbe4bbee6aaeff87a05ccf94461f91da14e894a286b33f06503dfdd3ec7
data/bitget.rb.gemspec CHANGED
@@ -1,8 +1,10 @@
1
+ require_relative './lib/Bitget/VERSION'
2
+
1
3
  Gem::Specification.new do |spec|
2
4
  spec.name = 'bitget.rb'
3
5
 
4
- spec.version = '0.3.0'
5
- spec.date = '2025-03-29'
6
+ spec.version = Bitget::VERSION
7
+ spec.date = '2025-04-02'
6
8
 
7
9
  spec.summary = "Access the Bitget API with Ruby."
8
10
  spec.description = "Access the Bitget API with Ruby."
@@ -1,13 +1,14 @@
1
1
  # Bitget/V2/Client.rb
2
2
  # Bitget::V2::Client
3
3
 
4
- require 'Hash/to_parameter_string'
4
+ require 'fileutils'
5
5
  gem 'http.rb'; require 'http.rb'
6
6
  require 'json'
7
7
  require 'logger'
8
8
  require 'openssl'
9
9
 
10
10
  require_relative '../Error'
11
+ require_relative '../../Hash/to_parameter_string'
11
12
  require_relative '../../Hash/x_www_form_urlencode'
12
13
 
13
14
  module Bitget
@@ -0,0 +1,6 @@
1
+ # Bitget/VERSION.rb
2
+ # Bitget::VERSION
3
+
4
+ module Bitget
5
+ VERSION = '0.3.1'
6
+ end
@@ -1,24 +1,7 @@
1
1
  # String/url_encode.rb
2
2
  # String#url_encode
3
3
 
4
- # 20130310
5
- # 0.2.1
4
+ # 20250402
5
+ # 0.3.0
6
6
 
7
- # Description: When I went looking for a means to url encode and decode strings, I wanted something which used extensions to the String class. Of course there are other means to do url encoding and decoding including using the CGI class, but I liked the approach of having this 'built-in' to strings, rather than the string being passed as a parameter as does CGI. Hence this String extender...
8
-
9
- # Acknowledgements: I've simply ripped off and refashioned the code from the CGI module!...
10
-
11
- # Changes since 0.1:
12
- # 1. The url_encode and url_decode methods now are strictly demarcated.
13
- # 0/1
14
- # 2. A small reformat.
15
-
16
- class String
17
-
18
- def url_encode
19
- self.gsub(/([^ a-zA-Z0-9_.-]+)/n) do
20
- '%' + $1.unpack('H2' * $1.size).join('%').upcase
21
- end.tr(' ', '+')
22
- end
23
-
24
- end
7
+ require 'Thoran/String/UrlEncode/url_encode'
@@ -0,0 +1,26 @@
1
+ # Thoran/Hash/XWwwFormUrlEncode/x_www_form_urlencode.rb
2
+ # Thoran::Hash::XWwwFormUrlEncode#x_www_form_urlencode
3
+
4
+ # 20241009
5
+ # 0.2.0
6
+
7
+ # Changes since 0.1:
8
+ # -/0: (The class name and the snake case name are consistent now.)
9
+ # 1. /XWWWFormUrlEncode/XWwwFormUrlEncode/
10
+
11
+ require 'Thoran/String/UrlEncode/url_encode'
12
+
13
+ module Thoran
14
+ module Hash
15
+ module XWwwFormUrlEncode
16
+
17
+ def x_www_form_url_encode(joiner = '&')
18
+ inject([]){|a,e| a << "#{e.first.to_s.url_encode}=#{e.last.to_s.url_encode}" unless e.last.nil?; a}.join(joiner)
19
+ end
20
+ alias_method :x_www_form_urlencode, :x_www_form_url_encode
21
+
22
+ end
23
+ end
24
+ end
25
+
26
+ Hash.send(:include, Thoran::Hash::XWwwFormUrlEncode)
@@ -0,0 +1,26 @@
1
+ # Thoran/String/UrlEncode/url_encode.rb
2
+ # Thoran::String::UrlEncode#url_encode
3
+
4
+ # 20160505
5
+ # 0.3.0
6
+
7
+ # Acknowledgements: I've simply ripped off and refashioned the code from the CGI module!...
8
+
9
+ # Changes since 0.2:
10
+ # 1. + Thoran namespace.
11
+
12
+ module Thoran
13
+ module String
14
+ module UrlEncode
15
+
16
+ def url_encode
17
+ self.gsub(/([^ a-zA-Z0-9_.-]+)/n) do
18
+ '%' + $1.unpack('H2' * $1.size).join('%').upcase
19
+ end.tr(' ', '+')
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+
26
+ String.send(:include, Thoran::String::UrlEncode)
data/test/test_all.rb ADDED
@@ -0,0 +1,4 @@
1
+ # test/test_all.rb
2
+
3
+ require_relative './client_test'
4
+ require_relative './V2/client_test'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitget.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-29 00:00:00.000000000 Z
10
+ date: 2025-04-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: http.rb
@@ -35,13 +35,17 @@ files:
35
35
  - lib/Bitget/Client.rb
36
36
  - lib/Bitget/Error.rb
37
37
  - lib/Bitget/V2/Client.rb
38
+ - lib/Bitget/VERSiON.rb
38
39
  - lib/Hash/to_parameter_string.rb
39
40
  - lib/Hash/x_www_form_urlencode.rb
40
41
  - lib/String/url_encode.rb
42
+ - lib/Thoran/Hash/XWwwFormUrlencode/x_www_form_urlencode.rb
43
+ - lib/Thoran/String/UrlEncode/url_encode.rb
41
44
  - lib/bitget.rb
42
45
  - test/V2/client_test.rb
43
46
  - test/client_test.rb
44
47
  - test/helper.rb
48
+ - test/test_all.rb
45
49
  homepage: http://github.com/thoran/bitget.rb
46
50
  licenses:
47
51
  - Ruby