yandex360 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +37 -0
- data/.rubocop.yml +142 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +50 -0
- data/LICENSE +7 -0
- data/README.md +1 -0
- data/Rakefile +16 -0
- data/lib/yandex360/client.rb +29 -0
- data/lib/yandex360/version.rb +8 -0
- data/lib/yandex360.rb +10 -0
- data/yandex360.gemspec +28 -0
- metadata +102 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b11c6de45c29a60108327582acc5bb36035f265d2efa3dcef034149c21cda2dc
|
4
|
+
data.tar.gz: de47f74b9d82709188a8b79d0bf5105b27e45496dbc0f2b2442b739bc02554c8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3933e9edbb6c71d5babd27fdeb46aba720d5f7dc94773fe6843dcf81e037f8feb01af16ee28a25a3494edc56968fbe9afcd73cfe764c6c3c71eb8a7b6d8abf8b
|
7
|
+
data.tar.gz: 4c3e0d3753c47bf4278fa0b013fbc174ee800bf834dbdbb99071cbbcea3e91d96cdb0de4d8e9d01ff2b430607b6f2f315ac09e8b8117e11d2f60e390081bdd6f
|
data/.gitignore
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/test/tmp/
|
9
|
+
/test/version_tmp/
|
10
|
+
/tmp/
|
11
|
+
|
12
|
+
## Specific to RubyMotion:
|
13
|
+
.dat*
|
14
|
+
.repl_history
|
15
|
+
build/
|
16
|
+
|
17
|
+
## Documentation cache and generated files:
|
18
|
+
/.yardoc/
|
19
|
+
/_yardoc/
|
20
|
+
/doc/
|
21
|
+
/rdoc/
|
22
|
+
|
23
|
+
## Environment normalisation:
|
24
|
+
/.bundle/
|
25
|
+
/lib/bundler/man/
|
26
|
+
|
27
|
+
# for a library or gem, you might want to ignore these files since the code is
|
28
|
+
# intended to run in multiple environments; otherwise, check them in:
|
29
|
+
# Gemfile.lock
|
30
|
+
# .ruby-version
|
31
|
+
# .ruby-gemset
|
32
|
+
|
33
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
|
+
.rvmrc
|
35
|
+
|
36
|
+
## macos
|
37
|
+
.DS_Store
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
---
|
2
|
+
AllCops:
|
3
|
+
NewCops: disable # TODO: change to enable after refactoring
|
4
|
+
|
5
|
+
# Commonly used screens these days easily fit more than 80 characters.
|
6
|
+
Layout/LineLength:
|
7
|
+
Max: 120
|
8
|
+
|
9
|
+
# Too short methods lead to extraction of single-use methods, which can make
|
10
|
+
# the code easier to read (by naming things), but can also clutter the class
|
11
|
+
Metrics/MethodLength:
|
12
|
+
Max: 20
|
13
|
+
|
14
|
+
# The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
|
15
|
+
Metrics/ClassLength:
|
16
|
+
Max: 1500
|
17
|
+
|
18
|
+
# No space makes the method definition shorter and differentiates
|
19
|
+
# from a regular assignment.
|
20
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
21
|
+
EnforcedStyle: no_space
|
22
|
+
|
23
|
+
# Single quotes being faster is hardly measurable and only affects parse time.
|
24
|
+
# Enforcing double quotes reduces the times where you need to change them
|
25
|
+
# when introducing an interpolation. Use single quotes only if their semantics
|
26
|
+
# are needed.
|
27
|
+
Style/StringLiterals:
|
28
|
+
EnforcedStyle: double_quotes
|
29
|
+
|
30
|
+
# We do not need to support Ruby 1.9, so this is good to use.
|
31
|
+
Style/SymbolArray:
|
32
|
+
Enabled: true
|
33
|
+
|
34
|
+
# Most readable form.
|
35
|
+
Style/OptionHash:
|
36
|
+
# A list of parameter names that will be flagged by this cop.
|
37
|
+
SuspiciousParamNames:
|
38
|
+
- options
|
39
|
+
- opts
|
40
|
+
- args
|
41
|
+
- paramsgit sttus
|
42
|
+
- parameters
|
43
|
+
|
44
|
+
# Mixing the styles looks just silly.
|
45
|
+
Style/HashSyntax:
|
46
|
+
EnforcedStyle: ruby19_no_mixed_keys
|
47
|
+
|
48
|
+
# has_key? and has_value? are far more readable than key? and value?
|
49
|
+
Style/PreferredHashMethods:
|
50
|
+
Enabled: false
|
51
|
+
|
52
|
+
# String#% is by far the least verbose and only object oriented variant.
|
53
|
+
Style/FormatString:
|
54
|
+
EnforcedStyle: percent
|
55
|
+
|
56
|
+
Style/CollectionMethods:
|
57
|
+
Enabled: true
|
58
|
+
PreferredMethods:
|
59
|
+
# inject seems more common in the community.
|
60
|
+
reduce: "inject"
|
61
|
+
|
62
|
+
|
63
|
+
# Either allow this style or don't. Marking it as safe with parenthesis
|
64
|
+
# is silly. Let's try to live without them for now.
|
65
|
+
Style/ParenthesesAroundCondition:
|
66
|
+
AllowSafeAssignment: false
|
67
|
+
Lint/AssignmentInCondition:
|
68
|
+
AllowSafeAssignment: false
|
69
|
+
|
70
|
+
# A specialized exception class will take one or more arguments and construct the message from it.
|
71
|
+
# So both variants make sense.
|
72
|
+
Style/RaiseArgs:
|
73
|
+
Enabled: false
|
74
|
+
|
75
|
+
# Indenting the chained dots beneath each other is not supported by this cop,
|
76
|
+
# see https://github.com/bbatsov/rubocop/issues/1633
|
77
|
+
Layout/MultilineOperationIndentation:
|
78
|
+
Enabled: false
|
79
|
+
|
80
|
+
# Fail is an alias of raise. Avoid aliases, it's more cognitive load for no gain.
|
81
|
+
# The argument that fail should be used to abort the program is wrong too,
|
82
|
+
# there's Kernel#abort for that.
|
83
|
+
Style/SignalException:
|
84
|
+
EnforcedStyle: only_raise
|
85
|
+
|
86
|
+
# Suppressing exceptions can be perfectly fine, and be it to avoid to
|
87
|
+
# explicitly type nil into the rescue since that's what you want to return,
|
88
|
+
# or suppressing LoadError for optional dependencies
|
89
|
+
Lint/SuppressedException:
|
90
|
+
Enabled: false
|
91
|
+
|
92
|
+
Layout/SpaceInsideBlockBraces:
|
93
|
+
# The space here provides no real gain in readability while consuming
|
94
|
+
# horizontal space that could be used for a better parameter name.
|
95
|
+
# Also {| differentiates better from a hash than { | does.
|
96
|
+
SpaceBeforeBlockParameters: false
|
97
|
+
|
98
|
+
# No trailing space differentiates better from the block:
|
99
|
+
# foo} means hash, foo } means block.
|
100
|
+
Layout/SpaceInsideHashLiteralBraces:
|
101
|
+
EnforcedStyle: no_space
|
102
|
+
|
103
|
+
# { ... } for multi-line blocks is okay, follow Weirichs rule instead:
|
104
|
+
# https://web.archive.org/web/20140221124509/http://onestepback.org/index.cgi/Tech/Ruby/BraceVsDoEnd.rdoc
|
105
|
+
Style/BlockDelimiters:
|
106
|
+
Enabled: false
|
107
|
+
|
108
|
+
# do / end blocks should be used for side effects,
|
109
|
+
# methods that run a block for side effects and have
|
110
|
+
# a useful return value are rare, assign the return
|
111
|
+
# value to a local variable for those cases.
|
112
|
+
Style/MethodCalledOnDoEndBlock:
|
113
|
+
Enabled: true
|
114
|
+
|
115
|
+
# Enforcing the names of variables? To single letter ones? Just no.
|
116
|
+
Style/SingleLineBlockParams:
|
117
|
+
Enabled: false
|
118
|
+
|
119
|
+
# Shadowing outer local variables with block parameters is often useful
|
120
|
+
# to not reinvent a new name for the same thing, it highlights the relation
|
121
|
+
# between the outer variable and the parameter. The cases where it's actually
|
122
|
+
# confusing are rare, and usually bad for other reasons already, for example
|
123
|
+
# because the method is too long.
|
124
|
+
Lint/ShadowingOuterLocalVariable:
|
125
|
+
Enabled: false
|
126
|
+
|
127
|
+
# Check with yard instead.
|
128
|
+
Style/Documentation:
|
129
|
+
Enabled: false
|
130
|
+
|
131
|
+
# This is just silly. Calling the argument `other` in all cases makes no sense.
|
132
|
+
Naming/BinaryOperatorParameterName:
|
133
|
+
Enabled: false
|
134
|
+
|
135
|
+
# There are valid cases, for example debugging Cucumber steps,
|
136
|
+
# also they'll fail CI anyway
|
137
|
+
Lint/Debugger:
|
138
|
+
Enabled: false
|
139
|
+
|
140
|
+
# Style preference
|
141
|
+
Style/MethodDefParentheses:
|
142
|
+
Enabled: false
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
yandex360 (0.0.1)
|
5
|
+
addressable (~> 2.3, >= 2.3.7)
|
6
|
+
faraday (~> 1.7)
|
7
|
+
faraday_middleware (~> 1.1)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
addressable (2.8.1)
|
13
|
+
public_suffix (>= 2.0.2, < 6.0)
|
14
|
+
faraday (1.10.2)
|
15
|
+
faraday-em_http (~> 1.0)
|
16
|
+
faraday-em_synchrony (~> 1.0)
|
17
|
+
faraday-excon (~> 1.1)
|
18
|
+
faraday-httpclient (~> 1.0)
|
19
|
+
faraday-multipart (~> 1.0)
|
20
|
+
faraday-net_http (~> 1.0)
|
21
|
+
faraday-net_http_persistent (~> 1.0)
|
22
|
+
faraday-patron (~> 1.0)
|
23
|
+
faraday-rack (~> 1.0)
|
24
|
+
faraday-retry (~> 1.0)
|
25
|
+
ruby2_keywords (>= 0.0.4)
|
26
|
+
faraday-em_http (1.0.0)
|
27
|
+
faraday-em_synchrony (1.0.0)
|
28
|
+
faraday-excon (1.1.0)
|
29
|
+
faraday-httpclient (1.0.1)
|
30
|
+
faraday-multipart (1.0.4)
|
31
|
+
multipart-post (~> 2)
|
32
|
+
faraday-net_http (1.0.1)
|
33
|
+
faraday-net_http_persistent (1.2.0)
|
34
|
+
faraday-patron (1.0.0)
|
35
|
+
faraday-rack (1.0.0)
|
36
|
+
faraday-retry (1.0.3)
|
37
|
+
faraday_middleware (1.2.0)
|
38
|
+
faraday (~> 1.0)
|
39
|
+
multipart-post (2.2.3)
|
40
|
+
public_suffix (5.0.0)
|
41
|
+
ruby2_keywords (0.0.5)
|
42
|
+
|
43
|
+
PLATFORMS
|
44
|
+
x86_64-darwin-17
|
45
|
+
|
46
|
+
DEPENDENCIES
|
47
|
+
yandex360!
|
48
|
+
|
49
|
+
BUNDLED WITH
|
50
|
+
2.3.22
|
data/LICENSE
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) 2022 Ilya Brin
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# yandex360 - wip
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
10
|
+
end
|
11
|
+
|
12
|
+
task default: :test
|
13
|
+
|
14
|
+
task :console do
|
15
|
+
exec "irb -I lib -r yandex360.rb"
|
16
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Yandex360
|
4
|
+
class Client
|
5
|
+
BASE_URL = "https://api360.yandex.net/"
|
6
|
+
|
7
|
+
attr_reader :token, :adapter
|
8
|
+
|
9
|
+
# new client
|
10
|
+
def initialize(token:, adapter: Faraday.default_adapter, stubs: nil)
|
11
|
+
@token = token
|
12
|
+
@adapter = adapter
|
13
|
+
@stubs = stubs # Test stubs for requests
|
14
|
+
end
|
15
|
+
|
16
|
+
def connection
|
17
|
+
@connection ||= Faraday.new(BASE_URL) do |conn|
|
18
|
+
conn.request :authorization, :OAuth, token
|
19
|
+
conn.request :json
|
20
|
+
conn.request :url_encoded
|
21
|
+
|
22
|
+
conn.response :dates
|
23
|
+
conn.response :json, content_type: "application/json"
|
24
|
+
|
25
|
+
conn.adapter adapter, @stubs
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/yandex360.rb
ADDED
data/yandex360.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
|
6
|
+
require "yandex360/version"
|
7
|
+
|
8
|
+
Gem::Specification.new do |s|
|
9
|
+
s.name = "yandex360"
|
10
|
+
s.version = Yandex360::VERSION
|
11
|
+
s.summary = "WIP - Yandex 360 API client"
|
12
|
+
s.description = "WIP - Yandex 360 API wrapper written in Ruby"
|
13
|
+
s.authors = ["Ilya Brin"]
|
14
|
+
s.email = "ilya@codeplay.ru"
|
15
|
+
s.files = `git ls-files -z`.split("\x0")
|
16
|
+
s.executables = s.files.grep(%r{^bin/}) {|f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.homepage = "https://github.com/ruby-api-client/yandex360"
|
19
|
+
s.license = "MIT"
|
20
|
+
|
21
|
+
s.required_ruby_version = ">= 2.6"
|
22
|
+
|
23
|
+
s.metadata["rubygems_mfa_required"] = "true"
|
24
|
+
|
25
|
+
s.add_dependency "addressable", "~> 2.3", ">= 2.3.7"
|
26
|
+
s.add_dependency "faraday", "~> 1.7"
|
27
|
+
s.add_dependency "faraday_middleware", "~> 1.1"
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: yandex360
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ilya Brin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-10-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: addressable
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.3'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 2.3.7
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.3'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.3.7
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: faraday
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.7'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.7'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: faraday_middleware
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '1.1'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '1.1'
|
61
|
+
description: WIP - Yandex 360 API wrapper written in Ruby
|
62
|
+
email: ilya@codeplay.ru
|
63
|
+
executables: []
|
64
|
+
extensions: []
|
65
|
+
extra_rdoc_files: []
|
66
|
+
files:
|
67
|
+
- ".gitignore"
|
68
|
+
- ".rubocop.yml"
|
69
|
+
- Gemfile
|
70
|
+
- Gemfile.lock
|
71
|
+
- LICENSE
|
72
|
+
- README.md
|
73
|
+
- Rakefile
|
74
|
+
- lib/yandex360.rb
|
75
|
+
- lib/yandex360/client.rb
|
76
|
+
- lib/yandex360/version.rb
|
77
|
+
- yandex360.gemspec
|
78
|
+
homepage: https://github.com/ruby-api-client/yandex360
|
79
|
+
licenses:
|
80
|
+
- MIT
|
81
|
+
metadata:
|
82
|
+
rubygems_mfa_required: 'true'
|
83
|
+
post_install_message:
|
84
|
+
rdoc_options: []
|
85
|
+
require_paths:
|
86
|
+
- lib
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '2.6'
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
requirements: []
|
98
|
+
rubygems_version: 3.2.3
|
99
|
+
signing_key:
|
100
|
+
specification_version: 4
|
101
|
+
summary: WIP - Yandex 360 API client
|
102
|
+
test_files: []
|