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
23 changes: 21 additions & 2 deletions .github/workflows/ruby-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,32 @@ on:
- master

jobs:
ruby-ci-lint:
name: Ruby CI - lint
runs-on: ubuntu-latest

strategy:
matrix:
ruby-version: [3.1]

steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install dependencies
run: bundle install
- name: Lint
run: rake lint

ruby-ci:
name: Ruby CI - test
runs-on: ubuntu-latest

strategy:
matrix:
ruby-version: [3.0, 3.1, 3.2]
ruby-version: [3.0, 3.1, 3.2, 3.3, 3.4]

steps:
- uses: actions/checkout@v4
Expand All @@ -25,4 +44,4 @@ jobs:
- name: Install dependencies
run: bundle install
- name: Test
run: rake
run: rake test
78 changes: 78 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
##
# AllCops (Global)
#
AllCops:
NewCops: enable
SuggestExtensions: false
Exclude:
- vendor/**/*

##
# Layout
#
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent

Layout/HashAlignment:
EnforcedLastArgumentHashStyle: ignore_implicit

Layout/SpaceBeforeBlockBraces:
EnforcedStyle: no_space

##
# Metrics
#
Metrics/AbcSize:
Max: 20
CountRepeatedAttributes: false
Exclude:
- test/**/*
AllowedMethods:
- request
- get_all

Metrics/BlockLength:
Enabled: false

Metrics/ClassLength:
Enabled: false

Metrics/CyclomaticComplexity:
AllowedMethods:
- get_all

Metrics/MethodLength:
Enabled: false

Metrics/ParameterLists:
Max: 6
CountKeywordArgs: false

Metrics/PerceivedComplexity:
Enabled: false

##
# Naming
#
Naming/AccessorMethodName:
Exclude:
- lib/duo_api/*

##
# Style
#
Style/NumericLiterals:
Enabled: false

Style/Documentation:
Exclude:
- test/**/*

##
# Gemspec
#
Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec

Gemspec/RequireMFA:
Enabled: false
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gemspec
39 changes: 18 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,22 @@

**Accounts** - https://www.duosecurity.com/docs/accountsapi

## Tested Against Ruby Versions:
* 3.0
# Compatibility
While the gem should work for Ruby versions >= 2.5, tests and linting may only work properly on Ruby versions >= 3.0.

Tests are only run on currently supported Ruby versions.

### Tested Against Ruby Versions:
* 3.1
* 3.2
* 3.3
* 3.4

## TLS 1.2 and 1.3 Support
### TLS 1.2 and 1.3 Support

Duo_api_ruby uses the Ruby openssl extension for TLS operations.
duo_api_ruby uses the Ruby openssl extension for TLS operations.

All currently supported Ruby versions (2.7 and higher) support TLS 1.2 and 1.3.
All Ruby versions compatible with this gem (2.5 and higher) support TLS 1.2 and 1.3.

# Installing

Expand All @@ -45,27 +51,18 @@ gem 'duo_api', '~> 1.0'
```

# Using

TODO
- Examples of doing things [the hard way](/examples/the_hard_way.md)
- Examples of doing things [the less hard way](/examples/the_less_hard_way.md)
- Examples of doing things [the simple way](/examples/the_simple_way.md)

# Testing

###### (Testing and Linting can be done simultaneously by running `rake` without specifying a task)
```
$ rake
Loaded suite /usr/lib/ruby/vendor_ruby/rake/rake_test_loader
Started
........

Finished in 0.002024715 seconds.
--------------------------------------------------------------------------------------------------------
8 tests, 10 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
--------------------------------------------------------------------------------------------------------
3951.17 tests/s, 4938.97 assertions/s
rake test
```

# Linting

###### (Testing and Linting can be done simultaneously by running `rake` without specifying a task)
```
$ rubocop
rake lint
```
16 changes: 11 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# frozen_string_literal: true

require 'rake/testtask'
require 'rubocop/rake_task'

desc('Run tests & linting')
task(default: %i[test lint])

Rake::TestTask.new do |t|
t.libs << 'test'
end
desc('Run tests')
task(:test){ Rake::TestTask.new{ |t| t.libs << 'test' } }

desc 'Run tests'
task :default => :test
desc('Run linting')
task(lint: %i[rubocop])
task(:rubocop){ RuboCop::RakeTask.new }
Loading