circular 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/.rspec +2 -0
- data/.rubocop.yml +2 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +22 -0
- data/Rakefile +14 -0
- data/circle.yml +12 -0
- data/circular.gemspec +26 -0
- data/lib/circular.rb +26 -0
- data/lib/circular/api.rb +24 -0
- data/spec/circular_spec.rb +2 -0
- data/spec/spec_helper.rb +11 -0
- metadata +184 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8a2840efa848fc5aa82889dad67fa74eccb4f992
|
4
|
+
data.tar.gz: 408cc76980a929c1d917f0d859f415359506791e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5433cf929cd3ed6273a0f795e5d051a58c660654a15018f38f1be096cae393c93c79e96ec6e2945f7104e6b49a8dd34ef00a1935776850d29f18add63fdcfcc8
|
7
|
+
data.tar.gz: a9a6291f87324fd4933cdad3c3263b53c29e41ba8b8ed860b2217c75794ca570f50f56301f3d46a8039665a50c51afcdfe85468739bf737c6e9bed20974d57bd
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 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
|
+
circular
|
2
|
+
=========
|
3
|
+
|
4
|
+
[![Gem Version](https://img.shields.io/gem/v/circular.svg)](https://rubygems.org/gems/circular)
|
5
|
+
[![Dependency Status](https://img.shields.io/gemnasium/akerl/circular.svg)](https://gemnasium.com/akerl/circular)
|
6
|
+
[![Build Status](https://img.shields.io/circleci/project/akerl/circular.svg)](https://circleci.com/gh/akerl/circular)
|
7
|
+
[![Coverage Status](https://img.shields.io/codecov/c/github/akerl/circular.svg)](https://codecov.io/github/akerl/circular)
|
8
|
+
[![Code Quality](https://img.shields.io/codacy/c4e71c44d9d9498dbebe4ea1db979f59.svg)](https://www.codacy.com/app/akerl/circular)
|
9
|
+
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
|
10
|
+
|
11
|
+
CirceCI API gem
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
gem install circular
|
18
|
+
|
19
|
+
## License
|
20
|
+
|
21
|
+
circular 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/circle.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
dependencies:
|
2
|
+
override:
|
3
|
+
- 'rvm-exec 1.9.3-p551 bundle install'
|
4
|
+
- 'rvm-exec 2.0.0-p645 bundle install'
|
5
|
+
- 'rvm-exec 2.1.6 bundle install'
|
6
|
+
- 'rvm-exec 2.2.2 bundle install'
|
7
|
+
test:
|
8
|
+
override:
|
9
|
+
- 'rvm-exec 1.9.3-p551 bundle exec rake'
|
10
|
+
- 'rvm-exec 2.0.0-p645 bundle exec rake'
|
11
|
+
- 'rvm-exec 2.1.6 bundle exec rake'
|
12
|
+
- 'rvm-exec 2.2.2 bundle exec rake'
|
data/circular.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'circular'
|
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/circular'
|
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 'userinput', '~> 1.0.0'
|
17
|
+
s.add_dependency 'ruby-keychain', '~> 0.3.0'
|
18
|
+
|
19
|
+
s.add_development_dependency 'rubocop', '~> 0.35.0'
|
20
|
+
s.add_development_dependency 'rake', '~> 10.4.0'
|
21
|
+
s.add_development_dependency 'codecov', '~> 0.1.1'
|
22
|
+
s.add_development_dependency 'rspec', '~> 3.3.0'
|
23
|
+
s.add_development_dependency 'fuubar', '~> 2.0.0'
|
24
|
+
s.add_development_dependency 'webmock', '~> 1.22.0'
|
25
|
+
s.add_development_dependency 'vcr', '~> 3.0.0'
|
26
|
+
end
|
data/lib/circular.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'userinput'
|
2
|
+
require 'keychain'
|
3
|
+
|
4
|
+
module Circular
|
5
|
+
class << self
|
6
|
+
def new(*args)
|
7
|
+
self::API.new(*args)
|
8
|
+
end
|
9
|
+
|
10
|
+
def load_token(domain)
|
11
|
+
lookup_token(domain) || UserInput.new(message: "Token for #{domain}").ask
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def lookup_token(domain)
|
17
|
+
entry = Keychain.open(Keychain.default.path).internet_passwords.where(
|
18
|
+
service: domain
|
19
|
+
).first
|
20
|
+
return nil unless entry
|
21
|
+
entry.password
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require 'circular/api'
|
data/lib/circular/api.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
module Circular
|
2
|
+
class API
|
3
|
+
DEFAULT_DOMAIN = 'circleci.com'
|
4
|
+
DEFAULT_PATH = 'api/v1'
|
5
|
+
|
6
|
+
def initialize(params = {})
|
7
|
+
@options = params
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def domain
|
13
|
+
@domain ||= @options[:domain] || DEFAULT_DOMAIN
|
14
|
+
end
|
15
|
+
|
16
|
+
def path
|
17
|
+
@path ||= @options[:path] || DEFAULT_PATH
|
18
|
+
end
|
19
|
+
|
20
|
+
def base
|
21
|
+
@base ||= "https://#{domain}/#{path}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,184 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: circular
|
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: 2015-11-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: userinput
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.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: 1.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ruby-keychain
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.3.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.3.0
|
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.35.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.35.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.4.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 10.4.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: codecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.1.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.1.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 3.3.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 3.3.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: fuubar
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.0.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.0.0
|
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.22.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.22.0
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: vcr
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 3.0.0
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 3.0.0
|
139
|
+
description: ''
|
140
|
+
email: me@lesaker.org
|
141
|
+
executables: []
|
142
|
+
extensions: []
|
143
|
+
extra_rdoc_files: []
|
144
|
+
files:
|
145
|
+
- ".gitignore"
|
146
|
+
- ".rspec"
|
147
|
+
- ".rubocop.yml"
|
148
|
+
- Gemfile
|
149
|
+
- LICENSE
|
150
|
+
- README.md
|
151
|
+
- Rakefile
|
152
|
+
- circle.yml
|
153
|
+
- circular.gemspec
|
154
|
+
- lib/circular.rb
|
155
|
+
- lib/circular/api.rb
|
156
|
+
- spec/circular_spec.rb
|
157
|
+
- spec/spec_helper.rb
|
158
|
+
homepage: https://github.com/akerl/circular
|
159
|
+
licenses:
|
160
|
+
- MIT
|
161
|
+
metadata: {}
|
162
|
+
post_install_message:
|
163
|
+
rdoc_options: []
|
164
|
+
require_paths:
|
165
|
+
- lib
|
166
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '0'
|
171
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
|
+
requirements:
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '0'
|
176
|
+
requirements: []
|
177
|
+
rubyforge_project:
|
178
|
+
rubygems_version: 2.4.5.1
|
179
|
+
signing_key:
|
180
|
+
specification_version: 4
|
181
|
+
summary: ''
|
182
|
+
test_files:
|
183
|
+
- spec/circular_spec.rb
|
184
|
+
- spec/spec_helper.rb
|