Skip to content

Commit d37de93

Browse files
authored
Merge pull request #14 from emailable/setup_gh_actions
Setup GitHub actions
2 parents bfec899 + bff8e45 commit d37de93

15 files changed

Lines changed: 135 additions & 88 deletions

File tree

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: bundler
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
tests:
11+
name: Tests
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Ruby ${{ matrix.ruby-version }}
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
ruby-version: ${{ matrix.ruby-version }}
23+
bundler-cache: true
24+
25+
- name: Run tests
26+
run: bundle exec rake
27+
28+
linters:
29+
name: Linters
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
36+
- name: Set up Ruby
37+
uses: ruby/setup-ruby@v1
38+
with:
39+
bundler-cache: true
40+
41+
- name: RuboCop
42+
run: bundle exec rubocop --parallel
43+
if: always()

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
inherit_from: .rubocop_todo.yml
2+
3+
inherit_gem:
4+
rubocop-cache-ventures: rubocop.yml

.rubocop_todo.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config --exclude-limit 10000`
3+
# on 2024-03-18 16:04:55 UTC using RuboCop version 1.62.1.
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.

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.4
1+
3.3.0

.travis.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Emailable Ruby Library
22

33
[![Gem Version](https://badge.fury.io/rb/emailable.svg)](https://rubygems.org/gems/emailable)
4-
[![Build Status](https://app.travis-ci.com/emailable/emailable-ruby.svg)](https://app.travis-ci.com/emailable/emailable-ruby)
4+
![Build Status](https://github.com/emailable/emailable-ruby/actions/workflows/ci.yml/badge.svg)
55
[![Maintainability](https://api.codeclimate.com/v1/badges/e7eef54e491adec95e6d/maintainability)](https://codeclimate.com/github/emailable/emailable-ruby/maintainability)
66

77
This is the official ruby wrapper for the Emailable API.

emailable.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ Gem::Specification.new do |s|
3434
s.add_development_dependency 'minitest', '~> 5.0'
3535
s.add_development_dependency 'minitest-reporters'
3636
s.add_development_dependency 'activemodel'
37+
s.add_development_dependency 'rubocop-cache-ventures'
3738
end

lib/emailable/batch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def verify(parameters = {})
2727
end
2828

2929
def status(parameters = {})
30-
return nil unless @id
30+
return unless @id
3131
return @status if @status
3232

3333
parameters[:id] = @id

lib/emailable/client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def request(method, endpoint, params = {})
3535

3636
response = Response.new(http_response)
3737
rescue => e
38-
retry if (tries -= 1) > 0 && self.class.should_retry?(e, tries)
38+
retry if (tries -= 1) > 0 && should_retry?(e, tries)
3939

4040
raise e
4141
end
@@ -70,7 +70,7 @@ def create_connection(uri)
7070
connection
7171
end
7272

73-
def self.should_retry?(error, num_retries)
73+
def should_retry?(error, num_retries)
7474
return false if num_retries >= Emailable.max_network_retries
7575

7676
case error

0 commit comments

Comments
 (0)