apipie-rails 0.5.18 → 0.5.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 827ccd7271b49556c90c5bf516ac782ecf7fa38fa380bada85c6ec5c3ac7f5e3
4
- data.tar.gz: e989cb29115cc40c0e1033b4800caef2cc9bccac43a6bffd43f0bb974bc68a5f
3
+ metadata.gz: 444b1aeccaa322d75d64131d2539ae5ecb9ceb3ea984e02c9cfd17a2c80d1190
4
+ data.tar.gz: ddbcdfaee3494a2f35f343a361c9e07b72541b5a75e5e537c0776f8b6c9669e9
5
5
  SHA512:
6
- metadata.gz: e1fae727ae94f9083a1b02984f660ff189e30aa5eee2d9792f3d233cce46472bff8a19b077c3863be167f8738016d96c421b50dbfe3c29604397eb7aa5fbb13d
7
- data.tar.gz: 71df5da3fd578b00518cc2121d2a32a9c664ac681cb52d266412759c25c5a46ef49a5d40e45006ac28f6d1ce8dd1676e0b44589f6b7869e77b2b3d04f4686195
6
+ metadata.gz: 18f5f97fc24bab7aa9c554cd3be305e9bf5eb5266466a79c4484fb0c7f6e4b80912d5ddb224a8ed1dd8d8002c376cd7e30a359ab4f0855d60d404352dc74acb0
7
+ data.tar.gz: 1c66c6990ab997d21e727900a4a36648b76aa08357491007821c4a5f1b46b25f8e48fbb9cdeccfd26f20b1ea268c32c6698f73b040226036b0f5f72fc9447060
data/.gitignore CHANGED
@@ -12,3 +12,4 @@ Gemfile.local
12
12
  .ruby-gemset
13
13
 
14
14
  .DS_Store
15
+ rel-eng/.ipynb_checkpoints
data/.travis.yml CHANGED
@@ -15,6 +15,8 @@ gemfile:
15
15
  - Gemfile.rails42
16
16
  - Gemfile.rails51 # Min ruby 2.2.2
17
17
  - Gemfile.rails60 # Min ruby 2.5.0
18
+ - Gemfile.rails61 # Min ruby 2.5.0
19
+
18
20
  matrix:
19
21
  exclude:
20
22
  - rvm: 2.5.3
@@ -31,3 +33,9 @@ matrix:
31
33
  gemfile: Gemfile.rails60
32
34
  - rvm: 2.4.5
33
35
  gemfile: Gemfile.rails60
36
+ - rvm: 2.2.10
37
+ gemfile: Gemfile.rails61
38
+ - rvm: 2.3.8
39
+ gemfile: Gemfile.rails61
40
+ - rvm: 2.4.5
41
+ gemfile: Gemfile.rails61
data/CHANGELOG.md CHANGED
@@ -1,7 +1,15 @@
1
1
  Changelog
2
2
  ===========
