api-regulator 0.1.4 → 0.1.6
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 +4 -4
- data/Gemfile.lock +63 -62
- data/api-regulator.gemspec +3 -3
- data/lib/api_regulator/version.rb +1 -1
- data/lib/tasks/api_regulator_tasks.rake +9 -8
- metadata +7 -8
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc90df799ef332c90224ad7dc69c09b1382e794bd0d78cce52626ba5417cc937
|
4
|
+
data.tar.gz: 37b309941d4636af0df1db9c3434c6bb559e975d40f70976b27c3d6b928c92d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 737dd5beea6afff1a23a105ff48aa7bbc3718d292e59b5e3c91a7373bd5ec7994281472649f42969beb083027999b9f7874e6da12385a096178c6b32106891c0
|
7
|
+
data.tar.gz: c90270e1edb4a58f0397291ab072224751df8e0ff6a3ebfd3d348f9758a4e4c064177ce371f2d36c761f11ebbfbc5323d5722fe47a2cbbeac779f66033911dce
|
data/Gemfile.lock
CHANGED
@@ -1,73 +1,72 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
api-regulator (0.1.
|
5
|
-
activemodel (~>
|
6
|
-
activesupport (~>
|
4
|
+
api-regulator (0.1.6)
|
5
|
+
activemodel (~> 8.0)
|
6
|
+
activesupport (~> 8.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (
|
12
|
-
actionpack (=
|
13
|
-
activesupport (=
|
11
|
+
actioncable (8.0.1)
|
12
|
+
actionpack (= 8.0.1)
|
13
|
+
activesupport (= 8.0.1)
|
14
14
|
nio4r (~> 2.0)
|
15
15
|
websocket-driver (>= 0.6.1)
|
16
16
|
zeitwerk (~> 2.6)
|
17
|
-
actionmailbox (
|
18
|
-
actionpack (=
|
19
|
-
activejob (=
|
20
|
-
activerecord (=
|
21
|
-
activestorage (=
|
22
|
-
activesupport (=
|
17
|
+
actionmailbox (8.0.1)
|
18
|
+
actionpack (= 8.0.1)
|
19
|
+
activejob (= 8.0.1)
|
20
|
+
activerecord (= 8.0.1)
|
21
|
+
activestorage (= 8.0.1)
|
22
|
+
activesupport (= 8.0.1)
|
23
23
|
mail (>= 2.8.0)
|
24
|
-
actionmailer (
|
25
|
-
actionpack (=
|
26
|
-
actionview (=
|
27
|
-
activejob (=
|
28
|
-
activesupport (=
|
24
|
+
actionmailer (8.0.1)
|
25
|
+
actionpack (= 8.0.1)
|
26
|
+
actionview (= 8.0.1)
|
27
|
+
activejob (= 8.0.1)
|
28
|
+
activesupport (= 8.0.1)
|
29
29
|
mail (>= 2.8.0)
|
30
30
|
rails-dom-testing (~> 2.2)
|
31
|
-
actionpack (
|
32
|
-
actionview (=
|
33
|
-
activesupport (=
|
31
|
+
actionpack (8.0.1)
|
32
|
+
actionview (= 8.0.1)
|
33
|
+
activesupport (= 8.0.1)
|
34
34
|
nokogiri (>= 1.8.5)
|
35
|
-
|
36
|
-
rack (>= 2.2.4, < 3.2)
|
35
|
+
rack (>= 2.2.4)
|
37
36
|
rack-session (>= 1.0.1)
|
38
37
|
rack-test (>= 0.6.3)
|
39
38
|
rails-dom-testing (~> 2.2)
|
40
39
|
rails-html-sanitizer (~> 1.6)
|
41
40
|
useragent (~> 0.16)
|
42
|
-
actiontext (
|
43
|
-
actionpack (=
|
44
|
-
activerecord (=
|
45
|
-
activestorage (=
|
46
|
-
activesupport (=
|
41
|
+
actiontext (8.0.1)
|
42
|
+
actionpack (= 8.0.1)
|
43
|
+
activerecord (= 8.0.1)
|
44
|
+
activestorage (= 8.0.1)
|
45
|
+
activesupport (= 8.0.1)
|
47
46
|
globalid (>= 0.6.0)
|
48
47
|
nokogiri (>= 1.8.5)
|
49
|
-
actionview (
|
50
|
-
activesupport (=
|
48
|
+
actionview (8.0.1)
|
49
|
+
activesupport (= 8.0.1)
|
51
50
|
builder (~> 3.1)
|
52
51
|
erubi (~> 1.11)
|
53
52
|
rails-dom-testing (~> 2.2)
|
54
53
|
rails-html-sanitizer (~> 1.6)
|
55
|
-
activejob (
|
56
|
-
activesupport (=
|
54
|
+
activejob (8.0.1)
|
55
|
+
activesupport (= 8.0.1)
|
57
56
|
globalid (>= 0.3.6)
|
58
|
-
activemodel (
|
59
|
-
activesupport (=
|
60
|
-
activerecord (
|
61
|
-
activemodel (=
|
62
|
-
activesupport (=
|
57
|
+
activemodel (8.0.1)
|
58
|
+
activesupport (= 8.0.1)
|
59
|
+
activerecord (8.0.1)
|
60
|
+
activemodel (= 8.0.1)
|
61
|
+
activesupport (= 8.0.1)
|
63
62
|
timeout (>= 0.4.0)
|
64
|
-
activestorage (
|
65
|
-
actionpack (=
|
66
|
-
activejob (=
|
67
|
-
activerecord (=
|
68
|
-
activesupport (=
|
63
|
+
activestorage (8.0.1)
|
64
|
+
actionpack (= 8.0.1)
|
65
|
+
activejob (= 8.0.1)
|
66
|
+
activerecord (= 8.0.1)
|
67
|
+
activesupport (= 8.0.1)
|
69
68
|
marcel (~> 1.0)
|
70
|
-
activesupport (
|
69
|
+
activesupport (8.0.1)
|
71
70
|
base64
|
72
71
|
benchmark (>= 0.3)
|
73
72
|
bigdecimal
|
@@ -79,6 +78,7 @@ GEM
|
|
79
78
|
minitest (>= 5.1)
|
80
79
|
securerandom (>= 0.3)
|
81
80
|
tzinfo (~> 2.0, >= 2.0.5)
|
81
|
+
uri (>= 0.13.1)
|
82
82
|
base64 (0.2.0)
|
83
83
|
benchmark (0.4.0)
|
84
84
|
bigdecimal (3.1.8)
|
@@ -87,7 +87,7 @@ GEM
|
|
87
87
|
concurrent-ruby (1.3.4)
|
88
88
|
connection_pool (2.4.1)
|
89
89
|
crass (1.0.6)
|
90
|
-
date (3.4.
|
90
|
+
date (3.4.1)
|
91
91
|
diff-lcs (1.5.1)
|
92
92
|
drb (2.2.1)
|
93
93
|
erubi (1.13.0)
|
@@ -112,7 +112,7 @@ GEM
|
|
112
112
|
mini_mime (1.1.5)
|
113
113
|
mini_portile2 (2.8.8)
|
114
114
|
minitest (5.25.4)
|
115
|
-
net-imap (0.5.
|
115
|
+
net-imap (0.5.2)
|
116
116
|
date
|
117
117
|
net-protocol
|
118
118
|
net-pop (0.1.2)
|
@@ -137,20 +137,20 @@ GEM
|
|
137
137
|
rack (>= 1.3)
|
138
138
|
rackup (2.2.1)
|
139
139
|
rack (>= 3)
|
140
|
-
rails (
|
141
|
-
actioncable (=
|
142
|
-
actionmailbox (=
|
143
|
-
actionmailer (=
|
144
|
-
actionpack (=
|
145
|
-
actiontext (=
|
146
|
-
actionview (=
|
147
|
-
activejob (=
|
148
|
-
activemodel (=
|
149
|
-
activerecord (=
|
150
|
-
activestorage (=
|
151
|
-
activesupport (=
|
140
|
+
rails (8.0.1)
|
141
|
+
actioncable (= 8.0.1)
|
142
|
+
actionmailbox (= 8.0.1)
|
143
|
+
actionmailer (= 8.0.1)
|
144
|
+
actionpack (= 8.0.1)
|
145
|
+
actiontext (= 8.0.1)
|
146
|
+
actionview (= 8.0.1)
|
147
|
+
activejob (= 8.0.1)
|
148
|
+
activemodel (= 8.0.1)
|
149
|
+
activerecord (= 8.0.1)
|
150
|
+
activestorage (= 8.0.1)
|
151
|
+
activesupport (= 8.0.1)
|
152
152
|
bundler (>= 1.15.0)
|
153
|
-
railties (=
|
153
|
+
railties (= 8.0.1)
|
154
154
|
rails-dom-testing (2.2.0)
|
155
155
|
activesupport (>= 5.0.0)
|
156
156
|
minitest
|
@@ -158,9 +158,9 @@ GEM
|
|
158
158
|
rails-html-sanitizer (1.6.2)
|
159
159
|
loofah (~> 2.21)
|
160
160
|
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
161
|
-
railties (
|
162
|
-
actionpack (=
|
163
|
-
activesupport (=
|
161
|
+
railties (8.0.1)
|
162
|
+
actionpack (= 8.0.1)
|
163
|
+
activesupport (= 8.0.1)
|
164
164
|
irb (~> 1.13)
|
165
165
|
rackup (>= 1.0.0)
|
166
166
|
rake (>= 12.2)
|
@@ -195,9 +195,10 @@ GEM
|
|
195
195
|
securerandom (0.4.0)
|
196
196
|
stringio (3.1.2)
|
197
197
|
thor (1.3.2)
|
198
|
-
timeout (0.4.
|
198
|
+
timeout (0.4.3)
|
199
199
|
tzinfo (2.0.6)
|
200
200
|
concurrent-ruby (~> 1.0)
|
201
|
+
uri (1.0.2)
|
201
202
|
useragent (0.16.11)
|
202
203
|
websocket-driver (0.7.6)
|
203
204
|
websocket-extensions (>= 0.1.0)
|
@@ -212,7 +213,7 @@ DEPENDENCIES
|
|
212
213
|
api-regulator!
|
213
214
|
bundler (~> 2.5)
|
214
215
|
byebug (= 11.1.3)
|
215
|
-
rails (~>
|
216
|
+
rails (~> 8.0)
|
216
217
|
rake (~> 13.2)
|
217
218
|
rspec (~> 3.0)
|
218
219
|
rspec-rails (~> 5.0)
|
data/api-regulator.gemspec
CHANGED
@@ -37,12 +37,12 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.require_paths = ["lib"]
|
38
38
|
spec.required_ruby_version = ">= 3.0"
|
39
39
|
|
40
|
-
spec.add_runtime_dependency "activesupport", "~>
|
41
|
-
spec.add_runtime_dependency "activemodel", "~>
|
40
|
+
spec.add_runtime_dependency "activesupport", "~> 8.0"
|
41
|
+
spec.add_runtime_dependency "activemodel", "~> 8.0"
|
42
42
|
|
43
43
|
spec.add_development_dependency "bundler", "~> 2.5"
|
44
44
|
spec.add_development_dependency "rake", "~> 13.2"
|
45
|
-
spec.add_development_dependency "rails", "~>
|
45
|
+
spec.add_development_dependency "rails", "~> 8.0"
|
46
46
|
spec.add_development_dependency "rspec", "~> 3.0"
|
47
47
|
spec.add_development_dependency "rspec-rails", "~> 5.0"
|
48
48
|
spec.add_development_dependency "byebug", "11.1.3"
|
@@ -86,14 +86,15 @@ namespace :api_docs do
|
|
86
86
|
|
87
87
|
# Use metadata to build the API request
|
88
88
|
slug = metadata["slug"] || File.basename(file_path, ".md").gsub("_", "-")
|
89
|
-
|
89
|
+
request_body = {
|
90
90
|
type: "basic",
|
91
91
|
categorySlug: "documentation",
|
92
|
-
hidden: false
|
92
|
+
hidden: false,
|
93
|
+
body: body
|
93
94
|
}.merge(metadata)
|
94
|
-
|
95
|
+
request_body["slug"] ||= slug
|
95
96
|
|
96
|
-
raise("Title missing in #{file_path}") unless
|
97
|
+
raise("Title missing in #{file_path}") unless request_body["title"].present?
|
97
98
|
|
98
99
|
# Build the API request
|
99
100
|
if check_if_page_exists(slug)
|
@@ -105,7 +106,7 @@ namespace :api_docs do
|
|
105
106
|
end
|
106
107
|
request["Authorization"] = "Basic #{Base64.strict_encode64(readme_api_key)}"
|
107
108
|
request["Content-Type"] = "application/json"
|
108
|
-
request.body =
|
109
|
+
request.body = request_body.compact.to_json
|
109
110
|
|
110
111
|
# Send the request
|
111
112
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
@@ -115,11 +116,11 @@ namespace :api_docs do
|
|
115
116
|
# Handle the response
|
116
117
|
case response.code.to_i
|
117
118
|
when 200
|
118
|
-
puts "Page '#{
|
119
|
+
puts "Page '#{request_body["title"]}' successfully updated!"
|
119
120
|
when 201
|
120
|
-
puts "Page '#{
|
121
|
+
puts "Page '#{request_body["title"]}' successfully created!"
|
121
122
|
else
|
122
|
-
puts "Failed to upload page '#{
|
123
|
+
puts "Failed to upload page '#{request_body["title"]}'!"
|
123
124
|
puts "Response Code: #{response.code}"
|
124
125
|
puts "Response Body: #{response.body}"
|
125
126
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api-regulator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoff Massanek
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '8.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '8.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activemodel
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '8.0'
|
34
34
|
type: :runtime
|
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: '8.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '8.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '8.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,7 +134,6 @@ files:
|
|
134
134
|
- ".gitignore"
|
135
135
|
- ".rspec"
|
136
136
|
- ".ruby-version"
|
137
|
-
- ".travis.yml"
|
138
137
|
- Gemfile
|
139
138
|
- Gemfile.lock
|
140
139
|
- LICENSE.txt
|