Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Commit

Permalink
Added Ruby Gem and Bundler support
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Schwager committed Jun 9, 2016
1 parent f707833 commit 6de47c7
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Gemfile
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gemspec
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -7,8 +7,8 @@ This package allows a web developer to quickly add Duo's interactive, self-servi
What's here:

* `js` - Duo Javascript library, to be hosted by your webserver.
* `duo_web.rb` - Duo Ruby SDK to be integrated with your web application
* `test.rb` - Unit tests for our SDK
* `lib/duo_web.rb` - Duo Ruby SDK to be integrated with your web application
* `test/test_duo_web.rb` - Unit tests for our SDK

# Installing

Expand All @@ -19,31 +19,31 @@ $ git clone https://github.com/duosecurity/duo_ruby.git
# Using

```
$ irb -r ./duo_web.rb
$ irb -r ./lib/duo_web.rb
irb(main):001:0> Duo.sign_request(ikey, skey, akey, username)
=> "TX|...TX_SIGNATURE...==|...TX_HASH...:APP|...APP_SIGNATURE...==|...APP_HASH..."
```

# Testing

```
$ ruby test.rb
Loaded suite test
$ rake
Loaded suite /usr/lib/ruby/vendor_ruby/rake/rake_test_loader
Started
..
Finished in 0.001666831 seconds.
Finished in 0.001006152 seconds.
---------------------------------------------------------------------------------------
2 tests, 13 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
---------------------------------------------------------------------------------------
1199.88 tests/s, 7799.23 assertions/s
1987.77 tests/s, 12920.51 assertions/s
```

# Linting

```
$ rubocop duo_web.rb
$ rubocop
```

# Support
Expand Down
8 changes: 8 additions & 0 deletions Rakefile
@@ -0,0 +1,8 @@
require 'rake/testtask'

Rake::TestTask.new do |t|
t.libs << 'test'
end

desc 'Run tests'
task :default => :test
17 changes: 17 additions & 0 deletions duo_web.gemspec
@@ -0,0 +1,17 @@
Gem::Specification.new do |s|
s.name = 'duo_web'
s.version = '1.0.0'
s.summary = 'Duo Web Ruby'
s.description = 'A Ruby implementation of the Duo Web SDK.'
s.email = 'support@duo.com'
s.homepage = 'https://github.com/duosecurity/duo_ruby'
s.license = 'BSD-3-Clause'
s.authors = ['Duo Security']
s.files = [
'lib/duo_web.rb',
'js/Duo-Web-v2.js',
'js/Duo-Web-v2.min.js'
]
s.add_development_dependency 'rake', '~> 0'
s.add_development_dependency 'rubocop', '~> 0'
end
File renamed without changes.
2 changes: 1 addition & 1 deletion test.rb → test/test_duo_web.rb
@@ -1,5 +1,5 @@
require 'test/unit'
require_relative 'duo_web'
require 'duo_web'

IKEY = 'DIXXXXXXXXXXXXXXXXXX'.freeze
WRONG_IKEY = 'DIXXXXXXXXXXXXXXXXXY'.freeze
Expand Down

0 comments on commit 6de47c7

Please sign in to comment.