3
+ ## [v0.5.19](https://github.com/Apipie/apipie-rails/tree/v0.5.19) (2021-07-25)
4
+ [Full Changelog](https://github.com/Apipie/apipie-rails/compare/v0.5.18...v0.5.19)
5
+ * Add rel-eng notebook (Oleh Fedorenko)
6
+ * Correct the word parâmentros for brazilian portuguese [#687](https://github.com/Apipie/apipie-rails/pull/687) (Diego Noronha)
7
+ * Fix depreciated file.exists. [#721](https://github.com/Apipie/apipie-rails/pull/721) (Diane Delallée)
8
+ * Fix typo in changelog [#703](https://github.com/Apipie/apipie-rails/pull/703) (Pavel Rodionov)
9
+ * Add rails 6.1 support in doc generation [#702](https://github.com/Apipie/apipie-rails/pull/702) (andrew-newell)
3
10
 
4
- [v0.5.17](https://github.com/Apipie/apipie-rails/tree/v0.5.18) (2020-05-20)
11
+
12
+ [v0.5.18](https://github.com/Apipie/apipie-rails/tree/v0.5.18) (2020-05-20)
5
13
  --------
6
14
 
7
15
  [Full Changelog](https://github.com/Apipie/apipie-rails/compare/v0.5.17...v0.5.18)
data/Gemfile CHANGED
@@ -1 +1 @@
1
- ./Gemfile.rails50
1
+ ./Gemfile.rails61
data/Gemfile.rails61 ADDED
@@ -0,0 +1,10 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem 'rails', '~> 6.1.1'
6
+ gem 'mime-types', '~> 2.99.3'
7
+ gem 'rails-controller-testing'
8
+ gem 'rspec-rails', '~> 4.0.2'
9
+
10
+ gem 'test_engine', path: 'spec/dummy/components/test_engine', group: :test
@@ -16,7 +16,7 @@
16
16
  optional: opcional
17
17
  nil_allowed: nulo permitido
18
18
  param_name: Nome parâmetro
19
- params: Parâmentros
19
+ params: Parâmetros
20
20
  examples: Exemplos
21
21
  metadata: Metadado
22
22
  errors: Erros
@@ -1,3 +1,3 @@
1
1
  module Apipie
2
- VERSION = '0.5.18'
2
+ VERSION = "0.5.19"
3
3
  end
@@ -172,7 +172,12 @@ namespace :apipie do
172
172
  layouts_paths = [File.expand_path("../../../app/views/layouts", __FILE__)]
173
173
  layouts_paths.unshift("#{Rails.root}/app/views/layouts") if File.directory?("#{Rails.root}/app/views/layouts/apipie")
174
174
 
175
- @apipie_renderer = ActionView::Base.new(base_paths + layouts_paths)
175
+ if ActionView::Base.respond_to?(:with_empty_template_cache) && ActionView::Base.respond_to?(:with_view_paths)
176
+ @apipie_renderer = ActionView::Base.with_empty_template_cache.with_view_paths(base_paths + layouts_paths)
177
+ else
178
+ @apipie_renderer = ActionView::Base.new(base_paths + layouts_paths)
179
+ end
180
+
176
181
  @apipie_renderer.singleton_class.send(:include, ApipieHelper)
177
182
  return @apipie_renderer
178
183
  end
@@ -210,14 +215,14 @@ namespace :apipie do
210
215
  end
211
216
 
212
217
  def generate_json_page(file_base, doc, lang = nil)
213
- FileUtils.mkdir_p(file_base) unless File.exists?(file_base)
218
+ FileUtils.mkdir_p(file_base) unless File.exist?(file_base)
214
219
 
215
220
  filename = "schema_apipie#{lang_ext(lang)}.json"
216
221
  File.open("#{file_base}/#{filename}", 'w') { |file| file.write(JSON.pretty_generate(doc)) }
217
222
  end
218
223
 
219
224
  def generate_swagger_json_page(file_base, doc, sfx="", lang = nil)
220
- FileUtils.mkdir_p(file_base) unless File.exists?(file_base)
225
+ FileUtils.mkdir_p(file_base) unless File.exist?(file_base)
221
226
 
222
227
  path = Pathname.new("#{file_base}/schema_swagger#{sfx}#{lang_ext(lang)}.json")
223
228
  File.open(path, 'w') { |file| file.write(JSON.pretty_generate(doc)) }
@@ -226,21 +231,21 @@ namespace :apipie do
226
231
  end
227
232
 
228
233
  def generate_one_page(file_base, doc, lang = nil)
229
- FileUtils.mkdir_p(File.dirname(file_base)) unless File.exists?(File.dirname(file_base))
234
+ FileUtils.mkdir_p(File.dirname(file_base)) unless File.exist?(File.dirname(file_base))
230
235
 
231
236
  render_page("#{file_base}-onepage#{lang_ext(lang)}.html", "static", {:doc => doc[:docs],
232
237
  :language => lang, :languages => Apipie.configuration.languages})
233
238
  end
234
239
 
235
240
  def generate_plain_page(file_base, doc, lang = nil)
236
- FileUtils.mkdir_p(File.dirname(file_base)) unless File.exists?(File.dirname(file_base))
241
+ FileUtils.mkdir_p(File.dirname(file_base)) unless File.exist?(File.dirname(file_base))
237
242
 
238
243
  render_page("#{file_base}-plain#{lang_ext(lang)}.html", "plain", {:doc => doc[:docs],
239
244
  :language => lang, :languages => Apipie.configuration.languages}, nil)
240
245
  end
241
246
 
242
247
  def generate_index_page(file_base, doc, include_json = false, show_versions = false, lang = nil)
243
- FileUtils.mkdir_p(File.dirname(file_base)) unless File.exists?(File.dirname(file_base))
248
+ FileUtils.mkdir_p(File.dirname(file_base)) unless File.exist?(File.dirname(file_base))
244
249
  versions = show_versions && Apipie.available_versions
245
250
  render_page("#{file_base}#{lang_ext(lang)}.html", "index", {:doc => doc[:docs],
246
251
  :versions => versions, :language => lang, :languages => Apipie.configuration.languages})
@@ -251,7 +256,7 @@ namespace :apipie do
251
256
  def generate_resource_pages(version, file_base, doc, include_json = false, lang = nil)
252
257
  doc[:docs][:resources].each do |resource_name, _|
253
258
  resource_file_base = File.join(file_base, resource_name.to_s)
254
- FileUtils.mkdir_p(File.dirname(resource_file_base)) unless File.exists?(File.dirname(resource_file_base))
259
+ FileUtils.mkdir_p(File.dirname(resource_file_base)) unless File.exist?(File.dirname(resource_file_base))
255
260
 
256
261
  doc = Apipie.to_json(version, resource_name, nil, lang)
257
262
  doc[:docs][:link_extension] = (lang ? ".#{lang}.html" : ".html")
@@ -265,7 +270,7 @@ namespace :apipie do
265
270
  doc[:docs][:resources].each do |resource_name, resource_params|
266
271
  resource_params[:methods].each do |method|
267
272
  method_file_base = File.join(file_base, resource_name.to_s, method[:name].to_s)
268
- FileUtils.mkdir_p(File.dirname(method_file_base)) unless File.exists?(File.dirname(method_file_base))
273
+ FileUtils.mkdir_p(File.dirname(method_file_base)) unless File.exist?(File.dirname(method_file_base))
269
274
 
270
275
  doc = Apipie.to_json(version, resource_name, method[:name], lang)
271
276
  doc[:docs][:link_extension] = (lang ? ".#{lang}.html" : ".html")
@@ -329,7 +334,7 @@ MESSAGE
329
334
  desc "Convert your examples from the old yaml into the new json format"
330
335
  task :convert_examples => :environment do
331
336
  yaml_examples_file = File.join(Rails.root, Apipie.configuration.doc_path, "apipie_examples.yml")
332
- if File.exists?(yaml_examples_file)
337
+ if File.exist?(yaml_examples_file)
333
338
  #if SafeYAML gem is enabled, it will load examples as an array of Hash, instead of hash
334
339
  if defined? SafeYAML
335
340
  examples = YAML.load_file(yaml_examples_file, :safe=>false)
@@ -0,0 +1,366 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "## Release of apipie-rails gem\n",
8
+ "\n",
9
+ "### Requirements\n",
10
+ "- push access to https://github.com/Apipie/apipie-rails\n",
11
+ "- push access to rubygems.org for apipie-rails\n",
12
+ "- sudo yum install python-slugify asciidoc\n",
13
+ "- ensure neither the `git push` or `gem push` don't require interractive auth. If you can't use api key or ssh key to auth skip these steps and run them form the shell manually \n",
14
+ "\n",
15
+ "### Release process\n",
16
+ "- Follow the steps with `<Shift>+<Enter>` or `<Ctrl>+<Enter>,<Down>`\n",
17
+ "- If anything fails, fix it and re-run the step if applicable\n",
18
+ "\n",
19
+ "### Release settings"
20
+ ]
21
+ },
22
+ {
23
+ "cell_type": "code",
24
+ "execution_count": null,
25
+ "metadata": {},
26
+ "outputs": [],
27
+ "source": [
28
+ "%cd .."
29
+ ]
30
+ },
31
+ {
32
+ "cell_type": "markdown",
33
+ "metadata": {},
34
+ "source": [
35
+ "### Update the following notebook settings"
36
+ ]
37
+ },
38
+ {
39
+ "cell_type": "code",
40
+ "execution_count": null,
41
+ "metadata": {},
42
+ "outputs": [],
43
+ "source": [
44
+ "NEW_VERSION = '0.5.19'\n",
45
+ "LAST_VERSION = '0.5.18'\n",
46
+ "GIT_REMOTE_UPSTREAM = 'origin'\n",
47
+ "WORK_BRANCH = 'master'\n"
48
+ ]
49
+ },
50
+ {
51
+ "cell_type": "markdown",
52
+ "metadata": {},
53
+ "source": [
54
+ "### Ensure the repo is up to date"
55
+ ]
56
+ },
57
+ {
58
+ "cell_type": "code",
59
+ "execution_count": null,
60
+ "metadata": {},
61
+ "outputs": [],
62
+ "source": [
63
+ "! git checkout {WORK_BRANCH}"
64
+ ]
65
+ },
66
+ {
67
+ "cell_type": "code",
68
+ "execution_count": null,
69
+ "metadata": {},
70
+ "outputs": [],
71
+ "source": [
72
+ "! git fetch {GIT_REMOTE_UPSTREAM}"
73
+ ]
74
+ },
75
+ {
76
+ "cell_type": "code",
77
+ "execution_count": null,
78
+ "metadata": {},
79
+ "outputs": [],
80
+ "source": [
81
+ "! git rebase {GIT_REMOTE_UPSTREAM}/{WORK_BRANCH}"
82
+ ]
83
+ },
84
+ {
85
+ "cell_type": "markdown",
86
+ "metadata": {},
87
+ "source": [
88
+ "### Run tests localy"
89
+ ]
90
+ },
91
+ {
92
+ "cell_type": "code",
93
+ "execution_count": null,
94
+ "metadata": {},
95
+ "outputs": [],
96
+ "source": [
97
+ "! bundle update"
98
+ ]
99
+ },
100
+ {
101
+ "cell_type": "code",
102
+ "execution_count": null,
103
+ "metadata": {
104
+ "scrolled": true
105
+ },
106
+ "outputs": [],
107
+ "source": [
108
+ "! bundle exec rake"
109
+ ]
110
+ },
111
+ {
112
+ "cell_type": "markdown",
113
+ "metadata": {},
114
+ "source": [
115
+ "### Update release related stuff"
116
+ ]
117
+ },
118
+ {
119
+ "cell_type": "code",
120
+ "execution_count": null,
121
+ "metadata": {},
122
+ "outputs": [],
123
+ "source": [
124
+ "! sed -i 's/VERSION = .*/VERSION = \"{NEW_VERSION}\"/' lib/apipie/version.rb"
125
+ ]
126
+ },
127
+ {
128
+ "cell_type": "code",
129
+ "execution_count": null,
130
+ "metadata": {},
131
+ "outputs": [],
132
+ "source": [
133
+ "# Parse git changelog\n",
134
+ "from IPython.display import Markdown as md\n",
135
+ "from subprocess import check_output\n",
136
+ "from shlex import split\n",
137
+ "import re\n",
138
+ "\n",
139
+ "def format_log_entry(entry):\n",
140
+ " author = re.search(r'author:(.*)', entry).group(1)\n",
141
+ " entry = re.sub(r'author:(.*)', '', entry)\n",
142
+ " entry = re.sub(r'([fF]ixes|[rR]efs)[^-]*-\\s*(.*)', r'\\2', entry)\n",
143
+ " entry = '* ' + entry.capitalize()\n",
144
+ " entry = re.sub(r'\\(#([0-9]+)\\)', r'[#\\1](https://github.com/Apipie/apipie-rails/pull/\\1)', entry)\n",
145
+ " entry = entry + f'({author})'\n",
146
+ " return entry\n",
147
+ "\n",
148
+ "def skip(entry):\n",
149
+ " if re.match(r'Merge pull', entry) or \\\n",
150
+ " re.match(r'^i18n', entry) or \\\n",
151
+ " re.match(r'^Bump to version', entry):\n",
152
+ " return True\n",
153
+ " else:\n",
154
+ " return False \n",
155
+ "git_log_cmd = 'git log --pretty=format:\"%%s author:%%an\" v%s..HEAD' % LAST_VERSION\n",
156
+ "log = check_output(split(git_log_cmd)).decode('utf8').split('\\n')\n",
157
+ "change_log = [format_log_entry(e) for e in log if not skip(e)]\n",
158
+ "md('\\n'.join(change_log))\n"
159
+ ]
160
+ },
161
+ {
162
+ "cell_type": "code",
163
+ "execution_count": null,
164
+ "metadata": {},
165
+ "outputs": [],
166
+ "source": [
167
+ "# Write release notes\n",
168
+ "from datetime import datetime\n",
169
+ "import fileinput\n",
170
+ "import sys\n",
171
+ "\n",
172
+ "fh = fileinput.input('CHANGELOG.md', inplace=True) \n",
173
+ "for line in fh: \n",
174
+ " print(line.rstrip())\n",
175
+ " if re.match(r'========', line):\n",
176
+ " print('## [v%s](https://github.com/Apipie/apipie-rails/tree/v%s) (%s)' % (NEW_VERSION, NEW_VERSION, datetime.today().strftime('%Y-%m-%d')))\n",
177
+ " print('[Full Changelog](https://github.com/Apipie/apipie-rails/compare/v%s...v%s)' % (LAST_VERSION, NEW_VERSION))\n",
178
+ " for entry in change_log:\n",
179
+ " print(entry)\n",
180
+ " print('')\n",
181
+ "fh.close() "
182
+ ]
183
+ },
184
+ {
185
+ "cell_type": "markdown",
186
+ "metadata": {},
187
+ "source": [
188
+ "#### Manual step: Update deps in the gemspec if neccessary"
189
+ ]
190
+ },
191
+ {
192
+ "cell_type": "markdown",
193
+ "metadata": {},
194
+ "source": [
195
+ "### Check what is going to be commited"
196
+ ]
197
+ },
198
+ {
199
+ "cell_type": "code",
200
+ "execution_count": null,
201
+ "metadata": {
202
+ "scrolled": false
203
+ },
204
+ "outputs": [],
205
+ "source": [
206
+ "! git add -u\n",
207
+ "! git status"
208
+ ]
209
+ },
210
+ {
211
+ "cell_type": "code",
212
+ "execution_count": null,
213
+ "metadata": {
214
+ "scrolled": true
215
+ },
216
+ "outputs": [],
217
+ "source": [
218
+ "! git diff --cached"
219
+ ]
220
+ },
221
+ {
222
+ "cell_type": "markdown",
223
+ "metadata": {},
224
+ "source": [
225
+ "### Commit changes"
226
+ ]
227
+ },
228
+ {
229
+ "cell_type": "code",
230
+ "execution_count": null,
231
+ "metadata": {
232
+ "scrolled": true
233
+ },
234
+ "outputs": [],
235
+ "source": [
236
+ "! git commit -m \"Bump to {NEW_VERSION}\""
237
+ ]
238
+ },
239
+ {
240
+ "cell_type": "markdown",
241
+ "metadata": {},
242
+ "source": [
243
+ "### Tag new version"
244
+ ]
245
+ },
246
+ {
247
+ "cell_type": "code",
248
+ "execution_count": null,
249
+ "metadata": {},
250
+ "outputs": [],
251
+ "source": [
252
+ "! git tag v{NEW_VERSION}"
253
+ ]
254
+ },
255
+ {
256
+ "cell_type": "markdown",
257
+ "metadata": {},
258
+ "source": [
259
+ "### Build the gem"
260
+ ]
261
+ },
262
+ {
263
+ "cell_type": "code",
264
+ "execution_count": null,
265
+ "metadata": {},
266
+ "outputs": [],
267
+ "source": [
268
+ "! rake build"
269
+ ]
270
+ },
271
+ {
272
+ "cell_type": "code",
273
+ "execution_count": null,
274
+ "metadata": {},
275
+ "outputs": [],
276
+ "source": [
277
+ "! gem push pkg/apipie-rails-{NEW_VERSION}.gem"
278
+ ]
279
+ },
280
+ {
281
+ "cell_type": "markdown",
282
+ "metadata": {},
283
+ "source": [
284
+ "### PUSH the changes upstream If everything is correct"
285
+ ]
286
+ },
287
+ {
288
+ "cell_type": "code",
289
+ "execution_count": null,
290
+ "metadata": {},
291
+ "outputs": [],
292
+ "source": [
293
+ "! git push {GIT_REMOTE_UPSTREAM} {WORK_BRANCH}"
294
+ ]
295
+ },
296
+ {
297
+ "cell_type": "code",
298
+ "execution_count": null,
299
+ "metadata": {},
300
+ "outputs": [],
301
+ "source": [
302
+ "! git push --tags {GIT_REMOTE_UPSTREAM} {WORK_BRANCH}"
303
+ ]
304
+ },
305
+ {
306
+ "cell_type": "markdown",
307
+ "metadata": {},
308
+ "source": [
309
+ "#### Now the new release is in upstream repo"
310
+ ]
311
+ },
312
+ {
313
+ "cell_type": "markdown",
314
+ "metadata": {},
315
+ "source": [
316
+ "### Some manual steps follow to improve the UX\n",
317
+ "\n",
318
+ "#### New relase on GitHub\n",
319
+ "\n",
320
+ "Copy the following changelog lines to the description in form on link below\n",
321
+ "The release title is the new version."
322
+ ]
323
+ },
324
+ {
325
+ "cell_type": "code",
326
+ "execution_count": null,
327
+ "metadata": {},
328
+ "outputs": [],
329
+ "source": [
330
+ "print('\\n')\n",
331
+ "print('\\n'.join(change_log))\n",
332
+ "print('\\n\\nhttps://github.com/Apipie/apipie-rails/releases/new?tag=%s' % NEW_VERSION)"
333
+ ]
334
+ },
335
+ {
336
+ "cell_type": "markdown",
337
+ "metadata": {},
338
+ "source": [
339
+ "## Congratulations\n",
340
+ "\n",
341
+ "Release is public now."
342
+ ]
343
+ }
344
+ ],
345
+ "metadata": {
346
+ "kernelspec": {
347
+ "display_name": "Python 3",
348
+ "language": "python",
349
+ "name": "python3"
350
+ },
351
+ "language_info": {
352
+ "codemirror_mode": {
353
+ "name": "ipython",
354
+ "version": 3
355
+ },
356
+ "file_extension": ".py",
357
+ "mimetype": "text/x-python",
358
+ "name": "python",
359
+ "nbconvert_exporter": "python",
360
+ "pygments_lexer": "ipython3",
361
+ "version": "3.6.8"
362
+ }
363
+ },
364
+ "nbformat": 4,
365
+ "nbformat_minor": 2
366
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apipie-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.18
4
+ version: 0.5.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pokorny
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-05-21 00:00:00.000000000 Z
12
+ date: 2021-07-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -156,6 +156,7 @@ files:
156
156
  - Gemfile.rails50
157
157
  - Gemfile.rails51
158
158
  - Gemfile.rails60
159
+ - Gemfile.rails61
159
160
  - MIT-LICENSE
160
161
  - NOTICE
161
162
  - PROPOSAL_FOR_RESPONSE_DESCRIPTIONS.md
@@ -239,6 +240,7 @@ files:
239
240
  - lib/generators/apipie/install/templates/initializer.rb.erb
240
241
  - lib/generators/apipie/views_generator.rb
241
242
  - lib/tasks/apipie.rake
243
+ - rel-eng/gem_release.ipynb
242
244
  - rel-eng/packages/.readme
243
245
  - rel-eng/packages/rubygem-apipie-rails
244
246
  - rel-eng/tito.props