betterdocs 0.6.5 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semaphore/semaphore.yml +26 -0
- data/.tool-versions +1 -0
- data/README.md +4 -4
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/betterdocs.gemspec +20 -31
- data/lib/betterdocs/dsl/json_params/param.rb +1 -3
- data/lib/betterdocs/dsl/json_type_mapper.rb +1 -1
- data/lib/betterdocs/dsl/result/property.rb +1 -1
- data/lib/betterdocs/generator/markdown/templates/section.md.erb +0 -2
- data/lib/betterdocs/representer.rb +1 -1
- data/lib/betterdocs/result_representer.rb +1 -1
- data/lib/betterdocs/version.rb +1 -1
- metadata +12 -12
- data/.travis.yml +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84f61a235deb0348813dd4ccfc102e41e08ce374b3bcc7d48991935d08f1ce17
|
4
|
+
data.tar.gz: dee9b3cfb105cea04192377d5f1b11306aee02da2165bc85c78eeaa2d239089c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca0afd3ada7b6852b0dda51e73457f37144b0c851fba52da52177ab81f76d22afe9f322b17f9e5a1d5fb965c7c0c4d0439a708fc112dd18de474880a2b97c711
|
7
|
+
data.tar.gz: c095d79714edc2c0cc66eae7bd7c76b4f6791d989f20826a0081e6c7661d928744dfd260d4be03884a6955bcfbffcbe1639fc52b02993b952e0f06c75b9b5117
|
@@ -0,0 +1,26 @@
|
|
1
|
+
version: v1.0
|
2
|
+
name: Betterdocs pipeline
|
3
|
+
agent:
|
4
|
+
machine:
|
5
|
+
type: e1-standard-2
|
6
|
+
os_image: ubuntu1804
|
7
|
+
|
8
|
+
blocks:
|
9
|
+
- name: "Unit Tests"
|
10
|
+
task:
|
11
|
+
env_vars:
|
12
|
+
# Matches the configuration used in sem-service
|
13
|
+
- name: RAILS_ENV
|
14
|
+
value: test
|
15
|
+
jobs:
|
16
|
+
- name: RSpec
|
17
|
+
commands:
|
18
|
+
- checkout
|
19
|
+
|
20
|
+
# Setup ruby
|
21
|
+
- sem-version ruby $(awk '/^ruby/ { print $2 }' .tool-versions)
|
22
|
+
|
23
|
+
# Setup gems
|
24
|
+
- bundle config set path 'vendor/bundle'
|
25
|
+
- bundle install
|
26
|
+
- bundle exec rake spec
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.0.1
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Betterdocs API Documentation
|
|
6
6
|
DESCRIPTION
|
7
7
|
-----------
|
8
8
|
|
9
|
-
This library can be used to document a
|
9
|
+
This library can be used to document a Rails-based API.
|
10
10
|
|
11
11
|
LICENSE
|
12
12
|
-------
|
@@ -40,12 +40,12 @@ This api generator requires that you follow the [representer pattern](http://nic
|
|
40
40
|
end
|
41
41
|
|
42
42
|
response do
|
43
|
-
generate_fake_result_with_representer
|
43
|
+
generate_fake_result_with_representer
|
44
44
|
end
|
45
45
|
end
|
46
46
|
# :nocov:
|
47
47
|
def index
|
48
|
-
render json: real_result_with_representer
|
48
|
+
render json: real_result_with_representer
|
49
49
|
end
|
50
50
|
|
51
51
|
# :nocov: Documentation
|
@@ -68,7 +68,7 @@ This api generator requires that you follow the [representer pattern](http://nic
|
|
68
68
|
end
|
69
69
|
# :nocov:
|
70
70
|
def show
|
71
|
-
render json: real_result_with_representer
|
71
|
+
render json: real_result_with_representer
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.7.1
|
data/betterdocs.gemspec
CHANGED
@@ -1,57 +1,46 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: betterdocs 0.
|
2
|
+
# stub: betterdocs 0.7.1 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "betterdocs".freeze
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.7.1"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["betterplace Developers".freeze]
|
11
|
-
s.date = "
|
11
|
+
s.date = "2021-06-01"
|
12
12
|
s.description = "This library provides tools to generate API documention for a web site's REST-ful JSON API.".freeze
|
13
13
|
s.email = "developers@betterplace.org".freeze
|
14
14
|
s.extra_rdoc_files = ["README.md".freeze, "lib/betterdocs.rb".freeze, "lib/betterdocs/controller_collector.rb".freeze, "lib/betterdocs/dsl.rb".freeze, "lib/betterdocs/dsl/common.rb".freeze, "lib/betterdocs/dsl/controller.rb".freeze, "lib/betterdocs/dsl/controller/action.rb".freeze, "lib/betterdocs/dsl/controller/action/param.rb".freeze, "lib/betterdocs/dsl/controller/action/response.rb".freeze, "lib/betterdocs/dsl/controller/controller.rb".freeze, "lib/betterdocs/dsl/controller/controller_base.rb".freeze, "lib/betterdocs/dsl/json_params.rb".freeze, "lib/betterdocs/dsl/json_params/param.rb".freeze, "lib/betterdocs/dsl/json_type_mapper.rb".freeze, "lib/betterdocs/dsl/naming.rb".freeze, "lib/betterdocs/dsl/representer.rb".freeze, "lib/betterdocs/dsl/result.rb".freeze, "lib/betterdocs/dsl/result/collection_property.rb".freeze, "lib/betterdocs/dsl/result/link.rb".freeze, "lib/betterdocs/dsl/result/property.rb".freeze, "lib/betterdocs/generator/config_shortcuts.rb".freeze, "lib/betterdocs/generator/markdown.rb".freeze, "lib/betterdocs/global.rb".freeze, "lib/betterdocs/json_params_representer.rb".freeze, "lib/betterdocs/json_params_representer_collector.rb".freeze, "lib/betterdocs/json_time_with_zone.rb".freeze, "lib/betterdocs/mix_into_controller.rb".freeze, "lib/betterdocs/railtie.rb".freeze, "lib/betterdocs/rake_tasks.rb".freeze, "lib/betterdocs/representer.rb".freeze, "lib/betterdocs/result_representer.rb".freeze, "lib/betterdocs/result_representer_collector.rb".freeze, "lib/betterdocs/sanitizer.rb".freeze, "lib/betterdocs/section.rb".freeze, "lib/betterdocs/version.rb".freeze]
|
15
|
-
s.files = [".codeclimate.yml".freeze, ".gitignore".freeze, ".rspec".freeze, ".
|
15
|
+
s.files = [".codeclimate.yml".freeze, ".gitignore".freeze, ".rspec".freeze, ".semaphore/semaphore.yml".freeze, ".tool-versions".freeze, "COPYING".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "betterdocs.gemspec".freeze, "lib/betterdocs.rb".freeze, "lib/betterdocs/controller_collector.rb".freeze, "lib/betterdocs/dsl.rb".freeze, "lib/betterdocs/dsl/common.rb".freeze, "lib/betterdocs/dsl/controller.rb".freeze, "lib/betterdocs/dsl/controller/action.rb".freeze, "lib/betterdocs/dsl/controller/action/param.rb".freeze, "lib/betterdocs/dsl/controller/action/response.rb".freeze, "lib/betterdocs/dsl/controller/controller.rb".freeze, "lib/betterdocs/dsl/controller/controller_base.rb".freeze, "lib/betterdocs/dsl/json_params.rb".freeze, "lib/betterdocs/dsl/json_params/param.rb".freeze, "lib/betterdocs/dsl/json_type_mapper.rb".freeze, "lib/betterdocs/dsl/naming.rb".freeze, "lib/betterdocs/dsl/representer.rb".freeze, "lib/betterdocs/dsl/result.rb".freeze, "lib/betterdocs/dsl/result/collection_property.rb".freeze, "lib/betterdocs/dsl/result/link.rb".freeze, "lib/betterdocs/dsl/result/property.rb".freeze, "lib/betterdocs/generator/config_shortcuts.rb".freeze, "lib/betterdocs/generator/markdown.rb".freeze, "lib/betterdocs/generator/markdown/templates/README.md.erb".freeze, "lib/betterdocs/generator/markdown/templates/section.md.erb".freeze, "lib/betterdocs/global.rb".freeze, "lib/betterdocs/json_params_representer.rb".freeze, "lib/betterdocs/json_params_representer_collector.rb".freeze, "lib/betterdocs/json_time_with_zone.rb".freeze, "lib/betterdocs/mix_into_controller.rb".freeze, "lib/betterdocs/railtie.rb".freeze, "lib/betterdocs/rake_tasks.rb".freeze, "lib/betterdocs/representer.rb".freeze, "lib/betterdocs/result_representer.rb".freeze, "lib/betterdocs/result_representer_collector.rb".freeze, "lib/betterdocs/sanitizer.rb".freeze, "lib/betterdocs/section.rb".freeze, "lib/betterdocs/tasks/doc.rake".freeze, "lib/betterdocs/version.rb".freeze, "spec/assets/app/assets/images/logos/logo.png".freeze, "spec/assets/app/controllers/api/foos_controller.rb".freeze, "spec/assets/app/views/api_v4/documentation/assets/CHANGELOG.md".freeze, "spec/assets/config/betterdocs.yml".freeze, "spec/betterdocs/dsl/controller/action/param_spec.rb".freeze, "spec/betterdocs/dsl/controller/action/response_spec.rb".freeze, "spec/betterdocs/dsl/json_type_mapper_spec.rb".freeze, "spec/betterdocs/dsl/result/collection_property_spec.rb".freeze, "spec/betterdocs/dsl/result/link_spec.rb".freeze, "spec/betterdocs/dsl/result/property_spec.rb".freeze, "spec/betterdocs/generator/markdown_spec.rb".freeze, "spec/betterdocs/global_spec.rb".freeze, "spec/betterdocs/json_params_representer_spec.rb".freeze, "spec/betterdocs/result_representer_spec.rb".freeze, "spec/betterdocs/sanitizer_spec.rb".freeze, "spec/controller_dsl_spec.rb".freeze, "spec/result_representer_dsl_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
16
16
|
s.homepage = "http://github.com/betterplace/betterdocs".freeze
|
17
17
|
s.rdoc_options = ["--title".freeze, "Betterdocs".freeze, "--main".freeze, "README.md".freeze]
|
18
|
-
s.rubygems_version = "2.
|
18
|
+
s.rubygems_version = "3.2.15".freeze
|
19
19
|
s.summary = "Betterplace API documentation library".freeze
|
20
20
|
s.test_files = ["spec/assets/app/controllers/api/foos_controller.rb".freeze, "spec/betterdocs/dsl/controller/action/param_spec.rb".freeze, "spec/betterdocs/dsl/controller/action/response_spec.rb".freeze, "spec/betterdocs/dsl/json_type_mapper_spec.rb".freeze, "spec/betterdocs/dsl/result/collection_property_spec.rb".freeze, "spec/betterdocs/dsl/result/link_spec.rb".freeze, "spec/betterdocs/dsl/result/property_spec.rb".freeze, "spec/betterdocs/generator/markdown_spec.rb".freeze, "spec/betterdocs/global_spec.rb".freeze, "spec/betterdocs/json_params_representer_spec.rb".freeze, "spec/betterdocs/result_representer_spec.rb".freeze, "spec/betterdocs/sanitizer_spec.rb".freeze, "spec/controller_dsl_spec.rb".freeze, "spec/result_representer_dsl_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
21
21
|
|
22
22
|
if s.respond_to? :specification_version then
|
23
23
|
s.specification_version = 4
|
24
|
+
end
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
else
|
37
|
-
s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.9.1"])
|
38
|
-
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
39
|
-
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
40
|
-
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
41
|
-
s.add_dependency(%q<tins>.freeze, [">= 1.3.5", "~> 1.3"])
|
42
|
-
s.add_dependency(%q<rails>.freeze, ["< 6", ">= 3"])
|
43
|
-
s.add_dependency(%q<term-ansicolor>.freeze, ["~> 1.3"])
|
44
|
-
s.add_dependency(%q<complex_config>.freeze, ["~> 0.5"])
|
45
|
-
s.add_dependency(%q<infobar>.freeze, [">= 0"])
|
46
|
-
s.add_dependency(%q<mize>.freeze, [">= 0"])
|
47
|
-
end
|
26
|
+
if s.respond_to? :add_runtime_dependency then
|
27
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.11.0"])
|
28
|
+
s.add_development_dependency(%q<rake>.freeze, [">= 0"])
|
29
|
+
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
30
|
+
s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
|
31
|
+
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.3", ">= 1.3.5"])
|
32
|
+
s.add_runtime_dependency(%q<rails>.freeze, [">= 3", "< 7"])
|
33
|
+
s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.3"])
|
34
|
+
s.add_runtime_dependency(%q<complex_config>.freeze, ["~> 0.5"])
|
35
|
+
s.add_runtime_dependency(%q<infobar>.freeze, [">= 0"])
|
36
|
+
s.add_runtime_dependency(%q<mize>.freeze, [">= 0"])
|
48
37
|
else
|
49
|
-
s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.
|
38
|
+
s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.11.0"])
|
50
39
|
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
51
40
|
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
52
41
|
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
53
|
-
s.add_dependency(%q<tins>.freeze, ["
|
54
|
-
s.add_dependency(%q<rails>.freeze, ["
|
42
|
+
s.add_dependency(%q<tins>.freeze, ["~> 1.3", ">= 1.3.5"])
|
43
|
+
s.add_dependency(%q<rails>.freeze, [">= 3", "< 7"])
|
55
44
|
s.add_dependency(%q<term-ansicolor>.freeze, ["~> 1.3"])
|
56
45
|
s.add_dependency(%q<complex_config>.freeze, ["~> 0.5"])
|
57
46
|
s.add_dependency(%q<infobar>.freeze, [">= 0"])
|
@@ -25,9 +25,7 @@ class Betterdocs::Dsl::JsonParams::Param < Betterdocs::Dsl::Representer
|
|
25
25
|
|
26
26
|
def compute_value(object)
|
27
27
|
value = object.__send__(name)
|
28
|
-
|
29
|
-
value.extend Betterdocs::JsonTimeWithZone
|
30
|
-
end
|
28
|
+
value.respond_to?(:iso8601) and value.extend Betterdocs::JsonTimeWithZone
|
31
29
|
value
|
32
30
|
end
|
33
31
|
|
@@ -13,7 +13,7 @@ module Betterdocs::Dsl::JsonTypeMapper
|
|
13
13
|
String => 'string',
|
14
14
|
}.find { |match_class, json_type|
|
15
15
|
match_class >= klass and break json_type
|
16
|
-
}
|
16
|
+
} or raise TypeError, "Invalid type #{klass} encountered. Use a type that can be mapped to JSON instead."
|
17
17
|
end
|
18
18
|
|
19
19
|
def map_types(types)
|
@@ -46,7 +46,7 @@ class Betterdocs::Dsl::Result::Property < Betterdocs::Dsl::Representer
|
|
46
46
|
value.nil? and return
|
47
47
|
if represent_with
|
48
48
|
represent_with.hashify(value)
|
49
|
-
elsif
|
49
|
+
elsif value.respond_to?(:iso8601)
|
50
50
|
value.extend Betterdocs::JsonTimeWithZone
|
51
51
|
else
|
52
52
|
sanitizer.sanitize(value)
|
data/lib/betterdocs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: betterdocs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- betterplace Developers
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.11.0
|
20
20
|
type: :development
|
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: 1.
|
26
|
+
version: 1.11.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
version: '3'
|
96
96
|
- - "<"
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: '
|
98
|
+
version: '7'
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
101
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -105,7 +105,7 @@ dependencies:
|
|
105
105
|
version: '3'
|
106
106
|
- - "<"
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
108
|
+
version: '7'
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: term-ansicolor
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
@@ -207,7 +207,8 @@ files:
|
|
207
207
|
- ".codeclimate.yml"
|
208
208
|
- ".gitignore"
|
209
209
|
- ".rspec"
|
210
|
-
- ".
|
210
|
+
- ".semaphore/semaphore.yml"
|
211
|
+
- ".tool-versions"
|
211
212
|
- COPYING
|
212
213
|
- Gemfile
|
213
214
|
- LICENSE
|
@@ -273,7 +274,7 @@ files:
|
|
273
274
|
homepage: http://github.com/betterplace/betterdocs
|
274
275
|
licenses: []
|
275
276
|
metadata: {}
|
276
|
-
post_install_message:
|
277
|
+
post_install_message:
|
277
278
|
rdoc_options:
|
278
279
|
- "--title"
|
279
280
|
- Betterdocs
|
@@ -292,9 +293,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
292
293
|
- !ruby/object:Gem::Version
|
293
294
|
version: '0'
|
294
295
|
requirements: []
|
295
|
-
|
296
|
-
|
297
|
-
signing_key:
|
296
|
+
rubygems_version: 3.2.15
|
297
|
+
signing_key:
|
298
298
|
specification_version: 4
|
299
299
|
summary: Betterplace API documentation library
|
300
300
|
test_files:
|