ropen_pi 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +64 -64
- data/examples/Gemfile +1 -1
- data/examples/Gemfile.lock +3 -3
- data/lib/generators/ropen_pi/install_generator.rb +7 -6
- data/lib/ropen_pi/config_helper.rb +22 -12
- data/lib/ropen_pi/specs/configuration.rb +32 -28
- data/lib/ropen_pi/version.rb +1 -1
- data/ropen_pi.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceb1dcb570ea80f36d68680a5c320bbb9a74990c782ae03044b7bbb64b8789de
|
4
|
+
data.tar.gz: c2db6c536861712270128ff243a1dce00c588b95eacf33b1e1060f61f169c2f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01d64a2bbaac53fde43fadbc6d07b8bc33d8b3b51da4f377551b485808fb7d30fd8f966b31539efc066ce8591f122307d452cf0e79280a6fee00f5ce86857063
|
7
|
+
data.tar.gz: b06452a57da3d37842e5f2b047f8541d2eee7872c73da33ecb270eca11f6819f8e0c03d949acf9e28b3066eb776a7669f3c035e5bfc4b441821ca1091017bf88
|
data/Gemfile.lock
CHANGED
@@ -1,63 +1,63 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ropen_pi (0.
|
4
|
+
ropen_pi (0.2.0)
|
5
5
|
hashie
|
6
6
|
json-schema
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (6.0.2.
|
12
|
-
actionpack (= 6.0.2.
|
11
|
+
actioncable (6.0.2.2)
|
12
|
+
actionpack (= 6.0.2.2)
|
13
13
|
nio4r (~> 2.0)
|
14
14
|
websocket-driver (>= 0.6.1)
|
15
|
-
actionmailbox (6.0.2.
|
16
|
-
actionpack (= 6.0.2.
|
17
|
-
activejob (= 6.0.2.
|
18
|
-
activerecord (= 6.0.2.
|
19
|
-
activestorage (= 6.0.2.
|
20
|
-
activesupport (= 6.0.2.
|
15
|
+
actionmailbox (6.0.2.2)
|
16
|
+
actionpack (= 6.0.2.2)
|
17
|
+
activejob (= 6.0.2.2)
|
18
|
+
activerecord (= 6.0.2.2)
|
19
|
+
activestorage (= 6.0.2.2)
|
20
|
+
activesupport (= 6.0.2.2)
|
21
21
|
mail (>= 2.7.1)
|
22
|
-
actionmailer (6.0.2.
|
23
|
-
actionpack (= 6.0.2.
|
24
|
-
actionview (= 6.0.2.
|
25
|
-
activejob (= 6.0.2.
|
22
|
+
actionmailer (6.0.2.2)
|
23
|
+
actionpack (= 6.0.2.2)
|
24
|
+
actionview (= 6.0.2.2)
|
25
|
+
activejob (= 6.0.2.2)
|
26
26
|
mail (~> 2.5, >= 2.5.4)
|
27
27
|
rails-dom-testing (~> 2.0)
|
28
|
-
actionpack (6.0.2.
|
29
|
-
actionview (= 6.0.2.
|
30
|
-
activesupport (= 6.0.2.
|
28
|
+
actionpack (6.0.2.2)
|
29
|
+
actionview (= 6.0.2.2)
|
30
|
+
activesupport (= 6.0.2.2)
|
31
31
|
rack (~> 2.0, >= 2.0.8)
|
32
32
|
rack-test (>= 0.6.3)
|
33
33
|
rails-dom-testing (~> 2.0)
|
34
34
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
35
|
-
actiontext (6.0.2.
|
36
|
-
actionpack (= 6.0.2.
|
37
|
-
activerecord (= 6.0.2.
|
38
|
-
activestorage (= 6.0.2.
|
39
|
-
activesupport (= 6.0.2.
|
35
|
+
actiontext (6.0.2.2)
|
36
|
+
actionpack (= 6.0.2.2)
|
37
|
+
activerecord (= 6.0.2.2)
|
38
|
+
activestorage (= 6.0.2.2)
|
39
|
+
activesupport (= 6.0.2.2)
|
40
40
|
nokogiri (>= 1.8.5)
|
41
|
-
actionview (6.0.2.
|
42
|
-
activesupport (= 6.0.2.
|
41
|
+
actionview (6.0.2.2)
|
42
|
+
activesupport (= 6.0.2.2)
|
43
43
|
builder (~> 3.1)
|
44
44
|
erubi (~> 1.4)
|
45
45
|
rails-dom-testing (~> 2.0)
|
46
46
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
47
|
-
activejob (6.0.2.
|
48
|
-
activesupport (= 6.0.2.
|
47
|
+
activejob (6.0.2.2)
|
48
|
+
activesupport (= 6.0.2.2)
|
49
49
|
globalid (>= 0.3.6)
|
50
|
-
activemodel (6.0.2.
|
51
|
-
activesupport (= 6.0.2.
|
52
|
-
activerecord (6.0.2.
|
53
|
-
activemodel (= 6.0.2.
|
54
|
-
activesupport (= 6.0.2.
|
55
|
-
activestorage (6.0.2.
|
56
|
-
actionpack (= 6.0.2.
|
57
|
-
activejob (= 6.0.2.
|
58
|
-
activerecord (= 6.0.2.
|
50
|
+
activemodel (6.0.2.2)
|
51
|
+
activesupport (= 6.0.2.2)
|
52
|
+
activerecord (6.0.2.2)
|
53
|
+
activemodel (= 6.0.2.2)
|
54
|
+
activesupport (= 6.0.2.2)
|
55
|
+
activestorage (6.0.2.2)
|
56
|
+
actionpack (= 6.0.2.2)
|
57
|
+
activejob (= 6.0.2.2)
|
58
|
+
activerecord (= 6.0.2.2)
|
59
59
|
marcel (~> 0.3.1)
|
60
|
-
activesupport (6.0.2.
|
60
|
+
activesupport (6.0.2.2)
|
61
61
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
62
62
|
i18n (>= 0.7, < 2)
|
63
63
|
minitest (~> 5.1)
|
@@ -69,18 +69,18 @@ GEM
|
|
69
69
|
bump (0.8.0)
|
70
70
|
byebug (11.0.1)
|
71
71
|
coderay (1.1.2)
|
72
|
-
concurrent-ruby (1.1.
|
73
|
-
crass (1.0.
|
72
|
+
concurrent-ruby (1.1.6)
|
73
|
+
crass (1.0.6)
|
74
74
|
diff-lcs (1.3)
|
75
75
|
erubi (1.9.0)
|
76
76
|
globalid (0.4.2)
|
77
77
|
activesupport (>= 4.2.0)
|
78
|
-
hashie (4.
|
78
|
+
hashie (4.1.0)
|
79
79
|
i18n (1.8.2)
|
80
80
|
concurrent-ruby (~> 1.0)
|
81
81
|
json-schema (2.8.1)
|
82
82
|
addressable (>= 2.4)
|
83
|
-
loofah (2.
|
83
|
+
loofah (2.5.0)
|
84
84
|
crass (~> 1.0.2)
|
85
85
|
nokogiri (>= 1.5.9)
|
86
86
|
mail (2.7.1)
|
@@ -88,12 +88,12 @@ GEM
|
|
88
88
|
marcel (0.3.3)
|
89
89
|
mimemagic (~> 0.3.2)
|
90
90
|
method_source (0.9.2)
|
91
|
-
mimemagic (0.3.
|
91
|
+
mimemagic (0.3.4)
|
92
92
|
mini_mime (1.0.2)
|
93
93
|
mini_portile2 (2.4.0)
|
94
94
|
minitest (5.14.0)
|
95
95
|
nio4r (2.5.2)
|
96
|
-
nokogiri (1.10.
|
96
|
+
nokogiri (1.10.9)
|
97
97
|
mini_portile2 (~> 2.4.0)
|
98
98
|
pry (0.12.2)
|
99
99
|
coderay (~> 1.1.0)
|
@@ -101,37 +101,37 @@ GEM
|
|
101
101
|
pry-byebug (3.7.0)
|
102
102
|
byebug (~> 11.0)
|
103
103
|
pry (~> 0.10)
|
104
|
-
public_suffix (4.0.
|
105
|
-
rack (2.
|
104
|
+
public_suffix (4.0.4)
|
105
|
+
rack (2.2.2)
|
106
106
|
rack-test (1.1.0)
|
107
107
|
rack (>= 1.0, < 3)
|
108
|
-
rails (6.0.2.
|
109
|
-
actioncable (= 6.0.2.
|
110
|
-
actionmailbox (= 6.0.2.
|
111
|
-
actionmailer (= 6.0.2.
|
112
|
-
actionpack (= 6.0.2.
|
113
|
-
actiontext (= 6.0.2.
|
114
|
-
actionview (= 6.0.2.
|
115
|
-
activejob (= 6.0.2.
|
116
|
-
activemodel (= 6.0.2.
|
117
|
-
activerecord (= 6.0.2.
|
118
|
-
activestorage (= 6.0.2.
|
119
|
-
activesupport (= 6.0.2.
|
108
|
+
rails (6.0.2.2)
|
109
|
+
actioncable (= 6.0.2.2)
|
110
|
+
actionmailbox (= 6.0.2.2)
|
111
|
+
actionmailer (= 6.0.2.2)
|
112
|
+
actionpack (= 6.0.2.2)
|
113
|
+
actiontext (= 6.0.2.2)
|
114
|
+
actionview (= 6.0.2.2)
|
115
|
+
activejob (= 6.0.2.2)
|
116
|
+
activemodel (= 6.0.2.2)
|
117
|
+
activerecord (= 6.0.2.2)
|
118
|
+
activestorage (= 6.0.2.2)
|
119
|
+
activesupport (= 6.0.2.2)
|
120
120
|
bundler (>= 1.3.0)
|
121
|
-
railties (= 6.0.2.
|
121
|
+
railties (= 6.0.2.2)
|
122
122
|
sprockets-rails (>= 2.0.0)
|
123
123
|
rails-dom-testing (2.0.3)
|
124
124
|
activesupport (>= 4.2.0)
|
125
125
|
nokogiri (>= 1.6)
|
126
126
|
rails-html-sanitizer (1.3.0)
|
127
127
|
loofah (~> 2.3)
|
128
|
-
railties (6.0.2.
|
129
|
-
actionpack (= 6.0.2.
|
130
|
-
activesupport (= 6.0.2.
|
128
|
+
railties (6.0.2.2)
|
129
|
+
actionpack (= 6.0.2.2)
|
130
|
+
activesupport (= 6.0.2.2)
|
131
131
|
method_source
|
132
132
|
rake (>= 0.8.7)
|
133
133
|
thor (>= 0.20.3, < 2.0)
|
134
|
-
rake (
|
134
|
+
rake (13.0.1)
|
135
135
|
rspec (3.9.0)
|
136
136
|
rspec-core (~> 3.9.0)
|
137
137
|
rspec-expectations (~> 3.9.0)
|
@@ -154,12 +154,12 @@ GEM
|
|
154
154
|
sprockets (>= 3.0.0)
|
155
155
|
thor (1.0.1)
|
156
156
|
thread_safe (0.3.6)
|
157
|
-
tzinfo (1.2.
|
157
|
+
tzinfo (1.2.7)
|
158
158
|
thread_safe (~> 0.1)
|
159
159
|
websocket-driver (0.7.1)
|
160
160
|
websocket-extensions (>= 0.1.0)
|
161
161
|
websocket-extensions (0.1.4)
|
162
|
-
zeitwerk (2.
|
162
|
+
zeitwerk (2.3.0)
|
163
163
|
|
164
164
|
PLATFORMS
|
165
165
|
ruby
|
@@ -168,8 +168,8 @@ DEPENDENCIES
|
|
168
168
|
bump
|
169
169
|
bundler (~> 2.0)
|
170
170
|
pry-byebug
|
171
|
-
rails (~> 6.0)
|
172
|
-
rake (~>
|
171
|
+
rails (~> 6.0.2.2)
|
172
|
+
rake (~> 13.0)
|
173
173
|
ropen_pi!
|
174
174
|
rspec (~> 3.9)
|
175
175
|
|
data/examples/Gemfile
CHANGED
data/examples/Gemfile.lock
CHANGED
@@ -100,7 +100,7 @@ GEM
|
|
100
100
|
minitest (5.14.0)
|
101
101
|
msgpack (1.3.1)
|
102
102
|
nio4r (2.5.2)
|
103
|
-
nokogiri (1.10.
|
103
|
+
nokogiri (1.10.9)
|
104
104
|
mini_portile2 (~> 2.4.0)
|
105
105
|
parallel (1.19.1)
|
106
106
|
parser (2.7.0.2)
|
@@ -117,7 +117,7 @@ GEM
|
|
117
117
|
pry-stack_explorer (0.4.9.3)
|
118
118
|
binding_of_caller (>= 0.7)
|
119
119
|
pry (>= 0.9.11)
|
120
|
-
puma (4.3.
|
120
|
+
puma (4.3.3)
|
121
121
|
nio4r (~> 2.0)
|
122
122
|
rack (2.1.1)
|
123
123
|
rack-cors (1.1.1)
|
@@ -218,7 +218,7 @@ DEPENDENCIES
|
|
218
218
|
pry-byebug
|
219
219
|
pry-rails
|
220
220
|
pry-stack_explorer
|
221
|
-
puma (~> 4.3.
|
221
|
+
puma (~> 4.3.3)
|
222
222
|
rack-cors (>= 1.0.6)
|
223
223
|
rails (~> 6.0.0)
|
224
224
|
rspec-rails
|
@@ -1,11 +1,12 @@
|
|
1
1
|
require 'rails/generators'
|
2
|
+
module Generators
|
3
|
+
module RopenPi
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path('templates', __dir__)
|
2
6
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
def add_open_api_helper
|
8
|
-
template('ropen_pi_helper.rb', 'spec/ropen_pi_helper.rb')
|
7
|
+
def add_open_api_helper
|
8
|
+
template('ropen_pi_helper.rb', 'spec/ropen_pi_helper.rb')
|
9
|
+
end
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -57,31 +57,36 @@ module RopenPi
|
|
57
57
|
enum: values
|
58
58
|
}
|
59
59
|
end
|
60
|
+
|
61
|
+
class << self
|
62
|
+
alias boolean_param bool_param
|
63
|
+
alias integer_param int_param
|
64
|
+
end
|
60
65
|
end
|
61
66
|
|
62
67
|
module Type
|
63
|
-
def self.date_time_type(opts = {})
|
64
|
-
string_type(opts).merge(format: 'date-time'
|
68
|
+
def self.date_time_type(opts = { example: '2020-02-02' })
|
69
|
+
string_type(opts).merge(format: 'date-time')
|
65
70
|
end
|
66
71
|
|
67
|
-
def self.email_type(opts = {})
|
68
|
-
string_type(opts).merge(format: 'email'
|
72
|
+
def self.email_type(opts = { example: 'han.solo@example.com' })
|
73
|
+
string_type(opts).merge(format: 'email')
|
69
74
|
end
|
70
75
|
|
71
|
-
def self.uuid_type(opts = {})
|
72
|
-
string_type(opts).merge(format: 'uuid'
|
76
|
+
def self.uuid_type(opts = { example: 'abcd12-1234ab-abcdef123' })
|
77
|
+
string_type(opts).merge(format: 'uuid')
|
73
78
|
end
|
74
79
|
|
75
|
-
def self.string_type(opts = {})
|
76
|
-
type('string', opts)
|
80
|
+
def self.string_type(opts = { example: 'Example string' })
|
81
|
+
type('string', opts)
|
77
82
|
end
|
78
83
|
|
79
|
-
def self.integer_type(opts = {})
|
80
|
-
type('integer', opts)
|
84
|
+
def self.integer_type(opts = { example: 1 })
|
85
|
+
type('integer', opts)
|
81
86
|
end
|
82
87
|
|
83
|
-
def self.bool_type(opts = {})
|
84
|
-
type('boolean', opts)
|
88
|
+
def self.bool_type(opts = { example: true })
|
89
|
+
type('boolean', opts)
|
85
90
|
end
|
86
91
|
|
87
92
|
def self.type(thing, opts = {})
|
@@ -98,6 +103,11 @@ module RopenPi
|
|
98
103
|
def self.ref_type(ref)
|
99
104
|
{ '$ref': ref }
|
100
105
|
end
|
106
|
+
|
107
|
+
class << self
|
108
|
+
alias boolean_type bool_type
|
109
|
+
alias int_type integer_type
|
110
|
+
end
|
101
111
|
end
|
102
112
|
|
103
113
|
module Response
|
@@ -1,41 +1,45 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
module RopenPi
|
3
|
+
module Specs
|
4
|
+
class Configuration
|
5
|
+
def initialize(rspec_config)
|
6
|
+
@rspec_config = rspec_config
|
7
|
+
end
|
2
8
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
end
|
9
|
+
def root_dir
|
10
|
+
@root_dir ||= begin
|
11
|
+
raise ConfigurationError, 'No root_dir provided. See open_api_helper.rb' if @rspec_config.root_dir.nil?
|
7
12
|
|
8
|
-
|
9
|
-
|
10
|
-
|
13
|
+
@rspec_config.root_dir
|
14
|
+
end
|
15
|
+
end
|
11
16
|
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
def open_api_output_format
|
18
|
+
@open_api_output_format ||= begin
|
19
|
+
@rspec_config.open_api_output_format || :json
|
20
|
+
end
|
21
|
+
end
|
15
22
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
23
|
+
def open_api_docs
|
24
|
+
@open_api_docs ||= begin
|
25
|
+
if @rspec_config.open_api_docs.nil? || @rspec_config.open_api_docs.empty?
|
26
|
+
raise ConfigurationError, 'No open_api_docs defined. See open_api_helper.rb'
|
27
|
+
end
|
21
28
|
|
22
|
-
|
23
|
-
|
24
|
-
if @rspec_config.open_api_docs.nil? || @rspec_config.open_api_docs.empty?
|
25
|
-
raise ConfigurationError, 'No open_api_docs defined. See open_api_helper.rb'
|
29
|
+
@rspec_config.open_api_docs
|
30
|
+
end
|
26
31
|
end
|
27
32
|
|
28
|
-
|
29
|
-
|
30
|
-
end
|
31
|
-
|
32
|
-
def get_doc(name)
|
33
|
-
return open_api_docs.values.first if name.nil?
|
33
|
+
def get_doc(name)
|
34
|
+
return open_api_docs.values.first if name.nil?
|
34
35
|
|
35
|
-
|
36
|
+
raise ConfigurationError, "Unknown doc '#{name}'" unless open_api_docs[name]
|
36
37
|
|
37
|
-
|
38
|
+
open_api_docs[name]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class ConfigurationError < StandardError; end
|
38
43
|
end
|
39
44
|
end
|
40
45
|
|
41
|
-
class ConfigurationError < StandardError; end
|
data/lib/ropen_pi/version.rb
CHANGED
data/ropen_pi.gemspec
CHANGED
@@ -23,11 +23,11 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler", "~> 2.0"
|
26
|
-
spec.add_development_dependency "rake", "~>
|
26
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
27
27
|
spec.add_development_dependency "rspec", "~> 3.9"
|
28
28
|
spec.add_development_dependency "pry-byebug"
|
29
29
|
spec.add_development_dependency "bump"
|
30
|
-
spec.add_development_dependency "rails", "~> 6.0"
|
30
|
+
spec.add_development_dependency "rails", "~> 6.0.2.2"
|
31
31
|
|
32
32
|
#
|
33
33
|
# spec.add_runtime_dependency "dry_open_api", "~> 0.1.1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ropen_pi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Ruck
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 6.0.2.2
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 6.0.2.2
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: hashie
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|