baza.rb 0.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.
data/Gemfile.lock ADDED
@@ -0,0 +1,255 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ baza.rb (0.0.0)
5
+ backtrace (> 0)
6
+ faraday (> 0)
7
+ faraday-http-cache (> 0)
8
+ faraday-multipart (> 0)
9
+ faraday-retry (> 0)
10
+ iri (> 0)
11
+ loog (> 0)
12
+ retries (~> 0)
13
+ typhoeus (~> 1.3)
14
+
15
+ GEM
16
+ remote: https://rubygems.org/
17
+ specs:
18
+ actionpack (7.1.3.4)
19
+ actionview (= 7.1.3.4)
20
+ activesupport (= 7.1.3.4)
21
+ nokogiri (>= 1.8.5)
22
+ racc
23
+ rack (>= 2.2.4)
24
+ rack-session (>= 1.0.1)
25
+ rack-test (>= 0.6.3)
26
+ rails-dom-testing (~> 2.2)
27
+ rails-html-sanitizer (~> 1.6)
28
+ actionview (7.1.3.4)
29
+ activesupport (= 7.1.3.4)
30
+ builder (~> 3.1)
31
+ erubi (~> 1.11)
32
+ rails-dom-testing (~> 2.2)
33
+ rails-html-sanitizer (~> 1.6)
34
+ activesupport (7.1.3.4)
35
+ base64
36
+ bigdecimal
37
+ concurrent-ruby (~> 1.0, >= 1.0.2)
38
+ connection_pool (>= 2.2.5)
39
+ drb
40
+ i18n (>= 1.6, < 2)
41
+ minitest (>= 5.1)
42
+ mutex_m
43
+ tzinfo (~> 2.0)
44
+ addressable (2.8.7)
45
+ public_suffix (>= 2.0.2, < 7.0)
46
+ ansi (1.5.0)
47
+ ast (2.4.2)
48
+ backtrace (0.4.0)
49
+ base64 (0.2.0)
50
+ bigdecimal (3.1.8)
51
+ builder (3.3.0)
52
+ concurrent-ruby (1.3.3)
53
+ connection_pool (2.4.1)
54
+ crack (1.0.0)
55
+ bigdecimal
56
+ rexml
57
+ crass (1.0.6)
58
+ decoor (0.0.1)
59
+ diff-lcs (1.5.1)
60
+ docile (1.4.1)
61
+ drb (2.2.1)
62
+ erubi (1.13.0)
63
+ ethon (0.16.0)
64
+ ffi (>= 1.15.0)
65
+ factbase (0.3.0)
66
+ backtrace (> 0)
67
+ decoor (> 0)
68
+ json (~> 2.7)
69
+ loog (> 0)
70
+ nokogiri (~> 1.10)
71
+ others (> 0)
72
+ tago (> 0)
73
+ yaml (~> 0.3)
74
+ faraday (2.10.1)
75
+ faraday-net_http (>= 2.0, < 3.2)
76
+ logger
77
+ faraday-http-cache (2.5.1)
78
+ faraday (>= 0.8)
79
+ faraday-multipart (1.0.4)
80
+ multipart-post (~> 2)
81
+ faraday-net_http (3.1.1)
82
+ net-http
83
+ faraday-retry (2.2.1)
84
+ faraday (~> 2.0)
85
+ ffi (1.17.0-arm64-darwin)
86
+ ffi (1.17.0-x64-mingw-ucrt)
87
+ ffi (1.17.0-x86_64-darwin)
88
+ ffi (1.17.0-x86_64-linux-gnu)
89
+ hashdiff (1.1.1)
90
+ i18n (1.14.5)
91
+ concurrent-ruby (~> 1.0)
92
+ io-console (0.7.2)
93
+ irb (1.14.0)
94
+ rdoc (>= 4.0.0)
95
+ reline (>= 0.4.2)
96
+ iri (0.8.0)
97
+ json (2.7.2)
98
+ language_server-protocol (3.17.0.3)
99
+ logger (1.6.0)
100
+ loofah (2.22.0)
101
+ crass (~> 1.0.2)
102
+ nokogiri (>= 1.12.0)
103
+ loog (0.6.0)
104
+ minitest (5.24.1)
105
+ minitest-reporters (1.7.1)
106
+ ansi
107
+ builder
108
+ minitest (>= 5.0)
109
+ ruby-progressbar
110
+ multipart-post (2.4.1)
111
+ mutex_m (0.2.0)
112
+ net-http (0.4.1)
113
+ uri
114
+ net-ping (2.0.8)
115
+ nokogiri (1.16.7-arm64-darwin)
116
+ racc (~> 1.4)
117
+ nokogiri (1.16.7-x64-mingw-ucrt)
118
+ racc (~> 1.4)
119
+ nokogiri (1.16.7-x86_64-darwin)
120
+ racc (~> 1.4)
121
+ nokogiri (1.16.7-x86_64-linux)
122
+ racc (~> 1.4)
123
+ others (0.0.3)
124
+ parallel (1.26.1)
125
+ parser (3.3.4.2)
126
+ ast (~> 2.4.1)
127
+ racc
128
+ psych (5.1.2)
129
+ stringio
130
+ public_suffix (6.0.1)
131
+ racc (1.8.1)
132
+ rack (3.1.7)
133
+ rack-session (2.0.0)
134
+ rack (>= 3.0.0)
135
+ rack-test (2.1.0)
136
+ rack (>= 1.3)
137
+ rackup (2.1.0)
138
+ rack (>= 3)
139
+ webrick (~> 1.8)
140
+ rails-dom-testing (2.2.0)
141
+ activesupport (>= 5.0.0)
142
+ minitest
143
+ nokogiri (>= 1.6)
144
+ rails-html-sanitizer (1.6.0)
145
+ loofah (~> 2.21)
146
+ nokogiri (~> 1.14)
147
+ railties (7.1.3.4)
148
+ actionpack (= 7.1.3.4)
149
+ activesupport (= 7.1.3.4)
150
+ irb
151
+ rackup (>= 1.0.0)
152
+ rake (>= 12.2)
153
+ thor (~> 1.0, >= 1.2.2)
154
+ zeitwerk (~> 2.6)
155
+ rainbow (3.1.1)
156
+ rake (13.2.1)
157
+ random-port (0.7.1)
158
+ rdoc (6.7.0)
159
+ psych (>= 4.0.0)
160
+ regexp_parser (2.9.2)
161
+ reline (0.5.9)
162
+ io-console (~> 0.5)
163
+ retries (0.0.5)
164
+ rexml (3.3.4)
165
+ strscan
166
+ rspec-core (3.13.0)
167
+ rspec-support (~> 3.13.0)
168
+ rspec-expectations (3.13.1)
169
+ diff-lcs (>= 1.2.0, < 2.0)
170
+ rspec-support (~> 3.13.0)
171
+ rspec-mocks (3.13.1)
172
+ diff-lcs (>= 1.2.0, < 2.0)
173
+ rspec-support (~> 3.13.0)
174
+ rspec-rails (6.1.3)
175
+ actionpack (>= 6.1)
176
+ activesupport (>= 6.1)
177
+ railties (>= 6.1)
178
+ rspec-core (~> 3.13)
179
+ rspec-expectations (~> 3.13)
180
+ rspec-mocks (~> 3.13)
181
+ rspec-support (~> 3.13)
182
+ rspec-support (3.13.1)
183
+ rubocop (1.65.1)
184
+ json (~> 2.3)
185
+ language_server-protocol (>= 3.17.0)
186
+ parallel (~> 1.10)
187
+ parser (>= 3.3.0.2)
188
+ rainbow (>= 2.2.2, < 4.0)
189
+ regexp_parser (>= 2.4, < 3.0)
190
+ rexml (>= 3.2.5, < 4.0)
191
+ rubocop-ast (>= 1.31.1, < 2.0)
192
+ ruby-progressbar (~> 1.7)
193
+ unicode-display_width (>= 2.4.0, < 3.0)
194
+ rubocop-ast (1.32.0)
195
+ parser (>= 3.3.1.0)
196
+ rubocop-performance (1.21.1)
197
+ rubocop (>= 1.48.1, < 2.0)
198
+ rubocop-ast (>= 1.31.1, < 2.0)
199
+ rubocop-rspec (3.0.4)
200
+ rubocop (~> 1.61)
201
+ ruby-progressbar (1.13.0)
202
+ simplecov (0.22.0)
203
+ docile (~> 1.1)
204
+ simplecov-html (~> 0.11)
205
+ simplecov_json_formatter (~> 0.1)
206
+ simplecov-cobertura (2.1.0)
207
+ rexml
208
+ simplecov (~> 0.19)
209
+ simplecov-html (0.12.3)
210
+ simplecov_json_formatter (0.1.4)
211
+ stringio (3.1.1)
212
+ strscan (3.1.0)
213
+ tago (0.0.2)
214
+ thor (1.3.1)
215
+ typhoeus (1.4.1)
216
+ ethon (>= 0.9.0)
217
+ tzinfo (2.0.6)
218
+ concurrent-ruby (~> 1.0)
219
+ unicode-display_width (2.5.0)
220
+ uri (0.13.0)
221
+ webmock (3.23.1)
222
+ addressable (>= 2.8.0)
223
+ crack (>= 0.3.2)
224
+ hashdiff (>= 0.4.0, < 2.0.0)
225
+ webrick (1.8.1)
226
+ yaml (0.3.0)
227
+ yard (0.9.36)
228
+ zeitwerk (2.6.17)
229
+
230
+ PLATFORMS
231
+ arm64-darwin-22
232
+ x64-mingw-ucrt
233
+ x86_64-darwin-20
234
+ x86_64-darwin-21
235
+ x86_64-linux
236
+
237
+ DEPENDENCIES
238
+ baza.rb!
239
+ factbase (> 0)
240
+ minitest (= 5.24.1)
241
+ minitest-reporters (= 1.7.1)
242
+ net-ping (= 2.0.8)
243
+ rake (= 13.2.1)
244
+ random-port (> 0)
245
+ rspec-rails (= 6.1.3)
246
+ rubocop (= 1.65.1)
247
+ rubocop-performance (= 1.21.1)
248
+ rubocop-rspec (= 3.0.4)
249
+ simplecov (= 0.22.0)
250
+ simplecov-cobertura (= 2.1.0)
251
+ webmock (= 3.23.1)
252
+ yard (= 0.9.36)
253
+
254
+ BUNDLED WITH
255
+ 2.4.22
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2024 Zerocracy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the 'Software'), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Zerocracy API Ruby Client
2
+
3
+ [![DevOps By Rultor.com](http://www.rultor.com/b/zerocracy/baza.rb)](http://www.rultor.com/p/zerocracy/baza.rb)
4
+
5
+ [![rake](https://github.com/zerocracy/baza.rb/actions/workflows/rake.yml/badge.svg)](https://github.com/zerocracy/baza.rb/actions/workflows/rake.yml)
6
+ [![PDD status](http://www.0pdd.com/svg?name=zerocracy/baza.rb)](http://www.0pdd.com/p?name=zerocracy/baza.rb)
7
+ [![Gem Version](https://badge.fury.io/rb/baza.rb.svg)](http://badge.fury.io/rb/baza.rb)
8
+ [![Test Coverage](https://img.shields.io/codecov/c/github/zerocracy/baza.rb.svg)](https://codecov.io/github/zerocracy/baza.rb?branch=master)
9
+ [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/zerocracy/baza.rb/master/frames)
10
+ [![Hits-of-Code](https://hitsofcode.com/github/zerocracy/baza.rb)](https://hitsofcode.com/view/github/zerocracy/baza.rb)
11
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/zerocracy/baza.rb/blob/master/LICENSE.txt)
12
+
13
+ It's an clinet for [Zerocracy API](https://www.zerocracy.com), in Ruby.
14
+
15
+ ## How to contribute
16
+
17
+ Read
18
+ [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
19
+ Make sure your build is green before you contribute
20
+ your pull request. You will need to have
21
+ [Ruby](https://www.ruby-lang.org/en/) 3.2+ and
22
+ [Bundler](https://bundler.io/) installed. Then:
23
+
24
+ ```bash
25
+ bundle update
26
+ bundle exec rake
27
+ ```
28
+
29
+ If it's clean and you don't see any error messages, submit your pull request.
data/Rakefile ADDED
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2024 Zerocracy
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the 'Software'), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require 'rubygems'
24
+ require 'rake'
25
+ require 'rake/clean'
26
+
27
+ def name
28
+ @name ||= File.basename(Dir['*.gemspec'].first, '.*')
29
+ end
30
+
31
+ def version
32
+ Gem::Specification.load(Dir['*.gemspec'].first).version
33
+ end
34
+
35
+ ENV['RACK_ENV'] = 'test'
36
+
37
+ task default: %i[clean test rubocop yard copyright]
38
+
39
+ require 'rake/testtask'
40
+ desc 'Run all unit tests'
41
+ Rake::TestTask.new(:test) do |test|
42
+ Rake::Cleaner.cleanup_files(['coverage'])
43
+ test.libs << 'lib' << 'test'
44
+ test.pattern = 'test/**/test_*.rb'
45
+ test.warning = true
46
+ test.verbose = false
47
+ end
48
+
49
+ require 'yard'
50
+ desc 'Build Yard documentation'
51
+ YARD::Rake::YardocTask.new do |t|
52
+ t.files = ['lib/**/*.rb']
53
+ end
54
+
55
+ require 'rubocop/rake_task'
56
+ desc 'Run RuboCop on all directories'
57
+ RuboCop::RakeTask.new(:rubocop) do |task|
58
+ task.fail_on_error = true
59
+ task.requires << 'rubocop-rspec'
60
+ end
61
+
62
+ task :copyright do
63
+ sh "grep -q -r '#{Date.today.strftime('%Y')}' \
64
+ --include '*.rb' \
65
+ --include '*.txt' \
66
+ --include 'Rakefile' \
67
+ ."
68
+ end
data/baza.rb.gemspec ADDED
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2024 Zerocracy
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the 'Software'), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require 'English'
24
+ require_relative 'lib/baza/version'
25
+
26
+ Gem::Specification.new do |s|
27
+ s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
28
+ s.required_ruby_version = '>=3.0'
29
+ s.name = 'baza.rb'
30
+ s.version = Baza::VERSION
31
+ s.license = 'MIT'
32
+ s.summary = 'Zerocracy API Ruby Client'
33
+ s.description =
34
+ 'It is a Ruby client for Zerocracy API'
35
+ s.authors = ['Yegor Bugayenko']
36
+ s.email = 'yegor256@gmail.com'
37
+ s.homepage = 'http://github.com/zerocracy/baza.rb'
38
+ s.files = `git ls-files`.split($RS)
39
+ s.rdoc_options = ['--charset=UTF-8']
40
+ s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
41
+ s.add_dependency 'backtrace', '>0'
42
+ s.add_dependency 'faraday', '>0'
43
+ s.add_dependency 'faraday-http-cache', '>0'
44
+ s.add_dependency 'faraday-multipart', '>0'
45
+ s.add_dependency 'faraday-retry', '>0'
46
+ s.add_dependency 'iri', '>0'
47
+ s.add_dependency 'loog', '>0'
48
+ s.add_dependency 'retries', '~>0'
49
+ s.add_dependency 'typhoeus', '~>1.3'
50
+ s.metadata['rubygems_mfa_required'] = 'true'
51
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2024 Zerocracy
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the 'Software'), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require 'tago'
24
+
25
+ def elapsed(loog)
26
+ start = Time.now
27
+ begin
28
+ yield
29
+ rescue UncaughtThrowError => e
30
+ tag = e.tag
31
+ throw e unless tag.is_a?(Symbol)
32
+ loog.info("#{tag} in #{start.ago}")
33
+ end
34
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2024 Zerocracy
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the 'Software'), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ # Just a version.
24
+ #
25
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
26
+ # Copyright:: Copyright (c) 2024 Yegor Bugayenko
27
+ # License:: MIT
28
+ class Baza
29
+ VERSION = '0.0.1'
30
+ end