Skip to content

Commit

Permalink
Merge pull request #1 from zipmark/master
Browse files Browse the repository at this point in the history
Pull in updates from fork source
  • Loading branch information
pgrunde authored May 7, 2024
2 parents a6e0560 + d32bf17 commit 49cddf8
Show file tree
Hide file tree
Showing 17 changed files with 103 additions and 41 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---

name: CI

on: [push, pull_request]

jobs:
test:
name: "Testing"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Recent Rubies and Rails
- ruby-version: '3.2'
- ruby-version: '3.1'
- ruby-version: '3.0'
- ruby-version: '2.7'
- ruby-version: '2.6'
- ruby-version: '2.6'
- ruby-version: '2.7'
- ruby-version: '2.6'
# Old Rubies and Rails
- ruby-version: '2.5'
bundler: '1'
- ruby-version: '2.4'
bundler: '1'
- ruby-version: '2.4'
bundler: '1'
# Failing with a stack trace in active support
# - ruby-version: '2.4'
# rails-version: '4.1'
# bundler: '1'

continue-on-error: "${{ endsWith(matrix.ruby-version, 'head') }}"

env:
CI: "1"

steps:
- name: "Checkout Code"
uses: "actions/checkout@v4"
timeout-minutes: 5
with:
fetch-depth: 0

# - name: Install required libs
# run: |
# sudo apt-get -yqq install libsqlite3-dev

- name: "Build Ruby"
uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby-version }}"
bundler: "${{ matrix.bundler || 2 }}"
bundler-cache: true
# env:
# RAILS_VERSION: ${{ matrix.rails-version }}

