prospectus 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/prospectus +2 -2
- data/lib/prospectus/helpers/regex.rb +1 -1
- data/lib/prospectus/item.rb +4 -2
- data/lib/prospectus/modules/gemnasium.rb +2 -2
- data/lib/prospectus/modules/git_hash.rb +1 -1
- data/lib/prospectus/modules/git_tag.rb +1 -1
- data/lib/prospectus/modules/github_hash.rb +1 -1
- data/lib/prospectus/modules/github_release.rb +1 -1
- data/lib/prospectus/modules/github_tag.rb +1 -1
- data/lib/prospectus/modules/gitlab_tag.rb +1 -1
- data/lib/prospectus/modules/grep.rb +2 -2
- data/lib/prospectus/modules/homebrew_cask.rb +1 -1
- data/lib/prospectus/modules/homebrew_formula.rb +1 -1
- data/lib/prospectus/modules/static.rb +1 -1
- data/lib/prospectus/modules/url_xpath.rb +2 -2
- data/lib/prospectus/version.rb +1 -1
- data/prospectus.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09e3eb70e15d9d758dfb44b958b5bc5a0c965abe
|
4
|
+
data.tar.gz: 46af1179d96eaddefcae2f4873efa3925a96d200
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05ce7e4674f3337ac8aa392b33ee60e7d5c36bed6d9a1489d291c2a3b20d143a41b38c7c17aa4f0b78d7880f463ad057c82c63439b0fb86cbc54aa87b53f6f37
|
7
|
+
data.tar.gz: 59ce1dc03534fbb9efe9d4618004a4f22ca3a2f6e9ff3359f97df1388a6cd67eb5d6efd72428b8bf23819c7e4c8322bc0af8e2ad9fcb9f66644205b95c1dbcdc
|
data/bin/prospectus
CHANGED
@@ -12,9 +12,9 @@ end
|
|
12
12
|
|
13
13
|
def load_list(params)
|
14
14
|
return run_file(params) if File.exist? '.prospectus'
|
15
|
-
|
15
|
+
raise('No .prospectus/.prospectus.d found') unless Dir.exist? '.prospectus.d'
|
16
16
|
files = Dir.glob('.prospectus.d/*')
|
17
|
-
|
17
|
+
raise('No files in .prospectus.d') if files.empty?
|
18
18
|
files.map { |x| run_file(params, x) }.flatten
|
19
19
|
end
|
20
20
|
|
@@ -5,7 +5,7 @@ module LogCabin
|
|
5
5
|
module Regex
|
6
6
|
def regex_helper(value)
|
7
7
|
return value unless @find
|
8
|
-
|
8
|
+
raise("Value does not match regex: #{value}") unless value.match(@find)
|
9
9
|
value.sub(@find, @replace)
|
10
10
|
end
|
11
11
|
|
data/lib/prospectus/item.rb
CHANGED
@@ -19,11 +19,11 @@ module Prospectus
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def expected
|
22
|
-
@expected ||
|
22
|
+
@expected || raise("No expected state was loaded for #{name}")
|
23
23
|
end
|
24
24
|
|
25
25
|
def actual
|
26
|
-
@actual ||
|
26
|
+
@actual || raise("No actual state was loaded for #{name}")
|
27
27
|
end
|
28
28
|
|
29
29
|
def to_json(_ = {})
|
@@ -64,6 +64,8 @@ module Prospectus
|
|
64
64
|
def state(name, &block)
|
65
65
|
state = Prospectus::State.from_block(@options, &block)
|
66
66
|
@item.instance_variable_set(name, state.value)
|
67
|
+
rescue => e
|
68
|
+
raise("Failed to set #{name} state for #{@item.name}: #{e.message}")
|
67
69
|
end
|
68
70
|
end
|
69
71
|
end
|
@@ -8,7 +8,7 @@ module LogCabin
|
|
8
8
|
# Pull state from Gemnasium
|
9
9
|
module Gemnasium
|
10
10
|
def load!
|
11
|
-
|
11
|
+
raise('No slug provided') unless @slug
|
12
12
|
@state.value = parse_api
|
13
13
|
end
|
14
14
|
|
@@ -38,7 +38,7 @@ module LogCabin
|
|
38
38
|
|
39
39
|
def validate_response(resp)
|
40
40
|
return resp if resp.is_a? Array
|
41
|
-
|
41
|
+
raise("API lookup on gemnasium failed: #{resp['message']}")
|
42
42
|
end
|
43
43
|
|
44
44
|
def creds
|
@@ -6,7 +6,7 @@ module LogCabin
|
|
6
6
|
include Prospectus.helpers.find(:regex)
|
7
7
|
|
8
8
|
def load!
|
9
|
-
|
9
|
+
raise('No file specified') unless @file
|
10
10
|
@find ||= '.*'
|
11
11
|
line = read_file
|
12
12
|
@state.value = regex_helper(line)
|
@@ -19,7 +19,7 @@ module LogCabin
|
|
19
19
|
line = line.chomp
|
20
20
|
return line if line.match(@find)
|
21
21
|
end
|
22
|
-
|
22
|
+
raise("No lines in #{@file} matched #{@find}")
|
23
23
|
end
|
24
24
|
|
25
25
|
def file(value)
|
@@ -4,7 +4,7 @@ module LogCabin
|
|
4
4
|
# Pull state from a homebrew cask file
|
5
5
|
module HomebrewCask
|
6
6
|
def load!
|
7
|
-
|
7
|
+
raise('No name specified') unless @name
|
8
8
|
cask_file = "Casks/#{@name}.rb"
|
9
9
|
version_regex = /^\s+version ['"](.+)['"]$/
|
10
10
|
Prospectus::State.from_block(@option, @state) do
|
@@ -4,7 +4,7 @@ module LogCabin
|
|
4
4
|
# Pull state from a homebrew formula file
|
5
5
|
module HomebrewFormula
|
6
6
|
def load!
|
7
|
-
|
7
|
+
raise('No name specified') unless @name
|
8
8
|
cask_file = "Formula/#{@name}.rb"
|
9
9
|
version_regex = /^\s+version ['"](.+)['"]$/
|
10
10
|
Prospectus::State.from_block(@option, @state) do
|
@@ -10,8 +10,8 @@ module LogCabin
|
|
10
10
|
include Prospectus.helpers.find(:regex)
|
11
11
|
|
12
12
|
def load!
|
13
|
-
|
14
|
-
|
13
|
+
raise('No url provided') unless @url
|
14
|
+
raise('No xpath provided') unless @xpath
|
15
15
|
text = parse_page
|
16
16
|
@state.value = regex_helper(text)
|
17
17
|
end
|
data/lib/prospectus/version.rb
CHANGED
data/prospectus.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_dependency 'mercenary', '~> 0.3.4'
|
21
21
|
s.add_dependency 'logcabin', '~> 0.0.1'
|
22
22
|
|
23
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
23
|
+
s.add_development_dependency 'rubocop', '~> 0.37.0'
|
24
24
|
s.add_development_dependency 'rake', '~> 10.5.0'
|
25
25
|
s.add_development_dependency 'codecov', '~> 0.1.1'
|
26
26
|
s.add_development_dependency 'rspec', '~> 3.4.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prospectus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Les Aker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mercenary
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.37.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.37.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|