Skip to content
Draft
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
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4"]
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake test

# Runs the suite through the same flake.nix shell used for local development,
# so a broken dev environment fails CI instead of surfacing only when someone
# next runs `nix develop`. No Nix cache action is wired up here: this flake
# doesn't build anything from source, so every package is already served by
# the public cache.nixos.org substituter and there's nothing to gain from one.
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/determinate-nix-action@v3
- run: nix develop --command bundle install
- run: nix develop --command bundle exec rake test
- run: nix develop --command bundle exec rubocop
33 changes: 27 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
plugins:
- rubocop-performance

inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: '2.3'
TargetRubyVersion: '3.1'
NewCops: enable
Exclude:
- 'test/fixtures/**/*'

Layout/AlignParameters:
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation

Layout/ClosingParenthesisIndentation:
Expand All @@ -14,15 +18,32 @@ Layout/ClosingParenthesisIndentation:
Layout/DotPosition:
EnforcedStyle: trailing

Style/BracesAroundHashParameters:
Enabled: false

Layout/AccessModifierIndentation:
EnforcedStyle: outdent

Metrics/LineLength:
Layout/LineLength:
Enabled: false

Style/StringLiterals:
Enabled: false

# This codebase intentionally uses the compact `class Drip::Client::Foo`
# style throughout instead of nested `module`/`class` blocks.
Style/ClassAndModuleChildren:
Enabled: false

# Methods are documented with "Public:"-style comments above each method
# rather than class/module-level documentation.
Style/Documentation:
Enabled: false

# Data-literal methods that just enumerate known classes aren't meaningfully
# simplified by splitting them up.
Metrics/MethodLength:
Exclude:
- 'lib/drip/resources.rb'
- 'lib/drip/collections.rb'

Layout/MultilineOperationIndentation:
EnforcedStyle: 'indented'

Expand Down
98 changes: 1 addition & 97 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,103 +1,7 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-05-02 16:45:21 -0500 using RuboCop version 0.67.2.
# using RuboCop version 1.88.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
# Cop supports --auto-correct.
Layout/EmptyLineAfterGuardClause:
Exclude:
- 'lib/drip/client/subscribers.rb'
- 'lib/drip/response.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'lib/drip/client.rb'
- 'lib/drip/collection.rb'

# Offense count: 2
Metrics/AbcSize:
Max: 25

# Offense count: 8
# Configuration parameters: CountComments, ExcludedMethods.
# ExcludedMethods: refine
Metrics/BlockLength:
Max: 46

# Offense count: 4
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/MethodLength:
Max: 26

# Offense count: 1
Metrics/PerceivedComplexity:
Max: 8

# Offense count: 4
# Cop supports --auto-correct.
Performance/InefficientHashSearch:
Exclude:
- 'lib/drip/resource.rb'
- 'lib/drip/response.rb'

# Offense count: 24
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Enabled: false

# Offense count: 44
Style/Documentation:
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
Style/Encoding:
Exclude:
- 'drip-ruby.gemspec'

# Offense count: 2
# Cop supports --auto-correct.
Style/ExpandPathArguments:
Exclude:
- 'drip-ruby.gemspec'
- 'test/test_helper.rb'

# Offense count: 1
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
- 'lib/drip/client.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/IfUnlessModifier:
Exclude:
- 'lib/drip/client.rb'

# Offense count: 2
Style/MissingRespondToMissing:
Exclude:
- 'lib/drip/resource.rb'
- 'lib/drip/response.rb'

# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: Strict.
Style/NumericLiterals:
MinDigits: 8

# Offense count: 700
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Enabled: false
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

35 changes: 34 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,43 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

[master]: https://github.com/DripEmail/drip-ruby/compare/v3.4.3...HEAD
[main]: https://github.com/DripEmail/drip-ruby/compare/v3.5.0...HEAD

- Your contribution here!

## [3.5.0] - 2026-07-10

[3.5.0]: https://github.com/DripEmail/drip-ruby/compare/v3.4.3...v3.5.0

