prospectus_travis 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/prospectus_travis.rb +38 -29
- data/prospectus_travis.gemspec +3 -3
- metadata +5 -6
- data/circle.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34da36f5bf8ce5afb578c2f73233a8942778b51b857011ffaace1c32002a266c
|
4
|
+
data.tar.gz: ee6bccb4b93cc3e8604fa81638d693947dccd2ffa8b168c1cb0e7884f01aea9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cddcfeceb90f494814a824c65842cf3f34f893ba53de617576b601f8508433c778000730921c99e6e8678798a8bca5dcaca15c8b1a436bbcd5cb1a968538a29
|
7
|
+
data.tar.gz: 586522bac17d4bca608fb27689d60de434c7309625c8d664a2e8fb807476e3b3eb98c7e850fb07e43a61fcddca388e596c51545de3cb25b40acf87d2e006c5bd
|
data/lib/prospectus_travis.rb
CHANGED
@@ -7,30 +7,18 @@ module ProspectusTravis
|
|
7
7
|
FAKE_BUILD = Struct.new(:state)
|
8
8
|
|
9
9
|
##
|
10
|
-
#
|
11
|
-
class
|
10
|
+
# Lookup describes a TravisCI lookup
|
11
|
+
class Lookup
|
12
12
|
def initialize(repo_slug)
|
13
|
-
@repo_slug = repo_slug
|
13
|
+
@repo_slug = repo_slug
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
|
18
|
-
|
19
|
-
other.deps do
|
20
|
-
item do
|
21
|
-
name 'travis'
|
22
|
-
|
23
|
-
expected do
|
24
|
-
static
|
25
|
-
set expected_val
|
26
|
-
end
|
16
|
+
def expected
|
17
|
+
@expected ||= GOOD_STATUSES.include?(actual) ? actual : 'passed'
|
18
|
+
end
|
27
19
|
|
28
|
-
|
29
|
-
|
30
|
-
set actual_val
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
20
|
+
def actual
|
21
|
+
@actual ||= last_build.state
|
34
22
|
end
|
35
23
|
|
36
24
|
private
|
@@ -39,15 +27,6 @@ module ProspectusTravis
|
|
39
27
|
@client ||= Travis::Client.new(uri: uri, access_token: token)
|
40
28
|
end
|
41
29
|
|
42
|
-
def parse_status
|
43
|
-
return [status, status] if GOOD_STATUSES.include?(status)
|
44
|
-
[status, 'passed']
|
45
|
-
end
|
46
|
-
|
47
|
-
def status
|
48
|
-
@status ||= last_build.state
|
49
|
-
end
|
50
|
-
|
51
30
|
def last_build
|
52
31
|
@last_build ||= repo.last_build || FAKE_BUILD.new('no_results')
|
53
32
|
end
|
@@ -67,4 +46,34 @@ module ProspectusTravis
|
|
67
46
|
@token = credential.get!(msg).password
|
68
47
|
end
|
69
48
|
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# Helper for automatically adding build status check
|
52
|
+
class Build < Module
|
53
|
+
def initialize(repo_slug)
|
54
|
+
@repo_slug = repo_slug || raise('No repo specified')
|
55
|
+
end
|
56
|
+
|
57
|
+
def extended(other) # rubocop:disable Metrics/MethodLength
|
58
|
+
lookup = Lookup.new(@repo_slug)
|
59
|
+
|
60
|
+
other.deps do
|
61
|
+
item do
|
62
|
+
name 'travis'
|
63
|
+
|
64
|
+
expected do
|
65
|
+
define_singleton_method(:load) do
|
66
|
+
lookup.expected
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
actual do
|
71
|
+
define_singleton_method(:load) do
|
72
|
+
lookup.actual
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
70
79
|
end
|
data/prospectus_travis.gemspec
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'prospectus_travis'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.4'
|
4
4
|
s.date = Time.now.strftime('%Y-%m-%d')
|
5
5
|
|
6
6
|
s.summary = 'Prospectus helpers for TravisCI'
|
7
7
|
s.description = 'Prospectus helpers for TravisCI'
|
8
8
|
s.authors = ['Les Aker']
|
9
9
|
s.email = 'me@lesaker.org'
|
10
|
-
s.homepage = 'https://github.com/
|
10
|
+
s.homepage = 'https://github.com/akerl/prospectus_travis'
|
11
11
|
s.license = 'MIT'
|
12
12
|
|
13
13
|
s.files = `git ls-files`.split
|
14
14
|
s.test_files = `git ls-files spec/*`.split
|
15
15
|
|
16
16
|
s.add_dependency 'keylime', '~> 0.2.1'
|
17
|
-
s.add_dependency 'prospectus', '~> 0.
|
17
|
+
s.add_dependency 'prospectus', '~> 0.7.0'
|
18
18
|
s.add_dependency 'travis', '~> 1.8.9'
|
19
19
|
|
20
20
|
s.add_development_dependency 'codecov', '~> 0.1.1'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prospectus_travis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Les Aker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: keylime
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.7.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.7.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: travis
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,12 +152,11 @@ files:
|
|
152
152
|
- LICENSE
|
153
153
|
- README.md
|
154
154
|
- Rakefile
|
155
|
-
- circle.yml
|
156
155
|
- lib/prospectus_travis.rb
|
157
156
|
- prospectus_travis.gemspec
|
158
157
|
- spec/prospectus_travis_spec.rb
|
159
158
|
- spec/spec_helper.rb
|
160
|
-
homepage: https://github.com/
|
159
|
+
homepage: https://github.com/akerl/prospectus_travis
|
161
160
|
licenses:
|
162
161
|
- MIT
|
163
162
|
metadata: {}
|