Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Jan 26, 2022
0 parents commit 938d658
Show file tree
Hide file tree
Showing 41 changed files with 3,374 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
37 changes: 37 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches:
- main

pull_request:

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
ruby: ['3.1', '3.0', '2.7', '2.6']

steps:
- uses: actions/checkout@v2
with:
persist-credentials: false

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Build gem
run: bundle exec rake

- name: Run RuboCop
run: bundle exec rake rubocop

- name: Run tests
run: bundle exec rake spec
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/rbi/
/spec/reports/
/tmp/

# rspec failure tracking
.rspec_status
12 changes: 12 additions & 0 deletions .parlour
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
parser: false

requires:
- sord

excluded_modules:
- OrkaAPI::AuthMiddleware

plugins:
Sord::ParlourPlugin:
exclude_untyped: yes
rbi: yes
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format documentation
--color
--require spec_helper
76 changes: 76 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
AllCops:
NewCops: enable

Layout/CaseIndentation:
EnforcedStyle: end

Layout/EndAlignment:
EnforcedStyleAlignWith: start_of_line

Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent

Layout/FirstHashElementIndentation:
EnforcedStyle: consistent

Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table

Layout/LineLength:
Max: 118

Metrics/AbcSize:
Max: 50

Metrics/ClassLength:
Max: 500

Metrics/CyclomaticComplexity:
Max: 20

Metrics/MethodLength:
Max: 50

Metrics/ParameterLists:
CountKeywordArgs: false

Style/AndOr:
EnforcedStyle: always

Style/AutoResourceCleanup:
Enabled: true

Style/CollectionMethods:
Enabled: true

Style/MutableConstant:
EnforcedStyle: strict

Style/StringLiterals:
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes

Style/StringMethods:
Enabled: true

Style/SymbolArray:
EnforcedStyle: brackets

Style/TernaryParentheses:
EnforcedStyle: require_parentheses_when_complex

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma

Style/UnlessLogicalOperators:
Enabled: true
EnforcedStyle: forbid_logical_operators
5 changes: 5 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--no-private
lib/orka_api_client/models/attr_predicate.rb
lib/orka_api_client/models/lazy_model.rb
lib/orka_api_client/client.rb
lib/**/*.rb
17 changes: 17 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

source "https://rubygems.org"

# Specify your gem's dependencies in orka_api_client.gemspec
gemspec

gem "parlour"
gem "rake"
gem "rspec"
gem "rubocop"
gem "rubocop-performance"
gem "rubocop-rake"
gem "rubocop-rspec"
gem "sord", git: "https://github.com/AaronC81/sord",
ref: "25c77951f8d20f73ad336e5d0eb13d0eaad14200"
gem "yard"
101 changes: 101 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
GIT
remote: https://github.com/AaronC81/sord
revision: 25c77951f8d20f73ad336e5d0eb13d0eaad14200
ref: 25c77951f8d20f73ad336e5d0eb13d0eaad14200
specs:
sord (3.0.1)
commander (~> 4.5)
parlour (~> 5.0)
sorbet-runtime
yard

PATH
remote: .
specs:
orka_api_client (0.1.0)
faraday (~> 2.0)
faraday-multipart (~> 1.0)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
commander (4.6.0)
highline (~> 2.0.0)
diff-lcs (1.5.0)
faraday (2.1.0)
faraday-net_http (~> 2.0)
ruby2_keywords (>= 0.0.4)
faraday-multipart (1.0.3)
multipart-post (>= 1.2, < 3)
faraday-net_http (2.0.1)
highline (2.0.3)
multipart-post (2.1.1)
parallel (1.21.0)
parlour (5.0.0)
commander (~> 4.5)
parser
rainbow (~> 3.0)
sorbet-runtime (>= 0.5)
parser (3.1.0.0)
ast (~> 2.4.1)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.2.0)
rexml (3.2.5)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.3)
rubocop (1.25.0)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.15.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.15.1)
parser (>= 3.0.1.1)
rubocop-performance (1.13.2)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.8.0)
rubocop (~> 1.19)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.5)
sorbet-runtime (0.5.9566)
unicode-display_width (2.1.0)
webrick (1.7.0)
yard (0.9.27)
webrick (~> 1.7.0)

PLATFORMS
ruby

DEPENDENCIES
orka_api_client!
parlour
rake
rspec
rubocop
rubocop-performance
rubocop-rake
rubocop-rspec
sord!
yard

BUNDLED WITH
2.2.32
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# orka_api_client

This is a Ruby library for interacting with MacStadium's [Orka](https://www.macstadium.com/orka) API.

⚠️⚠️⚠️ **This gem is largely untested beyond basic read-only operations. API stability is not guaranteed at this time.** ⚠️⚠️⚠️

## Installation

**This gem is not yet available on RubyGems.**

Add this line to your application's Gemfile:

```ruby
gem 'orka_api_client', git: "https://github.com/Homebrew/orka_api_client"
```

And then execute:

$ bundle install

## Usage

TODO: examples

Documentation is in the `docs` folder after running `bundle exec rake yard`.

A Sorbet RBI file is available for this gem.

## Development

After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).

RuboCop can be run via `bundle exec rake rubocop`.

## Tests

This is non-existent at the moment. Ideally this would involve a real Orka test environment, but I don't have one readily available that's not already being used for real CI.

When they exist, `bundle exec rake spec` can be used to run the tests.
22 changes: 22 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)

require "rubocop/rake_task"
RuboCop::RakeTask.new

require "yard"
YARD::Rake::YardocTask.new

task build: [:date_epoch, :parlour]
task :date_epoch do
ENV["SOURCE_DATE_EPOCH"] = IO.popen(%W[git -C #{__dir__} log -1 --format=%ct], &:read).chomp
end

task :parlour do
system("bundle exec parlour") || abort
end

task default: :build
15 changes: 15 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "orka_api_client"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start

require "irb"
IRB.start(__FILE__)
8 changes: 8 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

bundle install

# Do any other automated setup that you need to do here
4 changes: 4 additions & 0 deletions lib/orka_api_client.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

require_relative "orka_api_client/version"
require_relative "orka_api_client/client"
Loading

0 comments on commit 938d658

Please sign in to comment.