octoauth 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/.rspec +2 -0
- data/.rubocop.yml +2 -0
- data/.travis.yml +13 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +22 -0
- data/Rakefile +14 -0
- data/lib/octoauth.rb +48 -0
- data/octoauth.gemspec +25 -0
- data/spec/octoauth_spec.rb +17 -0
- data/spec/spec_helper.rb +13 -0
- metadata +169 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2f18a1e0fb13d72ba6e6280673831a2e6e855a42
|
4
|
+
data.tar.gz: b59375a0a2a198e939a55306f75edf9d1eb5c603
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 209f5e8f5a68cd9ae9d3c993d4bb74021d61bf10dad180e778da96c2d32b1a578abb4c464cb8bd5a7646a784fb3c6534cd8be9a9f16bb76ddaf456c178e1876e
|
7
|
+
data.tar.gz: 6994adcdf5e62c89d0a8b218ae14a4f5d9ef5d2acfbea00acd23e0ca9d067ecee3cd2cc5efcfc386ceacc72fd6d4e77cecf12295c3bf4c01aa1e0390f23b4102
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
rvm:
|
4
|
+
- 2.1.0
|
5
|
+
- 2.0.0
|
6
|
+
- 1.9.3
|
7
|
+
notifications:
|
8
|
+
email: false
|
9
|
+
irc:
|
10
|
+
template:
|
11
|
+
- '%{repository}/%{branch}/%{build_number}: %{message} -- %{build_url}'
|
12
|
+
channels:
|
13
|
+
secure: YG4wZiOIR0aA8+PLOu/oygPfhcHUYYq7qgpC8XC6RN5sNfRezVjwUFU1y4UGJhLPloyaMZ2K/2OTwnZbZOk5nANRnZOkAI6Eg5WcMFV8vp4SuMNIEbi8pp6jWpWfbcdqTp0Sz3s/Ciwl0snVxKSd/gZtxxXb10PuFGpvC3RpNBg=
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Les Aker
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
22
|
+
|
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
octoauth
|
2
|
+
=========
|
3
|
+
|
4
|
+
[](https://rubygems.org/gems/octoauth)
|
5
|
+
[](https://gemnasium.com/akerl/octoauth)
|
6
|
+
[](https://codeclimate.com/github/akerl/octoauth)
|
7
|
+
[](https://coveralls.io/r/akerl/octoauth)
|
8
|
+
[](https://travis-ci.org/akerl/octoauth)
|
9
|
+
[](https://tldrlegal.com/license/mit-license)
|
10
|
+
|
11
|
+
SHORT_DESCRIPTION
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
gem install octoauth
|
18
|
+
|
19
|
+
## License
|
20
|
+
|
21
|
+
octoauth is released under the MIT License. See the bundled LICENSE file for details.
|
22
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require 'rubocop/rake_task'
|
4
|
+
|
5
|
+
desc 'Run tests'
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
7
|
+
|
8
|
+
desc 'Run Rubocop on the gem'
|
9
|
+
Rubocop::RakeTask.new(:rubocop) do |task|
|
10
|
+
task.patterns = ['lib/**/*.rb', 'spec/**/*.rb']
|
11
|
+
task.fail_on_error = true
|
12
|
+
end
|
13
|
+
|
14
|
+
task default: [:spec, :rubocop, :build, :install]
|
data/lib/octoauth.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'octokit'
|
2
|
+
require 'userinput'
|
3
|
+
|
4
|
+
##
|
5
|
+
# Octokit wrapper for simplifying authentication
|
6
|
+
module Octoauth
|
7
|
+
class << self
|
8
|
+
##
|
9
|
+
# Insert a helper .new() method for creating a new Auth object
|
10
|
+
def new(*args)
|
11
|
+
self::Auth.new(*args)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
##
|
16
|
+
# Define some sane defaults
|
17
|
+
DEFAULTS = {
|
18
|
+
file: '~/.octoauth.yml'
|
19
|
+
}
|
20
|
+
|
21
|
+
##
|
22
|
+
# Authentication object
|
23
|
+
class Auth
|
24
|
+
attr_reader :user, :note, :file
|
25
|
+
|
26
|
+
def initialize(params = {})
|
27
|
+
@user = nil
|
28
|
+
@file = params.delete(:file) || DEFAULTS[:file]
|
29
|
+
@note = params.delete(:note)
|
30
|
+
fail ArgumentError, 'Must provide a note for GitHub token' if @note.nil?
|
31
|
+
@api = Octokit::Client.new params
|
32
|
+
end
|
33
|
+
|
34
|
+
def authenticate!(params = {})
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def login
|
40
|
+
end
|
41
|
+
|
42
|
+
def password
|
43
|
+
end
|
44
|
+
|
45
|
+
def twofactor
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/octoauth.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'octoauth'
|
3
|
+
s.version = '0.0.1'
|
4
|
+
s.date = Time.now.strftime("%Y-%m-%d")
|
5
|
+
|
6
|
+
s.summary = ''
|
7
|
+
s.description = ""
|
8
|
+
s.authors = ['Les Aker']
|
9
|
+
s.email = 'me@lesaker.org'
|
10
|
+
s.homepage = 'https://github.com/akerl/octoauth'
|
11
|
+
s.license = 'MIT'
|
12
|
+
|
13
|
+
s.files = `git ls-files`.split
|
14
|
+
s.test_files = `git ls-files spec/*`.split
|
15
|
+
|
16
|
+
s.add_dependency 'octokit', '~> 3.0.0'
|
17
|
+
s.add_dependency 'userinput', '~> 0.0.2'
|
18
|
+
|
19
|
+
s.add_development_dependency 'rubocop', '~> 0.20.0'
|
20
|
+
s.add_development_dependency 'rake', '~> 10.2.1'
|
21
|
+
s.add_development_dependency 'coveralls', '~> 0.7.0'
|
22
|
+
s.add_development_dependency 'rspec', '~> 2.14.1'
|
23
|
+
s.add_development_dependency 'fuubar', '~> 1.3.2'
|
24
|
+
s.add_development_dependency 'webmock', '~> 1.17.4'
|
25
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Octoauth do
|
4
|
+
describe '#new' do
|
5
|
+
it 'creates auth objects' do
|
6
|
+
expect(Octoauth.new).to be_an_instance_of Octoauth::Auth
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
describe Octoauth::Auth do
|
11
|
+
let(:subject) { Octoauth::Auth.new }
|
12
|
+
|
13
|
+
it 'creates an auth object' do
|
14
|
+
expect(subject).to be_an_instance_of Octoauth::Auth
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
require 'coveralls'
|
3
|
+
|
4
|
+
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
5
|
+
SimpleCov.start do
|
6
|
+
add_filter '/spec/'
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'rspec'
|
10
|
+
require 'octoauth'
|
11
|
+
|
12
|
+
require 'webmock/rspec'
|
13
|
+
WebMock.disable_net_connect!(allow_localhost: true)
|
metadata
ADDED
@@ -0,0 +1,169 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: octoauth
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Les Aker
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: octokit
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: userinput
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.0.2
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.0.2
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.20.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.20.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 10.2.1
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 10.2.1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: coveralls
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.7.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.7.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 2.14.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.14.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: fuubar
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.3.2
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.3.2
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: webmock
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.17.4
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.17.4
|
125
|
+
description: ''
|
126
|
+
email: me@lesaker.org
|
127
|
+
executables: []
|
128
|
+
extensions: []
|
129
|
+
extra_rdoc_files: []
|
130
|
+
files:
|
131
|
+
- .gitignore
|
132
|
+
- .rspec
|
133
|
+
- .rubocop.yml
|
134
|
+
- .travis.yml
|
135
|
+
- Gemfile
|
136
|
+
- LICENSE
|
137
|
+
- README.md
|
138
|
+
- Rakefile
|
139
|
+
- lib/octoauth.rb
|
140
|
+
- octoauth.gemspec
|
141
|
+
- spec/octoauth_spec.rb
|
142
|
+
- spec/spec_helper.rb
|
143
|
+
homepage: https://github.com/akerl/octoauth
|
144
|
+
licenses:
|
145
|
+
- MIT
|
146
|
+
metadata: {}
|
147
|
+
post_install_message:
|
148
|
+
rdoc_options: []
|
149
|
+
require_paths:
|
150
|
+
- lib
|
151
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - '>='
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '0'
|
156
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - '>='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
requirements: []
|
162
|
+
rubyforge_project:
|
163
|
+
rubygems_version: 2.0.14
|
164
|
+
signing_key:
|
165
|
+
specification_version: 4
|
166
|
+
summary: ''
|
167
|
+
test_files:
|
168
|
+
- spec/octoauth_spec.rb
|
169
|
+
- spec/spec_helper.rb
|