### Security
- `Drip::Client::HTTPClient` no longer forwards the `Authorization`/Basic-auth
credentials when an HTTP redirect points to a different host than the one
originally requested.
- Path segments and query values built from caller-supplied ids (`id`,
`campaign_id`, `workflow_id`, `subscriber_id`, etc.) are now consistently
URL-escaped, matching the existing behavior for emails and tags.

### Fixed
- `Drip::Client::Orders#create_or_update_order` no longer merges the `email`
option under a symbol key alongside a possible string `"email"` key, which
produced a hash with a duplicate JSON key and a deprecation warning under
recent `json` gem versions.

### Changed
- Raised `required_ruby_version` to `>= 3.1` and bumped development
dependencies (minitest, mocha, rake, rubocop, rubocop-performance,
shoulda-context, simplecov, webmock) to current versions.
- Replaced Travis CI with a GitHub Actions workflow that runs the test suite
across Ruby 3.1-3.4 (via `ruby/setup-ruby`) plus a job that runs the suite
and rubocop through the project's `flake.nix` shell (via
`DeterminateSystems/determinate-nix-action`), so the documented dev
environment is itself covered by CI.
- Upgraded rubocop from 0.67.2 to 1.x, resolved the accumulated
`.rubocop_todo.yml` offenses, and fixed the underlying code where
reasonable rather than just re-suppressing them.
- Added a `flake.nix` development shell (ruby, bundler, libyaml, pkg-config)
for a reproducible local dev environment.

## [3.4.3] - 2023-02-15

[3.4.3]: https://github.com/DripEmail/drip-ruby/compare/v3.4.2...v3.4.3
Expand Down
17 changes: 9 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in drip-ruby.gemspec
gemspec

gem "bundler", ">= 1.6", "< 3"
gem "base64"
gem "bundler", ">= 2.0", "< 5"
gem "minitest", "~> 5.0"
gem "mocha", "~> 1.1"
gem "rake", "~> 12.0"
gem "rubocop", "~> 0.67.2"
gem "rubocop-performance", "~> 1.1.0"
gem "shoulda-context", "~> 1.0"
gem "simplecov", require: false
gem "webmock", "~> 3.4"
gem "mocha", "~> 2.1"
gem "rake", "~> 13.0"
gem "rubocop", "~> 1.81"
gem "rubocop-performance", "~> 1.26"
gem "shoulda-context", "~> 1.2"
gem "simplecov", "~> 0.22", require: false
gem "webmock", "~> 3.24"
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

A Ruby toolkit for the [Drip](https://www.getdrip.com/) API.

[![Build Status](https://travis-ci.org/DripEmail/drip-ruby.svg?branch=master)](https://travis-ci.org/DripEmail/drip-ruby)
[![Code Climate](https://codeclimate.com/github/DripEmail/drip-ruby/badges/gpa.svg)](https://codeclimate.com/github/DripEmail/drip-ruby)
[![CI](https://github.com/DripEmail/drip-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/DripEmail/drip-ruby/actions/workflows/ci.yml)
[![Gem Version](https://badge.fury.io/rb/drip-ruby.svg)](https://badge.fury.io/rb/drip-ruby)


Expand Down
8 changes: 4 additions & 4 deletions drip-ruby.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# coding: utf-8
# frozen_string_literal: true

lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'drip/version'

Expand All @@ -17,8 +16,9 @@ Gem::Specification.new do |spec|

spec.files = `git ls-files -z`.split("\x0")
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.required_ruby_version = '>= 2.3'
spec.required_ruby_version = '>= 3.1'

spec.metadata['rubygems_mfa_required'] = 'true'
end
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
description = "Development environment for drip-ruby";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
packages = [
pkgs.ruby_3_3
pkgs.bundler
pkgs.libyaml
pkgs.pkg-config
];

shellHook = ''
export GEM_HOME="$PWD/.bundle/gems"
export BUNDLE_PATH="$GEM_HOME"
export PATH="$GEM_HOME/bin:$PATH"
echo "drip-ruby dev shell ($(ruby -v))"
echo "Run 'bundle install' then 'bundle exec rake test' to get started."
'';
};
});
}
Loading
Loading