diff --git a/Gemfile.lock b/Gemfile.lock index d262b7a..9544a3a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,84 +4,113 @@ PATH raddocs (2.3.0) haml (>= 4.0) json - sinatra (~> 2.0) + sinatra (>= 3.0) GEM remote: https://rubygems.org/ specs: - addressable (2.5.1) - public_suffix (~> 2.0, >= 2.0.2) - capybara (2.14.4) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + base64 (0.2.0) + bigdecimal (3.1.9) + capybara (2.18.0) addressable - mime-types (>= 1.16) + mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) - xpath (~> 2.0) - coderay (1.1.1) - diff-lcs (1.3) - haml (5.0.1) - temple (>= 0.8.0) + xpath (>= 2.0, < 4.0) + coderay (1.1.3) + diff-lcs (1.6.1) + haml (6.3.0) + temple (>= 0.8.2) + thor tilt - inch (0.7.1) + inch (0.8.0) pry sparkr (>= 0.2.0) term-ansicolor - yard (~> 0.8.7.5) - json (2.1.0) - kramdown (1.14.0) - method_source (0.8.2) - mime-types (3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - mini_portile2 (2.2.0) - mustermann (1.0.0) - nokogiri (1.8.0) - mini_portile2 (~> 2.2.0) - pry (0.10.4) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - public_suffix (2.0.5) - rack (2.0.3) - rack-protection (2.0.0) - rack - rack-test (0.7.0) + yard (~> 0.9.12) + json (2.10.2) + kramdown (2.5.1) + rexml (>= 3.3.9) + method_source (1.1.0) + mini_mime (1.1.5) + mustermann (3.0.3) + ruby2_keywords (~> 0.0.1) + nokogiri (1.18.7-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.7-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.18.7-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.7-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.18.7-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.7-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.18.7-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.7-x86_64-linux-musl) + racc (~> 1.4) + pry (0.15.2) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (6.0.1) + racc (1.8.1) + rack (2.2.13) + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) + rack-test (0.8.3) rack (>= 1.0, < 3) rake (10.5.0) - rspec (3.6.0) - rspec-core (~> 3.6.0) - rspec-expectations (~> 3.6.0) - rspec-mocks (~> 3.6.0) - rspec-core (3.6.0) - rspec-support (~> 3.6.0) - rspec-expectations (3.6.0) + rexml (3.4.1) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.3) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.6.0) - rspec-mocks (3.6.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.6.0) - rspec-support (3.6.0) - sinatra (2.0.0) - mustermann (~> 1.0) - rack (~> 2.0) - rack-protection (= 2.0.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.2) + ruby2_keywords (0.0.5) + sinatra (3.2.0) + mustermann (~> 3.0) + rack (~> 2.2, >= 2.2.4) + rack-protection (= 3.2.0) tilt (~> 2.0) - slop (3.6.0) sparkr (0.4.1) - temple (0.8.0) - term-ansicolor (1.6.0) + sync (0.5.0) + temple (0.10.3) + term-ansicolor (1.11.2) tins (~> 1.0) - tilt (2.0.8) - tins (1.15.0) - xpath (2.1.0) - nokogiri (~> 1.3) - yard (0.8.7.6) + thor (1.3.2) + tilt (2.6.0) + tins (1.38.0) + bigdecimal + sync + xpath (3.2.0) + nokogiri (~> 1.8) + yard (0.9.37) yard-sinatra (1.0.0) yard (~> 0.7) PLATFORMS - ruby + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-musl + arm64-darwin + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl DEPENDENCIES capybara (~> 2.3) @@ -95,4 +124,4 @@ DEPENDENCIES yard-sinatra BUNDLED WITH - 1.15.3 + 2.6.6 diff --git a/lib/raddocs/app.rb b/lib/raddocs/app.rb index cc169ab..5873636 100644 --- a/lib/raddocs/app.rb +++ b/lib/raddocs/app.rb @@ -8,7 +8,7 @@ class << self end begin - require 'kramdown' + require "kramdown" Raddocs::App.markdown = true rescue LoadError @@ -18,13 +18,13 @@ class << self module Raddocs # Sinatra app that serves all documentation class App < Sinatra::Base - set :haml, :format => :html5 + set :haml, format: :html5, escape_html: false set :root, File.join(File.dirname(__FILE__), "..") # Main index, displays all examples grouped by resource get "/" do index = Index.new(File.join(docs_dir, "index.json")) - haml :index, :locals => { :index => index } + haml :index, locals: { index: index } end # Allows for overriding styles @@ -47,7 +47,7 @@ class App < Sinatra::Base end # Catch all for example pages. - # Loads files from the docs dir and appends '.json'. + # Loads files from the docs dir and appends ".json". # # @example # "/orders/create_an_order" => "docs/api/orders/create_an_order.json" @@ -80,8 +80,8 @@ def url_location def url_prefix url = Raddocs.configuration.url_prefix - return '' if url.to_s.empty? - url.start_with?('/') ? url : "/#{url}" + return "" if url.to_s.empty? + url.start_with?("/") ? url : "/#{url}" end def api_name diff --git a/raddocs.gemspec b/raddocs.gemspec index 49c371e..a4c31ce 100644 --- a/raddocs.gemspec +++ b/raddocs.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |s| s.required_rubygems_version = ">= 1.3.6" - s.add_runtime_dependency "sinatra", "~> 2.0" + s.add_runtime_dependency "sinatra", ">= 3.0" s.add_runtime_dependency "haml", ">= 4.0" s.add_runtime_dependency "json"