bestchange 1.1 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +2 -2
- data/README.md +5 -5
- data/bestchange.gemspec +39 -0
- data/lib/bestchange/api.rb +4 -12
- data/lib/bestchange/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 922d13f47b2680219ff827c355dc2246e1c27c6daa66705df6eb695e228d0695
|
4
|
+
data.tar.gz: 5c9558204d44353fd6d914aaf09e3120085dcb7e34056545a295c6f999e8a207
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e4f8b830c30957fd2d8121ca0427973add275fcd39057c763011797385a9323fff050aa5d9440953fe6fda57242b97cb5dcfa164d475f5e7f907a73659ba0f3
|
7
|
+
data.tar.gz: f36984333bed6de0df9bcf056db63abcc6ec1e2f1d3540278c3d5430a8b10e056304a5137a616c50a7eb6a6c7e8ba83d0aa442188e7fa4d552be0611ac272213
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bestchange
|
4
|
+
bestchange (1.2)
|
5
5
|
rubyzip (= 2.3.2)
|
6
6
|
|
7
7
|
GEM
|
@@ -48,7 +48,7 @@ PLATFORMS
|
|
48
48
|
arm64-darwin-22
|
49
49
|
|
50
50
|
DEPENDENCIES
|
51
|
-
bestchange
|
51
|
+
bestchange!
|
52
52
|
minitest (= 5.17.0)
|
53
53
|
minitest-reporters
|
54
54
|
pry (= 0.14.2)
|
data/README.md
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
|
2
|
-
# bestchange
|
2
|
+
# bestchange
|
3
3
|
|
4
|
-
bestchange
|
4
|
+
bestchange is a simple library for getting data from Bestchange aggregator
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
8
8
|
Add this line to your application's Gemfile:
|
9
9
|
|
10
10
|
```ruby
|
11
|
-
gem 'bestchange
|
11
|
+
gem 'bestchange'
|
12
12
|
```
|
13
13
|
|
14
14
|
And then execute:
|
@@ -17,7 +17,7 @@ And then execute:
|
|
17
17
|
|
18
18
|
Or install it yourself as:
|
19
19
|
|
20
|
-
$ gem install bestchange
|
20
|
+
$ gem install bestchange
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
[Bestchange api description](https://github.com/karpinovsky/bestchange-api/blob/master/API_DOC.txt)
|
@@ -83,4 +83,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
83
83
|
|
84
84
|
## Code of Conduct
|
85
85
|
|
86
|
-
Everyone interacting in the bestchange
|
86
|
+
Everyone interacting in the bestchange project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/karpinovsky/bestchange-api/blob/master/CODE_OF_CONDUCT.md).
|
data/bestchange.gemspec
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/bestchange/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'bestchange'
|
7
|
+
spec.summary = 'Bestchange client'
|
8
|
+
spec.description = 'A simple library for getting data from Bestchange aggregator'
|
9
|
+
|
10
|
+
spec.version = Bestchange::VERSION
|
11
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 3.1.3')
|
12
|
+
|
13
|
+
spec.authors = ['Kirill Karpinovsky']
|
14
|
+
spec.email = 'karpinovsky@gmail.com'
|
15
|
+
|
16
|
+
spec.homepage = 'https://github.com/karpinovsky/bestchange'
|
17
|
+
|
18
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
19
|
+
spec.metadata['source_code_uri'] = spec.homepage
|
20
|
+
spec.metadata['bug_tracker_uri'] = "#{spec.homepage}/issues"
|
21
|
+
spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/master/CHANGELOG.md"
|
22
|
+
|
23
|
+
spec.extra_rdoc_files = Dir['README.md', 'CHANGELOG.md', 'LICENSE.txt']
|
24
|
+
|
25
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
26
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
27
|
+
end
|
28
|
+
|
29
|
+
spec.require_paths = ['lib']
|
30
|
+
|
31
|
+
spec.add_dependency 'rubyzip', '2.3.2'
|
32
|
+
|
33
|
+
spec.add_development_dependency 'minitest', '5.17.0'
|
34
|
+
spec.add_development_dependency 'minitest-reporters'
|
35
|
+
spec.add_development_dependency 'pry', '0.14.2'
|
36
|
+
spec.add_development_dependency 'rubocop', '1.47.0'
|
37
|
+
|
38
|
+
spec.license = 'MIT'
|
39
|
+
end
|
data/lib/bestchange/api.rb
CHANGED
@@ -9,25 +9,17 @@ require 'zip'
|
|
9
9
|
module Bestchange
|
10
10
|
class Api
|
11
11
|
BASE_URI = 'http://api.bestchange.ru/info.zip'
|
12
|
+
BASE_CONNECTION = Net::HTTP.new(URI(BASE_URI).host, URI(BASE_URI).port)
|
13
|
+
BASE_REQUEST = Net::HTTP::Get.new(URI(BASE_URI))
|
12
14
|
|
13
|
-
def initialize(conn =
|
15
|
+
def initialize(conn = BASE_CONNECTION)
|
14
16
|
@conn = conn
|
15
17
|
end
|
16
18
|
|
17
19
|
attr_reader :conn
|
18
20
|
|
19
|
-
def request(request =
|
21
|
+
def request(request = BASE_REQUEST)
|
20
22
|
conn.request(request)
|
21
23
|
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def default_conn
|
26
|
-
Net::HTTP.new(URI(BASE_URI).host, URI(BASE_URI).port)
|
27
|
-
end
|
28
|
-
|
29
|
-
def default_request
|
30
|
-
Net::HTTP::Get.new(URI(BASE_URI))
|
31
|
-
end
|
32
24
|
end
|
33
25
|
end
|
data/lib/bestchange/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bestchange
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirill Karpinovsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- LICENSE
|
99
99
|
- README.md
|
100
100
|
- Rakefile
|
101
|
+
- bestchange.gemspec
|
101
102
|
- bin/console
|
102
103
|
- bin/setup
|
103
104
|
- lib/bestchange.rb
|