Skip to content

Commit 77720ef

Browse files
authored
Local dev setup (#4)
* Ignore local ide files * Use github actions for CI * Add rubocop
1 parent eafef01 commit 77720ef

22 files changed

+479
-364
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
name: Build
3+
4+
on: [push]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
ruby: ['2.4', '2.5', '2.6', '2.x']
12+
name: Test gem in ruby version ${{ matrix.ruby }}
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Ruby ${{ matrix.ruby }}
16+
uses: actions/setup-ruby@v1
17+
with:
18+
ruby-version: ${{ matrix.ruby }}
19+
- name: Build with dependencies
20+
run: |
21+
gem install bundler -v 2.1
22+
bundle install
23+
- name: Test with rspec
24+
run: |
25+
bundle exec rspec spec/
26+
# TODO: finish fixing cops
27+
# - name: Lint with rubocop
28+
# run: |
29+
# bundle exec rubocop

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@
1212
/vendor/bundle
1313
/open_api_parser*.gem
1414
/bin
15+
16+
.tool-versions

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
inherit_from: .rubocop_todo.yml

.rubocop_todo.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2020-04-09 14:12:08 -0700 using RuboCop version 0.76.0.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 1
10+
# Configuration parameters: Include.
11+
# Include: **/*.gemspec,
12+
Gemspec/RequiredRubyVersion:
13+
Exclude:
14+
- 'open_api_parser.gemspec'
15+
16+
# Offense count: 2
17+
Lint/ShadowingOuterLocalVariable:
18+
Exclude:
19+
- 'lib/open_api_parser/specification/endpoint.rb'
20+
- 'lib/open_api_parser/specification/root.rb'
21+
22+
# Offense count: 3
23+
Metrics/AbcSize:
24+
Max: 23
25+
26+
# Offense count: 20
27+
# Configuration parameters: CountComments, ExcludedMethods.
28+
# ExcludedMethods: refine
29+
Metrics/BlockLength:
30+
Max: 273
31+
32+
# Offense count: 1
33+
# Configuration parameters: CountComments.
34+
Metrics/ClassLength:
35+
Max: 118
36+
37+
# Offense count: 4
38+
# Configuration parameters: CountComments, ExcludedMethods.
39+
Metrics/MethodLength:
40+
Max: 19
41+
42+
# Offense count: 7
43+
Style/Documentation:
44+
Exclude:
45+
- 'spec/**/*'
46+
- 'test/**/*'
47+
- 'lib/open_api_parser/document.rb'
48+
- 'lib/open_api_parser/file_cache.rb'
49+
- 'lib/open_api_parser/pointer.rb'
50+
- 'lib/open_api_parser/reference.rb'
51+
- 'lib/open_api_parser/specification.rb'
52+
- 'lib/open_api_parser/specification/endpoint.rb'
53+
- 'lib/open_api_parser/specification/root.rb'
54+
55+
# Offense count: 63
56+
# Cop supports --auto-correct.
57+
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
58+
# URISchemes: http, https
59+
Metrics/LineLength:
60+
Max: 118

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24

35
gemspec

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OpenApiParser
22

3-
[![Build Status](https://travis-ci.org/braintree/open_api_parser.svg?branch=master)](https://travis-ci.org/braintree/open_api_parser)
3+
![Build Status](https://github.com/adamrdavid/open_api_parser/workflows/Build/badge.svg)
44

55
A gem for parsing [Open API](https://openapis.org/) specifications.
66

Rakefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
require "bundler/gem_tasks"
2-
require "rspec/core/rake_task"
1+
# frozen_string_literal: true
2+
3+
require 'bundler/gem_tasks'
4+
require 'rspec/core/rake_task'
35

46
RSpec::Core::RakeTask.new(:spec)
57

6-
task :default => :spec
8+
task default: :spec

bin/console

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

3-
require "bundler/setup"
4-
require "open_api_parser"
4+
require 'bundler/setup'
5+
require 'open_api_parser'
56

6-
require "irb"
7+
require 'irb'
78
IRB.start

lib/open_api_parser.rb

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
require "json"
2-
require "uri"
3-
require "yaml"
1+
# frozen_string_literal: true
42

5-
require "addressable/uri"
6-
require "json-schema"
3+
require 'json'
4+
require 'uri'
5+
require 'yaml'
76

8-
require "open_api_parser/document"
9-
require "open_api_parser/file_cache"
10-
require "open_api_parser/pointer"
11-
require "open_api_parser/reference"
12-
require "open_api_parser/specification"
13-
require "open_api_parser/specification/endpoint"
14-
require "open_api_parser/specification/root"
15-
require "open_api_parser/version"
7+
require 'addressable/uri'
8+
require 'json-schema'
9+
10+
require 'open_api_parser/document'
11+
require 'open_api_parser/file_cache'
12+
require 'open_api_parser/pointer'
13+
require 'open_api_parser/reference'
14+
require 'open_api_parser/specification'
15+
require 'open_api_parser/specification/endpoint'
16+
require 'open_api_parser/specification/root'
17+
require 'open_api_parser/version'

0 commit comments

Comments
 (0)