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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.92.0"
".": "1.93.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 214
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-c51555226fd66ed304eb1e9c759a6485c071eb2cb9ca9ee86f5b5cd88552ee4a.yml
openapi_spec_hash: c5b09ec531c068cb675f8cd3729733c6
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-911c3719c8d84e1119e71e0cf93ae1f2c52f42529e56671731f07273feb5ac88.yml
openapi_spec_hash: 462c4c10440c2f87e0624d8c25a89b75
config_hash: a143293c5450ae8f52acad08f3102575
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 1.93.0 (2025-09-26)

Full Changelog: [v1.92.0...v1.93.0](https://github.com/Increase/increase-ruby/compare/v1.92.0...v1.93.0)

### Features

* **api:** api update ([a760b8c](https://github.com/Increase/increase-ruby/commit/a760b8ca14265f2cd6c924f674b39257e79ce065))


### Chores

* allow fast-format to use bsd sed as well ([14b02a4](https://github.com/Increase/increase-ruby/commit/14b02a4f3007334c0cdb7728117529a8ef7f6002))

## 1.92.0 (2025-09-26)

Full Changelog: [v1.91.1...v1.92.0](https://github.com/Increase/increase-ruby/compare/v1.91.1...v1.92.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
increase (1.92.0)
increase (1.93.0)
connection_pool

GEM
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "increase", "~> 1.92.0"
gem "increase", "~> 1.93.0"
```

<!-- x-release-please-end -->
Expand Down
26 changes: 18 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ end
xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --]
ruby_opt = {"RUBYOPT" => [ENV["RUBYOPT"], "--encoding=UTF-8"].compact.join(" ")}

filtered = ->(ext, dirs) do
if ENV.key?(FILES_ENV)
%w[sed -E -n -e] << "/\\.#{ext}$/p" << "--" << ENV.fetch(FILES_ENV)
else
(%w[find] + dirs + %w[-type f -and -name]) << "*.#{ext}" << "-print0"
end
end

desc("Lint `*.rb(i)`")
multitask(:"lint:rubocop") do
find = %w[find ./lib ./test ./rbi ./examples -type f -and ( -name *.rb -or -name *.rbi ) -print0]
Expand All @@ -54,24 +62,26 @@ multitask(:"lint:rubocop") do
sh("#{find.shelljoin} | #{lint.shelljoin}")
end

norm_lines = %w[tr -- \n \0].shelljoin

desc("Format `*.rb`")
multitask(:"format:rb") do
# while `syntax_tree` is much faster than `rubocop`, `rubocop` is the only formatter with full syntax support
files = ENV.key?(FILES_ENV) ? %w[sed -E -z -n -e /\.rb$/p --] << ENV.fetch(FILES_ENV) : %w[find ./lib ./test ./examples -type f -and -name *.rb -print0]
files = filtered["rb", %w[./lib ./test ./examples]]
fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --]
sh("#{files.shelljoin} | #{fmt.shelljoin}")
sh("#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}")
end

desc("Format `*.rbi`")
multitask(:"format:rbi") do
files = ENV.key?(FILES_ENV) ? %w[sed -E -z -n -e /\.rbi$/p --] << ENV.fetch(FILES_ENV) : %w[find ./rbi -type f -and -name *.rbi -print0]
files = filtered["rbi", %w[./rbi]]
fmt = xargs + %w[stree write --]
sh(ruby_opt, "#{files.shelljoin} | #{fmt.shelljoin}")
sh(ruby_opt, "#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}")
end

desc("Format `*.rbs`")
multitask(:"format:rbs") do
files = ENV.key?(FILES_ENV) ? %w[sed -E -z -n -e /\.rbs$/p --] << ENV.fetch(FILES_ENV) : %w[find ./sig -type f -name *.rbs -print0]
files = filtered["rbs", %w[./sig]]
inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? ["-i", ""] : %w[-i]
uuid = SecureRandom.uuid

Expand Down Expand Up @@ -100,13 +110,13 @@ multitask(:"format:rbs") do
success = false

# transform class aliases to type aliases, which syntax tree has no trouble with
sh("#{files.shelljoin} | #{pre.shelljoin}")
sh("#{files.shelljoin} | #{norm_lines} | #{pre.shelljoin}")
# run syntax tree to format `*.rbs` files
sh(ruby_opt, "#{files.shelljoin} | #{fmt.shelljoin}") do
sh(ruby_opt, "#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}") do
success = _1
end
# transform type aliases back to class aliases
sh("#{files.shelljoin} | #{pst.shelljoin}")
sh("#{files.shelljoin} | #{norm_lines} | #{pst.shelljoin}")

# always run post-processing to remove comment marker
fail unless success
Expand Down
8 changes: 4 additions & 4 deletions lib/increase/models/physical_card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ module Status
# @see Increase::Models::PhysicalCard::Shipment#tracking
class Tracking < Increase::Internal::Type::BaseModel
# @!attribute number
# The tracking number.
# The tracking number. Not available for USPS shipments.
#
# @return [String]
required :number, String
# @return [String, nil]
required :number, String, nil?: true

# @!attribute return_number
# For returned shipments, the tracking number of the return shipment.
Expand Down Expand Up @@ -351,7 +351,7 @@ class Tracking < Increase::Internal::Type::BaseModel
#
# Tracking details for the shipment.
#
# @param number [String] The tracking number.
# @param number [String, nil] The tracking number. Not available for USPS shipments.
#
# @param return_number [String, nil] For returned shipments, the tracking number of the return shipment.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/increase/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Increase
VERSION = "1.92.0"
VERSION = "1.93.0"
end
10 changes: 5 additions & 5 deletions rbi/increase/models/physical_card.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ module Increase
)
end

# The tracking number.
sig { returns(String) }
# The tracking number. Not available for USPS shipments.
sig { returns(T.nilable(String)) }
attr_accessor :number

# For returned shipments, the tracking number of the return shipment.
Expand Down Expand Up @@ -531,7 +531,7 @@ module Increase
# Tracking details for the shipment.
sig do
params(
number: String,
number: T.nilable(String),
return_number: T.nilable(String),
return_reason: T.nilable(String),
shipped_at: Time,
Expand All @@ -542,7 +542,7 @@ module Increase
).returns(T.attached_class)
end
def self.new(
# The tracking number.
# The tracking number. Not available for USPS shipments.
number:,
# For returned shipments, the tracking number of the return shipment.
return_number:,
Expand All @@ -560,7 +560,7 @@ module Increase
sig do
override.returns(
{
number: String,
number: T.nilable(String),
return_number: T.nilable(String),
return_reason: T.nilable(String),
shipped_at: Time,
Expand Down
5 changes: 1 addition & 4 deletions scripts/fast-format
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@ if [ $# -eq 0 ]; then
exit 1
fi

FILE="$(mktemp)"
tr -- '\n' '\0' < "$1" > "$FILE"

exec -- bundle exec rake format FORMAT_FILE="$FILE"
exec -- bundle exec rake format FORMAT_FILE="$1"
8 changes: 4 additions & 4 deletions sig/increase/models/physical_card.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ module Increase

type tracking =
{
number: String,
number: String?,
return_number: String?,
return_reason: String?,
shipped_at: Time,
updates: ::Array[Increase::PhysicalCard::Shipment::Tracking::Update]
}

class Tracking < Increase::Internal::Type::BaseModel
attr_accessor number: String
attr_accessor number: String?

attr_accessor return_number: String?

Expand All @@ -255,15 +255,15 @@ module Increase
attr_accessor updates: ::Array[Increase::PhysicalCard::Shipment::Tracking::Update]

def initialize: (
number: String,
number: String?,
return_number: String?,
return_reason: String?,
shipped_at: Time,
updates: ::Array[Increase::PhysicalCard::Shipment::Tracking::Update]
) -> void

def to_hash: -> {
number: String,
number: String?,
return_number: String?,
return_reason: String?,
shipped_at: Time,
Expand Down