betterdocs 0.6.3 → 0.6.4

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
- SHA1:
3
- metadata.gz: 216f75ecf87c41da9ec13bb62a946de65839a77a
4
- data.tar.gz: 2f2244e06ddc76639ec03c0ecc33b5fb5751a6ab
2
+ SHA256:
3
+ metadata.gz: b72c9031a9c65d2a521d8bf7f17d10d129045b38f64a34f3f8a7ec101e78cc76
4
+ data.tar.gz: 37cda0506b30141bbaa3c6718e0c0bdec8845eef22458a8ea4da65e55b3cbd82
5
5
  SHA512:
6
- metadata.gz: 883f75f2f66a58bea23eb4ec1335c94f83d81c2af3d98a59be59e98bbbb277a5d5f240ef9e270c0feb1972018af45214107962dbae45b18565840894081ece01
7
- data.tar.gz: 3bbc6ad20711efa84664cbf4194e5fc17d811b3d19257c23a1f79b65eafce54b2ccedf13c08e6608c832f6a6eec56d253921452a385b6a924938c4633b0913dc
6
+ metadata.gz: ceb308776379d1cf4f6afa24ca1773e13ff3a90ce6b2cbf61b4e806bb3334742a2f61901c9308d56e7f9429ce8042cb7629f38b949d47cc13b8df3b4149a1b4e
7
+ data.tar.gz: aef1fac10d1a584a0e9d95e8894822e6ddfa1d060052bf5da233c7730d60c8a6323194cd476fc6d3982cd172e34af2eeb08effa1249bfdc4281067889d84b575
@@ -1,3 +1,9 @@
1
+ before_install:
2
+ - gem update --system
3
+ - gem update bundler
4
+
1
5
  rvm:
2
- - 2.4.0
6
+ - 2.4.3
7
+ - 2.5.0
8
+
3
9
  sudo: false
data/Rakefile CHANGED
@@ -22,6 +22,7 @@ GemHadar do
22
22
  dependency 'complex_config', '~>0.5'
23
23
  dependency 'infobar'
24
24
  dependency 'mize'
25
+ development_dependency 'rake'
25
26
  development_dependency 'simplecov'
26
27
  development_dependency 'rspec'
27
28
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.3
1
+ 0.6.4
@@ -1,21 +1,21 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: betterdocs 0.6.3 ruby lib
2
+ # stub: betterdocs 0.6.4 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "betterdocs".freeze
6
- s.version = "0.6.3"
6
+ s.version = "0.6.4"
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 = "2017-08-18"
11
+ s.date = "2018-10-10"
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
15
  s.files = [".codeclimate.yml".freeze, ".gitignore".freeze, ".rspec".freeze, ".travis.yml".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.6.11".freeze
18
+ s.rubygems_version = "2.7.7".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
 
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
24
24
 
25
25
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
26
  s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.9.1"])
27
+ s.add_development_dependency(%q<rake>.freeze, [">= 0"])
27
28
  s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
28
29
  s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
29
30
  s.add_runtime_dependency(%q<tins>.freeze, [">= 1.3.5", "~> 1.3"])
@@ -34,6 +35,7 @@ Gem::Specification.new do |s|
34
35
  s.add_runtime_dependency(%q<mize>.freeze, [">= 0"])
35
36
  else
36
37
  s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.9.1"])
38
+ s.add_dependency(%q<rake>.freeze, [">= 0"])
37
39
  s.add_dependency(%q<simplecov>.freeze, [">= 0"])
38
40
  s.add_dependency(%q<rspec>.freeze, [">= 0"])
39
41
  s.add_dependency(%q<tins>.freeze, [">= 1.3.5", "~> 1.3"])
@@ -45,6 +47,7 @@ Gem::Specification.new do |s|
45
47
  end
46
48
  else
47
49
  s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.9.1"])
50
+ s.add_dependency(%q<rake>.freeze, [">= 0"])
48
51
  s.add_dependency(%q<simplecov>.freeze, [">= 0"])
49
52
  s.add_dependency(%q<rspec>.freeze, [">= 0"])
50
53
  s.add_dependency(%q<tins>.freeze, [">= 1.3.5", "~> 1.3"])
@@ -2,6 +2,8 @@ class Betterdocs::Dsl::Controller::Action::Response
2
2
  include Betterdocs::Dsl::Common
3
3
  extend Tins::DSLAccessor
4
4
 
5
+ class Error < StandardError; end
6
+
5
7
  def initialize(name = :default, &block)
6
8
  @name = name.to_sym
7
9
  @data_block = block || proc {}
@@ -15,6 +17,10 @@ class Betterdocs::Dsl::Controller::Action::Response
15
17
 
16
18
  def data
17
19
  @data ||= instance_eval(&@data_block)
20
+ rescue => e
21
+ error = Error.new("#{e.class}: #{e}")
22
+ error.set_backtrace e.backtrace.grep(/^#{Betterdocs.rails.root}/)
23
+ raise error
18
24
  end
19
25
 
20
26
  def properties
@@ -88,11 +88,14 @@ module Betterdocs
88
88
  private
89
89
 
90
90
  def fail_while_rendering(template, exception)
91
- message = blink(color(231, on_color(
92
- 124, " *** ERROR #{exception.class}: #{exception.message.inspect} in template ***")))
93
- infobar.puts message
94
- infobar.puts color(88, on_color(136, template)), message,
95
- color(136, (%w[Backtrace:] + exception.backtrace) * "\n"),
91
+ message = color(
92
+ 231,
93
+ on_color( 124, " *** ERROR #{exception.class}: #{exception.message.inspect} in template ***")
94
+ )
95
+ unless Betterdocs::Dsl::Controller::Action::Response::Error === exception
96
+ infobar.puts color(88, on_color(136, template))
97
+ end
98
+ infobar.puts color(136, (%w[Location:] + exception.backtrace) * "\n"),
96
99
  message
97
100
  exit 1
98
101
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # <%= action.title %>
4
4
 
5
- ```Rebol
5
+ ```Cirru
6
6
  <%= action.request %>
7
7
  ```
8
8
 
@@ -1,6 +1,6 @@
1
1
  module Betterdocs
2
2
  # Betterdocs version
3
- VERSION = '0.6.3'
3
+ VERSION = '0.6.4'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
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.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - betterplace Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-18 00:00:00.000000000 Z
11
+ date: 2018-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.9.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: simplecov
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -279,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
293
  version: '0'
280
294
  requirements: []
281
295
  rubyforge_project:
282
- rubygems_version: 2.6.11
296
+ rubygems_version: 2.7.7
283
297
  signing_key:
284
298
  specification_version: 4
285
299
  summary: Betterplace API documentation library