kuapir 0.1.2
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 +7 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +77 -0
- data/LICENSE +21 -0
- data/README.md +170 -0
- data/Rakefile +12 -0
- data/docs/BoxOffice.md +26 -0
- data/docs/BoxOfficeResponse.md +20 -0
- data/docs/Company.md +18 -0
- data/docs/Country.md +18 -0
- data/docs/DigitalReleaseItem.md +44 -0
- data/docs/DigitalReleaseResponse.md +22 -0
- data/docs/Distribution.md +28 -0
- data/docs/DistributionResponse.md +20 -0
- data/docs/Episode.md +28 -0
- data/docs/Fact.md +22 -0
- data/docs/FactResponse.md +20 -0
- data/docs/Film.md +100 -0
- data/docs/FilmSearchByFiltersResponse.md +22 -0
- data/docs/FilmSearchByFiltersResponseItems.md +42 -0
- data/docs/FilmSearchResponse.md +24 -0
- data/docs/FilmSearchResponseFilms.md +42 -0
- data/docs/FilmSequelsAndPrequelsResponse.md +30 -0
- data/docs/FilmTopResponse.md +20 -0
- data/docs/FilmTopResponseFilms.md +38 -0
- data/docs/FilmsApi.md +1126 -0
- data/docs/FiltersResponse.md +20 -0
- data/docs/FiltersResponseCountries.md +20 -0
- data/docs/FiltersResponseGenres.md +20 -0
- data/docs/Genre.md +18 -0
- data/docs/ImageResponse.md +22 -0
- data/docs/ImageResponseItems.md +20 -0
- data/docs/PersonByNameResponse.md +20 -0
- data/docs/PersonByNameResponseItems.md +28 -0
- data/docs/PersonResponse.md +50 -0
- data/docs/PersonResponseFilms.md +30 -0
- data/docs/PersonResponseSpouses.md +32 -0
- data/docs/PersonsApi.md +83 -0
- data/docs/PremiereResponse.md +20 -0
- data/docs/PremiereResponseItem.md +36 -0
- data/docs/RelatedFilmResponse.md +20 -0
- data/docs/RelatedFilmResponseItems.md +30 -0
- data/docs/ReviewDetailsResponse.md +32 -0
- data/docs/ReviewsApi.md +155 -0
- data/docs/ReviewsResponse.md +34 -0
- data/docs/ReviewsResponseReviews.md +32 -0
- data/docs/Season.md +20 -0
- data/docs/SeasonResponse.md +20 -0
- data/docs/StaffApi.md +147 -0
- data/docs/StaffResponse.md +30 -0
- data/docs/VideoResponse.md +20 -0
- data/docs/VideoResponseItems.md +22 -0
- data/kinopoiskapiunofficial-openapi.json +2918 -0
- data/kuapir.gemspec +42 -0
- data/lib/kuapir/api/films_api.rb +1193 -0
- data/lib/kuapir/api/persons_api.rb +89 -0
- data/lib/kuapir/api/reviews_api.rb +165 -0
- data/lib/kuapir/api/staff_api.rb +145 -0
- data/lib/kuapir/api_client.rb +390 -0
- data/lib/kuapir/api_error.rb +57 -0
- data/lib/kuapir/configuration.rb +287 -0
- data/lib/kuapir/models/box_office.rb +246 -0
- data/lib/kuapir/models/box_office_response.rb +224 -0
- data/lib/kuapir/models/company.rb +214 -0
- data/lib/kuapir/models/country.rb +214 -0
- data/lib/kuapir/models/digital_release_item.rb +334 -0
- data/lib/kuapir/models/digital_release_response.rb +232 -0
- data/lib/kuapir/models/distribution.rb +300 -0
- data/lib/kuapir/models/distribution_response.rb +224 -0
- data/lib/kuapir/models/episode.rb +249 -0
- data/lib/kuapir/models/fact.rb +266 -0
- data/lib/kuapir/models/fact_response.rb +224 -0
- data/lib/kuapir/models/film.rb +551 -0
- data/lib/kuapir/models/film_search_by_filters_response.rb +232 -0
- data/lib/kuapir/models/film_search_by_filters_response_items.rb +319 -0
- data/lib/kuapir/models/film_search_response.rb +244 -0
- data/lib/kuapir/models/film_search_response_films.rb +311 -0
- data/lib/kuapir/models/film_sequels_and_prequels_response.rb +300 -0
- data/lib/kuapir/models/film_top_response.rb +224 -0
- data/lib/kuapir/models/film_top_response_films.rb +272 -0
- data/lib/kuapir/models/filters_response.rb +226 -0
- data/lib/kuapir/models/filters_response_countries.rb +214 -0
- data/lib/kuapir/models/filters_response_genres.rb +214 -0
- data/lib/kuapir/models/genre.rb +214 -0
- data/lib/kuapir/models/image_response.rb +238 -0
- data/lib/kuapir/models/image_response_items.rb +214 -0
- data/lib/kuapir/models/person_by_name_response.rb +224 -0
- data/lib/kuapir/models/person_by_name_response_items.rb +274 -0
- data/lib/kuapir/models/person_response.rb +363 -0
- data/lib/kuapir/models/person_response_films.rb +284 -0
- data/lib/kuapir/models/person_response_spouses.rb +283 -0
- data/lib/kuapir/models/premiere_response.rb +224 -0
- data/lib/kuapir/models/premiere_response_item.rb +289 -0
- data/lib/kuapir/models/related_film_response.rb +224 -0
- data/lib/kuapir/models/related_film_response_items.rb +279 -0
- data/lib/kuapir/models/review_details_response.rb +314 -0
- data/lib/kuapir/models/reviews_response.rb +294 -0
- data/lib/kuapir/models/reviews_response_reviews.rb +282 -0
- data/lib/kuapir/models/season.rb +224 -0
- data/lib/kuapir/models/season_response.rb +224 -0
- data/lib/kuapir/models/staff_response.rb +301 -0
- data/lib/kuapir/models/video_response.rb +224 -0
- data/lib/kuapir/models/video_response_items.rb +255 -0
- data/lib/kuapir/version.rb +5 -0
- data/lib/kuapir.rb +83 -0
- data/openapi-generator-templates/Gemfile.mustache +9 -0
- data/openapi-generator-templates/README.mustache +148 -0
- data/openapi-generator-templates/Rakefile.mustache +10 -0
- data/openapi-generator-templates/api.mustache +205 -0
- data/openapi-generator-templates/api_client.mustache +260 -0
- data/openapi-generator-templates/api_client_faraday_partial.mustache +136 -0
- data/openapi-generator-templates/api_client_spec.mustache +216 -0
- data/openapi-generator-templates/api_client_typhoeus_partial.mustache +153 -0
- data/openapi-generator-templates/api_doc.mustache +118 -0
- data/openapi-generator-templates/api_error.mustache +45 -0
- data/openapi-generator-templates/api_info.mustache +12 -0
- data/openapi-generator-templates/api_test.mustache +43 -0
- data/openapi-generator-templates/base_object.mustache +120 -0
- data/openapi-generator-templates/configuration.mustache +381 -0
- data/openapi-generator-templates/configuration_spec.mustache +30 -0
- data/openapi-generator-templates/configuration_tls_faraday_partial.mustache +29 -0
- data/openapi-generator-templates/configuration_tls_typhoeus_partial.mustache +34 -0
- data/openapi-generator-templates/gem.mustache +50 -0
- data/openapi-generator-templates/gemspec.mustache +31 -0
- data/openapi-generator-templates/git_push.sh.mustache +57 -0
- data/openapi-generator-templates/gitignore.mustache +39 -0
- data/openapi-generator-templates/model.mustache +22 -0
- data/openapi-generator-templates/model_doc.mustache +12 -0
- data/openapi-generator-templates/model_test.mustache +73 -0
- data/openapi-generator-templates/partial_model_enum_class.mustache +20 -0
- data/openapi-generator-templates/partial_model_generic.mustache +371 -0
- data/openapi-generator-templates/partial_model_generic_doc.mustache +28 -0
- data/openapi-generator-templates/partial_oneof_module.mustache +137 -0
- data/openapi-generator-templates/partial_oneof_module_doc.mustache +92 -0
- data/openapi-generator-templates/rspec.mustache +2 -0
- data/openapi-generator-templates/rubocop.mustache +148 -0
- data/openapi-generator-templates/spec_helper.mustache +99 -0
- data/openapi-generator-templates/travis.mustache +14 -0
- data/openapi-generator-templates/version.mustache +3 -0
- data/openapitools.json +21 -0
- data/spec/api/films_api_spec.rb +227 -0
- data/spec/api/persons_api_spec.rb +45 -0
- data/spec/api/reviews_api_spec.rb +57 -0
- data/spec/api/staff_api_spec.rb +54 -0
- data/spec/api_client_spec.rb +229 -0
- data/spec/configuration_spec.rb +28 -0
- data/spec/models/box_office_response_spec.rb +37 -0
- data/spec/models/box_office_spec.rb +55 -0
- data/spec/models/company_spec.rb +31 -0
- data/spec/models/country_spec.rb +31 -0
- data/spec/models/digital_release_item_spec.rb +109 -0
- data/spec/models/digital_release_response_spec.rb +43 -0
- data/spec/models/distribution_response_spec.rb +37 -0
- data/spec/models/distribution_spec.rb +69 -0
- data/spec/models/episode_spec.rb +61 -0
- data/spec/models/fact_response_spec.rb +37 -0
- data/spec/models/fact_spec.rb +47 -0
- data/spec/models/film_search_by_filters_response_items_spec.rb +107 -0
- data/spec/models/film_search_by_filters_response_spec.rb +43 -0
- data/spec/models/film_search_response_films_spec.rb +107 -0
- data/spec/models/film_search_response_spec.rb +49 -0
- data/spec/models/film_sequels_and_prequels_response_spec.rb +71 -0
- data/spec/models/film_spec.rb +285 -0
- data/spec/models/film_top_response_films_spec.rb +91 -0
- data/spec/models/film_top_response_spec.rb +37 -0
- data/spec/models/filters_response_countries_spec.rb +37 -0
- data/spec/models/filters_response_genres_spec.rb +37 -0
- data/spec/models/filters_response_spec.rb +37 -0
- data/spec/models/genre_spec.rb +31 -0
- data/spec/models/image_response_items_spec.rb +37 -0
- data/spec/models/image_response_spec.rb +43 -0
- data/spec/models/person_by_name_response_items_spec.rb +65 -0
- data/spec/models/person_by_name_response_spec.rb +37 -0
- data/spec/models/person_response_films_spec.rb +71 -0
- data/spec/models/person_response_spec.rb +131 -0
- data/spec/models/person_response_spouses_spec.rb +77 -0
- data/spec/models/premiere_response_item_spec.rb +85 -0
- data/spec/models/premiere_response_spec.rb +37 -0
- data/spec/models/related_film_response_items_spec.rb +71 -0
- data/spec/models/related_film_response_spec.rb +37 -0
- data/spec/models/review_details_response_spec.rb +77 -0
- data/spec/models/reviews_response_reviews_spec.rb +77 -0
- data/spec/models/reviews_response_spec.rb +79 -0
- data/spec/models/season_response_spec.rb +37 -0
- data/spec/models/season_spec.rb +37 -0
- data/spec/models/staff_response_spec.rb +71 -0
- data/spec/models/video_response_items_spec.rb +47 -0
- data/spec/models/video_response_spec.rb +37 -0
- data/spec/spec_helper.rb +107 -0
- metadata +326 -0
@@ -0,0 +1,137 @@
|
|
1
|
+
{{#description}}
|
2
|
+
# {{{.}}}
|
3
|
+
{{/description}}
|
4
|
+
module {{classname}}
|
5
|
+
class << self
|
6
|
+
{{#oneOf}}
|
7
|
+
{{#-first}}
|
8
|
+
# List of class defined in oneOf (OpenAPI v3)
|
9
|
+
def openapi_one_of
|
10
|
+
[
|
11
|
+
{{/-first}}
|
12
|
+
:'{{{.}}}'{{^-last}},{{/-last}}
|
13
|
+
{{#-last}}
|
14
|
+
]
|
15
|
+
end
|
16
|
+
|
17
|
+
{{/-last}}
|
18
|
+
{{/oneOf}}
|
19
|
+
{{#discriminator}}
|
20
|
+
{{#propertyName}}
|
21
|
+
# Discriminator's property name (OpenAPI v3)
|
22
|
+
def openapi_discriminator_name
|
23
|
+
:'{{{.}}}'
|
24
|
+
end
|
25
|
+
|
26
|
+
{{/propertyName}}
|
27
|
+
{{#mappedModels}}
|
28
|
+
{{#-first}}
|
29
|
+
# Discriminator's mapping (OpenAPI v3)
|
30
|
+
def openapi_discriminator_mapping
|
31
|
+
{
|
32
|
+
{{/-first}}
|
33
|
+
:'{{{mappingName}}}' => :'{{{modelName}}}'{{^-last}},{{/-last}}
|
34
|
+
{{#-last}}
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
{{/-last}}
|
39
|
+
{{/mappedModels}}
|
40
|
+
{{/discriminator}}
|
41
|
+
# Builds the object
|
42
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
43
|
+
# @return [Object] Returns the model or the data itself
|
44
|
+
def build(data)
|
45
|
+
{{#discriminator}}
|
46
|
+
discriminator_value = data[openapi_discriminator_name]
|
47
|
+
return nil unless discriminator_value
|
48
|
+
{{#mappedModels}}
|
49
|
+
{{#-first}}
|
50
|
+
|
51
|
+
klass = openapi_discriminator_mapping[discriminator_value.to_sym]
|
52
|
+
return nil unless klass
|
53
|
+
|
54
|
+
{{moduleName}}.const_get(klass).build_from_hash(data)
|
55
|
+
{{/-first}}
|
56
|
+
{{/mappedModels}}
|
57
|
+
{{^mappedModels}}
|
58
|
+
{{moduleName}}.const_get(discriminator_value).build_from_hash(data)
|
59
|
+
{{/mappedModels}}
|
60
|
+
{{/discriminator}}
|
61
|
+
{{^discriminator}}
|
62
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
63
|
+
# Note:
|
64
|
+
# - We do not attempt to check whether exactly one item matches.
|
65
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
66
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
67
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
68
|
+
# - TODO: logging when debugging is set.
|
69
|
+
openapi_one_of.each do |klass|
|
70
|
+
begin
|
71
|
+
next if klass == :AnyType # "nullable: true"
|
72
|
+
typed_data = find_and_cast_into_type(klass, data)
|
73
|
+
return typed_data if typed_data
|
74
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
79
|
+
{{/discriminator}}
|
80
|
+
end
|
81
|
+
{{^discriminator}}
|
82
|
+
|
83
|
+
private
|
84
|
+
|
85
|
+
SchemaMismatchError = Class.new(StandardError)
|
86
|
+
|
87
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
88
|
+
def find_and_cast_into_type(klass, data)
|
89
|
+
return if data.nil?
|
90
|
+
|
91
|
+
case klass.to_s
|
92
|
+
when 'Boolean'
|
93
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
94
|
+
when 'Float'
|
95
|
+
return data if data.instance_of?(Float)
|
96
|
+
when 'Integer'
|
97
|
+
return data if data.instance_of?(Integer)
|
98
|
+
when 'Time'
|
99
|
+
return Time.parse(data)
|
100
|
+
when 'Date'
|
101
|
+
return Date.parse(data)
|
102
|
+
when 'String'
|
103
|
+
return data if data.instance_of?(String)
|
104
|
+
when 'Object' # "type: object"
|
105
|
+
return data if data.instance_of?(Hash)
|
106
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
107
|
+
if data.instance_of?(Array)
|
108
|
+
sub_type = Regexp.last_match[:sub_type]
|
109
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
110
|
+
end
|
111
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
112
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
113
|
+
sub_type = Regexp.last_match[:sub_type]
|
114
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
115
|
+
end
|
116
|
+
else # model
|
117
|
+
const = {{moduleName}}.const_get(klass)
|
118
|
+
if const
|
119
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
120
|
+
model = const.build(data)
|
121
|
+
return model if model
|
122
|
+
else
|
123
|
+
# raise if data contains keys that are not known to the model
|
124
|
+
raise unless (data.keys - const.acceptable_attributes).empty?
|
125
|
+
model = const.build_from_hash(data)
|
126
|
+
return model if model && model.valid?
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
raise # if no match by now, raise
|
132
|
+
rescue
|
133
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
134
|
+
end
|
135
|
+
{{/discriminator}}
|
136
|
+
end
|
137
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# {{moduleName}}::{{classname}}
|
2
|
+
|
3
|
+
## Class instance methods
|
4
|
+
|
5
|
+
### `openapi_one_of`
|
6
|
+
|
7
|
+
Returns the list of classes defined in oneOf.
|
8
|
+
|
9
|
+
#### Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require '{{{gemName}}}'
|
13
|
+
|
14
|
+
{{moduleName}}::{{classname}}.openapi_one_of
|
15
|
+
# =>
|
16
|
+
{{#oneOf}}
|
17
|
+
{{#-first}}
|
18
|
+
# [
|
19
|
+
{{/-first}}
|
20
|
+
# :'{{{.}}}'{{^-last}},{{/-last}}
|
21
|
+
{{#-last}}
|
22
|
+
# ]
|
23
|
+
{{/-last}}
|
24
|
+
{{/oneOf}}
|
25
|
+
```
|
26
|
+
{{#discriminator}}
|
27
|
+
{{#propertyName}}
|
28
|
+
|
29
|
+
### `openapi_discriminator_name`
|
30
|
+
|
31
|
+
Returns the discriminator's property name.
|
32
|
+
|
33
|
+
#### Example
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
require '{{{gemName}}}'
|
37
|
+
|
38
|
+
{{moduleName}}::{{classname}}.openapi_discriminator_name
|
39
|
+
# => :'{{{.}}}'
|
40
|
+
```
|
41
|
+
{{/propertyName}}
|
42
|
+
{{#mappedModels}}
|
43
|
+
{{#-first}}
|
44
|
+
|
45
|
+
### `openapi_discriminator_name`
|
46
|
+
|
47
|
+
Returns the discriminator's mapping.
|
48
|
+
|
49
|
+
#### Example
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
require '{{{gemName}}}'
|
53
|
+
|
54
|
+
{{moduleName}}::{{classname}}.openapi_discriminator_mapping
|
55
|
+
# =>
|
56
|
+
# {
|
57
|
+
{{/-first}}
|
58
|
+
# :'{{{mappingName}}}' => :'{{{modelName}}}'{{^-last}},{{/-last}}
|
59
|
+
{{#-last}}
|
60
|
+
# }
|
61
|
+
{{/-last}}
|
62
|
+
{{/mappedModels}}
|
63
|
+
{{/discriminator}}
|
64
|
+
|
65
|
+
### build
|
66
|
+
|
67
|
+
Find the appropriate object from the `openapi_one_of` list and casts the data into it.
|
68
|
+
|
69
|
+
#### Example
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
require '{{{gemName}}}'
|
73
|
+
|
74
|
+
{{moduleName}}::{{classname}}.build(data)
|
75
|
+
# => {{#oneOf}}{{#-first}}#<{{{.}}}:0x00007fdd4aab02a0>{{/-first}}{{/oneOf}}
|
76
|
+
|
77
|
+
{{moduleName}}::{{classname}}.build(data_that_doesnt_match)
|
78
|
+
# => nil
|
79
|
+
```
|
80
|
+
|
81
|
+
#### Parameters
|
82
|
+
|
83
|
+
| Name | Type | Description |
|
84
|
+
| ---- | ---- | ----------- |
|
85
|
+
| **data** | **Mixed** | data to be matched against the list of oneOf items |
|
86
|
+
|
87
|
+
#### Return type
|
88
|
+
|
89
|
+
{{#oneOf}}
|
90
|
+
- `{{{.}}}`
|
91
|
+
{{/oneOf}}
|
92
|
+
- `nil` (if no type matches)
|
@@ -0,0 +1,148 @@
|
|
1
|
+
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
|
2
|
+
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
|
3
|
+
AllCops:
|
4
|
+
TargetRubyVersion: 2.4
|
5
|
+
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
6
|
+
# to ignore them, so only the ones explicitly set in this file are enabled.
|
7
|
+
DisabledByDefault: true
|
8
|
+
Exclude:
|
9
|
+
- '**/templates/**/*'
|
10
|
+
- '**/vendor/**/*'
|
11
|
+
- 'actionpack/lib/action_dispatch/journey/parser.rb'
|
12
|
+
|
13
|
+
# Prefer &&/|| over and/or.
|
14
|
+
Style/AndOr:
|
15
|
+
Enabled: true
|
16
|
+
|
17
|
+
# Align `when` with `case`.
|
18
|
+
Layout/CaseIndentation:
|
19
|
+
Enabled: true
|
20
|
+
|
21
|
+
# Align comments with method definitions.
|
22
|
+
Layout/CommentIndentation:
|
23
|
+
Enabled: true
|
24
|
+
|
25
|
+
Layout/ElseAlignment:
|
26
|
+
Enabled: true
|
27
|
+
|
28
|
+
Layout/EmptyLineAfterMagicComment:
|
29
|
+
Enabled: true
|
30
|
+
|
31
|
+
# In a regular class definition, no empty lines around the body.
|
32
|
+
Layout/EmptyLinesAroundClassBody:
|
33
|
+
Enabled: true
|
34
|
+
|
35
|
+
# In a regular method definition, no empty lines around the body.
|
36
|
+
Layout/EmptyLinesAroundMethodBody:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
# In a regular module definition, no empty lines around the body.
|
40
|
+
Layout/EmptyLinesAroundModuleBody:
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
Layout/FirstArgumentIndentation:
|
44
|
+
Enabled: true
|
45
|
+
|
46
|
+
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
47
|
+
Style/HashSyntax:
|
48
|
+
Enabled: false
|
49
|
+
|
50
|
+
# Method definitions after `private` or `protected` isolated calls need one
|
51
|
+
# extra level of indentation.
|
52
|
+
Layout/IndentationConsistency:
|
53
|
+
Enabled: true
|
54
|
+
EnforcedStyle: indented_internal_methods
|
55
|
+
|
56
|
+
# Two spaces, no tabs (for indentation).
|
57
|
+
Layout/IndentationWidth:
|
58
|
+
Enabled: true
|
59
|
+
|
60
|
+
Layout/LeadingCommentSpace:
|
61
|
+
Enabled: true
|
62
|
+
|
63
|
+
Layout/SpaceAfterColon:
|
64
|
+
Enabled: true
|
65
|
+
|
66
|
+
Layout/SpaceAfterComma:
|
67
|
+
Enabled: true
|
68
|
+
|
69
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
70
|
+
Enabled: true
|
71
|
+
|
72
|
+
Layout/SpaceAroundKeyword:
|
73
|
+
Enabled: true
|
74
|
+
|
75
|
+
Layout/SpaceAroundOperators:
|
76
|
+
Enabled: true
|
77
|
+
|
78
|
+
Layout/SpaceBeforeComma:
|
79
|
+
Enabled: true
|
80
|
+
|
81
|
+
Layout/SpaceBeforeFirstArg:
|
82
|
+
Enabled: true
|
83
|
+
|
84
|
+
Style/DefWithParentheses:
|
85
|
+
Enabled: true
|
86
|
+
|
87
|
+
# Defining a method with parameters needs parentheses.
|
88
|
+
Style/MethodDefParentheses:
|
89
|
+
Enabled: true
|
90
|
+
|
91
|
+
Style/FrozenStringLiteralComment:
|
92
|
+
Enabled: false
|
93
|
+
EnforcedStyle: always
|
94
|
+
|
95
|
+
# Use `foo {}` not `foo{}`.
|
96
|
+
Layout/SpaceBeforeBlockBraces:
|
97
|
+
Enabled: true
|
98
|
+
|
99
|
+
# Use `foo { bar }` not `foo {bar}`.
|
100
|
+
Layout/SpaceInsideBlockBraces:
|
101
|
+
Enabled: true
|
102
|
+
|
103
|
+
# Use `{ a: 1 }` not `{a:1}`.
|
104
|
+
Layout/SpaceInsideHashLiteralBraces:
|
105
|
+
Enabled: true
|
106
|
+
|
107
|
+
Layout/SpaceInsideParens:
|
108
|
+
Enabled: true
|
109
|
+
|
110
|
+
# Check quotes usage according to lint rule below.
|
111
|
+
#Style/StringLiterals:
|
112
|
+
# Enabled: true
|
113
|
+
# EnforcedStyle: single_quotes
|
114
|
+
|
115
|
+
# Detect hard tabs, no hard tabs.
|
116
|
+
Layout/IndentationStyle:
|
117
|
+
Enabled: true
|
118
|
+
|
119
|
+
# Blank lines should not have any spaces.
|
120
|
+
Layout/TrailingEmptyLines:
|
121
|
+
Enabled: true
|
122
|
+
|
123
|
+
# No trailing whitespace.
|
124
|
+
Layout/TrailingWhitespace:
|
125
|
+
Enabled: false
|
126
|
+
|
127
|
+
# Use quotes for string literals when they are enough.
|
128
|
+
Style/RedundantPercentQ:
|
129
|
+
Enabled: true
|
130
|
+
|
131
|
+
# Align `end` with the matching keyword or starting expression except for
|
132
|
+
# assignments, where it should be aligned with the LHS.
|
133
|
+
Layout/EndAlignment:
|
134
|
+
Enabled: true
|
135
|
+
EnforcedStyleAlignWith: variable
|
136
|
+
AutoCorrect: true
|
137
|
+
|
138
|
+
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
139
|
+
Lint/RequireParentheses:
|
140
|
+
Enabled: true
|
141
|
+
|
142
|
+
Style/RedundantReturn:
|
143
|
+
Enabled: true
|
144
|
+
AllowMultipleReturnValues: true
|
145
|
+
|
146
|
+
Style/Semicolon:
|
147
|
+
Enabled: true
|
148
|
+
AllowAsExpressionSeparator: true
|
@@ -0,0 +1,99 @@
|
|
1
|
+
# load the gem
|
2
|
+
require '{{{gemName}}}'
|
3
|
+
|
4
|
+
# The following was generated by the `rspec --init` command. Conventionally, all
|
5
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
6
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
7
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
8
|
+
# files.
|
9
|
+
#
|
10
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
11
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
12
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
13
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
14
|
+
# a separate helper file that requires the additional dependencies and performs
|
15
|
+
# the additional setup, and require it from the spec files that actually need
|
16
|
+
# it.
|
17
|
+
#
|
18
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
19
|
+
# users commonly want.
|
20
|
+
#
|
21
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
22
|
+
RSpec.configure do |config|
|
23
|
+
# rspec-expectations config goes here. You can use an alternate
|
24
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
25
|
+
# assertions if you prefer.
|
26
|
+
config.expect_with :rspec do |expectations|
|
27
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
28
|
+
# and `failure_message` of custom matchers include text for helper methods
|
29
|
+
# defined using `chain`, e.g.:
|
30
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
31
|
+
# # => "be bigger than 2 and smaller than 4"
|
32
|
+
# ...rather than:
|
33
|
+
# # => "be bigger than 2"
|
34
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
35
|
+
end
|
36
|
+
|
37
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
38
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
39
|
+
config.mock_with :rspec do |mocks|
|
40
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
41
|
+
# a real object. This is generally recommended, and will default to
|
42
|
+
# `true` in RSpec 4.
|
43
|
+
mocks.verify_partial_doubles = true
|
44
|
+
end
|
45
|
+
|
46
|
+
# The settings below are suggested to provide a good initial experience
|
47
|
+
# with RSpec, but feel free to customize to your heart's content.
|
48
|
+
=begin
|
49
|
+
# These two settings work together to allow you to limit a spec run
|
50
|
+
# to individual examples or groups you care about by tagging them with
|
51
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
52
|
+
# get run.
|
53
|
+
config.filter_run :focus
|
54
|
+
config.run_all_when_everything_filtered = true
|
55
|
+
|
56
|
+
# Allows RSpec to persist some state between runs in order to support
|
57
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
58
|
+
# you configure your source control system to ignore this file.
|
59
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
60
|
+
|
61
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
62
|
+
# recommended. For more details, see:
|
63
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
64
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
65
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
66
|
+
config.disable_monkey_patching!
|
67
|
+
|
68
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
69
|
+
# be too noisy due to issues in dependencies.
|
70
|
+
config.warnings = true
|
71
|
+
|
72
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
73
|
+
# file, and it's useful to allow more verbose output when running an
|
74
|
+
# individual spec file.
|
75
|
+
if config.files_to_run.one?
|
76
|
+
# Use the documentation formatter for detailed output,
|
77
|
+
# unless a formatter has already been configured
|
78
|
+
# (e.g. via a command-line flag).
|
79
|
+
config.default_formatter = 'doc'
|
80
|
+
end
|
81
|
+
|
82
|
+
# Print the 10 slowest examples and example groups at the
|
83
|
+
# end of the spec run, to help surface which specs are running
|
84
|
+
# particularly slow.
|
85
|
+
config.profile_examples = 10
|
86
|
+
|
87
|
+
# Run specs in random order to surface order dependencies. If you find an
|
88
|
+
# order dependency and want to debug it, you can fix the order by providing
|
89
|
+
# the seed, which is printed after each run.
|
90
|
+
# --seed 1234
|
91
|
+
config.order = :random
|
92
|
+
|
93
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
94
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
95
|
+
# test failures related to randomization by passing the same `--seed` value
|
96
|
+
# as the one that triggered the failure.
|
97
|
+
Kernel.srand config.seed
|
98
|
+
=end
|
99
|
+
end
|
data/openapitools.json
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
3
|
+
"spaces": 2,
|
4
|
+
"generator-cli": {
|
5
|
+
"version": "5.3.1",
|
6
|
+
"generators":{
|
7
|
+
"v2.0": {
|
8
|
+
"generatorName": "ruby",
|
9
|
+
"output": "./",
|
10
|
+
"templateDir": "./openapi-generator-templates",
|
11
|
+
"inputSpec": "./kinopoiskapiunofficial-openapi.json",
|
12
|
+
"additionalProperties": {
|
13
|
+
"gemAuthor": "Alexey Zhuravlev",
|
14
|
+
"gemAuthorEmail": "alexey.g.zhuravlev@gmail.com",
|
15
|
+
"gemRequiredRubyVersion": ">= 2.7",
|
16
|
+
"moduleName": "Kuapir"
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|