- name: "Run tests"
run: |
bundle exec rake
# env:
# RAILS_VERSION: ${{ matrix.rails-version }}
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[![Build Status](https://travis-ci.org/zipmark/rspec_api_documentation.svg?branch=master)](https://travis-ci.org/zipmark/rspec_api_documentation)
[![Code Climate](https://codeclimate.com/github/zipmark/rspec_api_documentation/badges/gpa.svg)](https://codeclimate.com/github/zipmark/rspec_api_documentation)
[![Inline docs](https://inch-ci.org/github/zipmark/rspec_api_documentation.svg?branch=master)](https://inch-ci.org/github/zipmark/rspec_api_documentation)
[![Gem Version](https://badge.fury.io/rb/rspec_api_documentation.svg)](https://badge.fury.io/rb/rspec_api_documentation)
Expand Down
2 changes: 0 additions & 2 deletions features/readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![Travis status](https://secure.travis-ci.org/zipmark/rspec_api_documentation.png)](https://secure.travis-ci.org/zipmark/rspec_api_documentation)

http://github.com/zipmark/rspec_api_documentation

# RSpec API Doc Generator
Expand Down
2 changes: 2 additions & 0 deletions lib/rspec_api_documentation.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
require 'active_support'
require 'active_support/inflector'
require 'active_support/core_ext/array/extract_options'
require 'active_support/core_ext/hash/conversions'
require 'active_support/core_ext/hash/deep_merge'
require 'active_support/core_ext/hash/keys'
require 'cgi'
require 'json'

Expand Down
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/writers/append_json_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Writers
class AppendJsonWriter < JsonWriter
def write
index_file = docs_dir.join("index.json")
if File.exists?(index_file) && (output = File.read(index_file)).length >= 2
if File.exist?(index_file) && (output = File.read(index_file)).length >= 2
existing_index_hash = JSON.parse(output)
end
File.open(index_file, "w+") do |f|
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/writers/writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def self.write(index, configuration)
end

def self.clear_docs(docs_dir)
if File.exists?(docs_dir)
if File.exist?(docs_dir)
FileUtils.rm_rf(docs_dir, :secure => true)
end
FileUtils.mkdir_p(docs_dir)
Expand Down
24 changes: 12 additions & 12 deletions rspec_api_documentation.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ Gem::Specification.new do |s|

s.add_development_dependency "bundler", ">= 1.16"
s.add_development_dependency "fakefs", "~> 0.6.0"
s.add_development_dependency "sinatra", "~> 1.4.7"
s.add_development_dependency "aruba", "~> 0.13.0"
s.add_development_dependency "capybara", "~> 2.6.2"
s.add_development_dependency "rake", "~> 10.5.0"
s.add_development_dependency "sinatra", "~> 2.0.8"
s.add_development_dependency "aruba", "~> 0.14.14"
s.add_development_dependency "capybara", "~> 3.39.2"
s.add_development_dependency "rake", "~> 13.2.1"
s.add_development_dependency "rack-test", "~> 0.6.3"
s.add_development_dependency "rack-oauth2", "~> 1.2.2"
s.add_development_dependency "webmock", "~> 3.8.3"
s.add_development_dependency "rspec-its", "~> 1.2.0"
s.add_development_dependency "faraday", "~> 0.9.2"
s.add_development_dependency "rack-oauth2", "~> 1.12.0"
s.add_development_dependency "webmock", "~> 3.23.0"
s.add_development_dependency "rspec-its", "~> 1.3.0"
s.add_development_dependency "faraday", "~> 1.0.0"
s.add_development_dependency "nokogiri", "~> 1.8.4"
s.add_development_dependency "yard", "~> 0.9.15"
s.add_development_dependency "inch", "~> 0.8.0"
s.add_development_dependency "minitest", "~> 5.8.4"
s.add_development_dependency "contracts", "~> 0.13.0"
s.add_development_dependency "gherkin", "~> 3.2.0"
s.add_development_dependency "multi_json", "~> 1.11.2"
s.add_development_dependency "rspec", "~> 3.4.0"
s.add_development_dependency "contracts", "~> 0.17"
s.add_development_dependency "gherkin", "~> 9.0.0"
s.add_development_dependency "multi_json", "~> 1.15.0"
s.add_development_dependency "rspec", "~> 3.0"

s.files = Dir.glob("lib/**/*") + Dir.glob("templates/**/*")
s.require_path = "lib"
Expand Down
2 changes: 1 addition & 1 deletion spec/api_documentation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
subject.clear_docs

expect(File.directory?(configuration.docs_dir)).to be_truthy
expect(File.exists?(test_file)).to be_falsey
expect(File.exist?(test_file)).to be_falsey
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/views/api_blueprint_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
properties_description: "required, string"
}, {
name: "option",
description: nil,
description: 'Option',
properties_description: 'optional'
}]
expect(post_route_with_optionals[:has_attributes?]).to eq false
Expand All @@ -158,7 +158,7 @@
expect(posts_route[:attributes]).to eq [{
required: false,
name: "description",
description: nil,
description: 'Description',
properties_description: "optional"
}]
end
Expand Down
2 changes: 1 addition & 1 deletion spec/writers/html_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

writer.write
index_file = File.join(configuration.docs_dir, "index.html")
expect(File.exists?(index_file)).to be_truthy
expect(File.exist?(index_file)).to be_truthy
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/writers/json_iodocs_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
it "should write the index" do
writer.write
index_file = File.join(configuration.docs_dir, "apiconfig.json")
expect(File.exists?(index_file)).to be_truthy
expect(File.exist?(index_file)).to be_truthy
end
end
end
2 changes: 1 addition & 1 deletion spec/writers/json_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
it "should write the index" do
writer.write
index_file = File.join(configuration.docs_dir, "index.json")
expect(File.exists?(index_file)).to be_truthy
expect(File.exist?(index_file)).to be_truthy
end
end
end
2 changes: 1 addition & 1 deletion spec/writers/markdown_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

writer.write
index_file = File.join(configuration.docs_dir, "index.md")
expect(File.exists?(index_file)).to be_truthy
expect(File.exist?(index_file)).to be_truthy
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/writers/slate_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

writer.write
index_file = File.join(configuration.docs_dir, "index.html.md")
expect(File.exists?(index_file)).to be_truthy
expect(File.exist?(index_file)).to be_truthy
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/writers/textile_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

writer.write
index_file = File.join(configuration.docs_dir, "index.textile")
expect(File.exists?(index_file)).to be_truthy
expect(File.exist?(index_file)).to be_truthy
end
end
end
Expand Down

0 comments on commit 49cddf8

Please sign in to comment.