Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
- next

jobs:
lint:
name: lint
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: '3.1'

- name: Run lints
run: ./scripts/lint
test:
name: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: '3.1'

- name: Run tests
run: ./scripts/test

30 changes: 30 additions & 0 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to rubygems.org in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/orbcorp/orb-python/actions/workflows/publish-gem.yml
name: Publish Gem
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
ruby-version: '3.1'

- name: Publish to RubyGems.org
run: |
bash ./bin/publish-gem
env:
# `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org
RUBYGEMS_HOST: ${{ secrets.ORB_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
GEM_HOST_API_KEY: ${{ secrets.ORB_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}
22 changes: 22 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release Doctor
on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
release_doctor:
name: release doctor
runs-on: ubuntu-latest
if: github.repository == 'orbcorp/orb-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4

- name: Check release environment
run: |
bash ./bin/check-release-environment
env:
RUBYGEMS_HOST: ${{ secrets.ORB_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
GEM_HOST_API_KEY: ${{ secrets.ORB_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.prism.log
.idea/
.ruby-lsp/
.yardoc/
doc/
sorbet/
bin/
Brewfile.lock.json
*.gem
Empty file removed .gitkeep
Empty file.
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0-alpha.1"
}
194 changes: 194 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# Just to be safe, ensure nobody is mutating our internal strings.
Style/FrozenStringLiteralComment:
EnforcedStyle: always
Exclude:
- '**/*.rbi'

# And/or have confusing precedence, avoid them.
Style/AndOr:
EnforcedStyle: always

# Prefer double quotes so that interpolation can be easily added.
Style/StringLiterals:
EnforcedStyle: double_quotes

# Most common style in Ruby.
Style/RegexpLiteral:
EnforcedStyle: slashes

# Prefer explicit symbols for clarity; you can search for `:the_symbol`.
Style/SymbolArray:
EnforcedStyle: brackets

# Prefer consistency in method calling syntax
Style/MethodCallWithArgsParentheses:
Enabled: true
Exclude:
- '**/*.gemspec'
AllowedMethods:
- raise

# Nothing wrong with inline private methods
Style/AccessModifierDeclarations:
Enabled: false

# Nothing wrong with clear if statements.
Style/IfUnlessModifier:
Enabled: false

# Unless is not necessarily clearer.
Style/NegatedIf:
Enabled: false

# We use these sparingly, where we anticipate future branches for the
# inner conditional.
Style/SoleNestedConditional:
Enabled: false

# Allow explicit empty elses, for clarity.
Style/EmptyElse:
Enabled: false

# Allow explicit ifs, especially for imperative use.
Style/SafeNavigation:
Enabled: false

# We commonly use ENV['KEY'], it's OK.
Style/FetchEnvVar:
Enabled: false

# Behaviour of alias_method is more predictable.
Style/Alias:
EnforcedStyle: prefer_alias_method

# We prefer nested modules in lib/, but are currently using compact style for tests.
Style/ClassAndModuleChildren:
Exclude:
- test/**/*

# Perfectly fine
Style/MultipleComparison:
Enabled: false

# Rubocop is pretty bad about mangling single line lambdas
Style/Lambda:
Enabled: false

# Not all parameters should be named
Style/NumberedParameters:
Enabled: false

# Fairly useful in tests for pattern matching
Style/CaseEquality:
Exclude:
- test/**/*

# Reasonable to use brackets for errors with long messages.
Style/RaiseArgs:
Enabled: false

# Reasonable for a library to define dynamic type-aliases depending on sorbet-runtime availability
Lint/ConstantDefinitionInBlock:
Exclude:
- 'lib/**/*'

# Sorbet files should be excluded from some style considerations
Style/AccessorGrouping:
Exclude:
- '**/*.rbi'
Style/EmptyMethod:
Exclude:
- '**/*.rbi'
Style/RedundantInitialize:
Exclude:
- '**/*.rbi'
Lint/MissingSuper:
Exclude:
- '**/*.rbi'
Style/BisectedAttrAccessor:
Exclude:
- '**/*.rbi'
Naming/MethodParameterName:
Exclude:
- '**/*.rbi'
Style/MutableConstant:
Exclude:
- '**/*.rbi'

# Literally nothing wrong with `symbol_1`
Naming/VariableNumber:
Enabled: false

# Set a reasonable line length; rely on other cops to correct long lines.
Layout/LineLength:
Max: 110
AllowedPatterns:
- '^(\s*#)' # Comments for YARD docs: @param and similar.
- '= Orb::Resources::\S+\.new\(client: (self|client)\)$' # Instantiating resources.
- '^\s*(-> { )?Orb::Models::[a-zA-Z0-9:]+( })?$' # Line is entirely a reference to a fully-qualified Model.

# Start the assignment on the same line variable is mentioned.
Layout/MultilineAssignmentLayout:
EnforcedStyle: same_line

# Don't leave complex assignment values hanging off to the right.
Layout/EndAlignment:
EnforcedStyleAlignWith: variable

# Don't require this extra line break, it can be excessive.
Layout/EmptyLineAfterGuardClause:
Enabled: false

# For arrays, hashes, method arguments, and method params, if they are broken onto multiple lines:
# * Should have one element per line.
# * Should have a line break before the first element.
Layout/MultilineArrayLineBreaks:
Enabled: true
Layout/FirstArrayElementLineBreak:
Enabled: true
Layout/MultilineHashKeyLineBreaks:
Enabled: true
Layout/FirstHashElementLineBreak:
Enabled: true
Layout/MultilineMethodArgumentLineBreaks:
Enabled: true
Layout/FirstMethodArgumentLineBreak:
Enabled: true
Layout/MultilineMethodParameterLineBreaks:
Enabled: true
Layout/FirstMethodParameterLineBreak:
Enabled: true

# Prefer compact hash literals.
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

# These cops are not as applicable to generated code.
Metrics/ParameterLists:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ClassLength:
Enabled: false

# These cops are too aggressive for us or now, but we may want to address them
# later.
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Metrics/AbcSize:
Enabled: false

# We should go back and add these docs, but ignore for now.
Style/Documentation:
Enabled: false

# Explicitly disable pending cops for now. This is the default behaviour but
# this avoids a large warning every time we run it.
# Stop RuboCop nagging about rubocop-rake.
# Ensure that RuboCop validates according to the lowest version of Ruby that we support.
AllCops:
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 3.0.0
3 changes: 2 additions & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
configured_endpoints: 74
configured_endpoints: 103
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0dbb8ba730f755468357ebda41332664e8396faf29a6a6a64ad37cf35cf70d0c.yml
1 change: 1 addition & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--markup markdown
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Changelog

## 0.1.0-alpha.1 (2025-02-06)

Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/orbcorp/orb-ruby/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)

### Features

* **api:** manual updates ([#1](https://github.com/orbcorp/orb-ruby/issues/1)) ([77ed62a](https://github.com/orbcorp/orb-ruby/commit/77ed62a9e0db52bad066462d12b7a66625d9dd89))
* **api:** remove unsupported params ([bc0ff3a](https://github.com/orbcorp/orb-ruby/commit/bc0ff3a901cf9a790f6bcf5cd5b74fee05e04986))
* **api:** updates ([cf773b5](https://github.com/orbcorp/orb-ruby/commit/cf773b54f507991f83d675eac765882e7b475070))
* **api:** updates ([5a0c078](https://github.com/orbcorp/orb-ruby/commit/5a0c07810335ababdd14e14fc5873267036b8ce5))
* **api:** updates ([71edb4f](https://github.com/orbcorp/orb-ruby/commit/71edb4f4dcafd4c5b3a3ca44c6b403cebfca6c94))
* **api:** updates ([d26936e](https://github.com/orbcorp/orb-ruby/commit/d26936ebdab15ca264facaf1a8118475c7567e44))
* avoid overwriting Ruby class members ([6cc8147](https://github.com/orbcorp/orb-ruby/commit/6cc8147317f23809af06682705c752572084c276))
* basic Ruby pagination support ([15d64b4](https://github.com/orbcorp/orb-ruby/commit/15d64b4fa4fd15ead82b00996c30f737a03e9ed9))
* document Ruby SDK basics ([cd30a25](https://github.com/orbcorp/orb-ruby/commit/cd30a25d9b8c847a3b95743f32e25a83d97e218d))
* handle HTTP errors in Ruby ([11d81db](https://github.com/orbcorp/orb-ruby/commit/11d81dbc47a14233ca28100a567301bce24b7fea))
* initial commit ([647e35c](https://github.com/orbcorp/orb-ruby/commit/647e35ca0153e2226f00b858e4e45a967fe605a8))
* initial commit ([#1](https://github.com/orbcorp/orb-ruby/issues/1)) ([ef4701e](https://github.com/orbcorp/orb-ruby/commit/ef4701ecf8ca4a1b6361796ac9ebf1e6e0879e3c))
* initial commit ([#2](https://github.com/orbcorp/orb-ruby/issues/2)) ([8f144a1](https://github.com/orbcorp/orb-ruby/commit/8f144a12004ae09b742e1848fcc1b5e6844b33dc))
* prettier Ruby code ([1849b10](https://github.com/orbcorp/orb-ruby/commit/1849b106a22de8247eaad0520cd03aa00f5cae5c))
* produce unit tests for generated code ([c0075ce](https://github.com/orbcorp/orb-ruby/commit/c0075ceb23efebbb6eaffdf9f0ac5fac764c91a6))
* provide code at less ambiguous paths ([deddf74](https://github.com/orbcorp/orb-ruby/commit/deddf74670653a0ceb929988aceabd4dd42d92cd))
* ruby support for some auth methods ([0e3eb7d](https://github.com/orbcorp/orb-ruby/commit/0e3eb7df13890cb930aabef71d87da268e2391f1))
* use example values in tests ([08f866a](https://github.com/orbcorp/orb-ruby/commit/08f866a942b86395733bd86ee52e37dd0783f3c3))


### Bug Fixes

* **client:** include more detail in error messages ([7b46a84](https://github.com/orbcorp/orb-ruby/commit/7b46a841c02805c5703eb919d62cbcc7d457e2d4))
* rename customer.credits.ledger.create_entry_by_exteral_id and RequestValidationErrors ([3468947](https://github.com/orbcorp/orb-ruby/commit/3468947cbe45a79fac30c05872b8727b4362fef4))


### Documentation

* **readme:** improve example snippets ([92c7892](https://github.com/orbcorp/orb-ruby/commit/92c78921b97b4d6e7155bd8a093bb0d4eac834ae))
25 changes: 20 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
source 'https://rubygems.org'
# frozen_string_literal: true

gem 'connection_pool'
gem 'rake', :group => :development
gem 'syntax_tree', :group => :development
gem 'test-unit', :group => :development
source "https://rubygems.org"

gemspec

group :development do
gem "minitest"
gem "minitest-focus"
gem "minitest-hooks"
gem "rake"
gem "rbs"
gem "rubocop"
gem "sorbet"
gem "steep"
gem "syntax_tree"
# TODO: using a fork for now, the prettier below has a bug
gem "syntax_tree-rbs", github: "stainless-api/syntax_tree-rbs", branch: "main"
gem "webrick"
gem "yard"
end
Loading
Loading