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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe7f317b732d90d80f3d84e14661fafba07689d5
4
- data.tar.gz: da0cafc823726a687ee26c28cbb0b1793e2dd1a3
3
+ metadata.gz: 09e3eb70e15d9d758dfb44b958b5bc5a0c965abe
4
+ data.tar.gz: 46af1179d96eaddefcae2f4873efa3925a96d200
5
5
  SHA512:
6
- metadata.gz: 055911dbbdac5e599e39b4e7e70fc067365ff33775f032312a55de48c2369216d0acc1d6d74c6059bac628453dae8306e06554dc51323110bcb993e0cd89ee43
7
- data.tar.gz: 4bcefbeee574b7c6cd87127a50c681da94fa8c55096452d528a9ec3bfa2b2bd8a17f4909001a51bb59b473a3a6179865ba88fc6c9b19dcf2b0254a03f402c51f
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
- fail('No .prospectus/.prospectus.d found') unless Dir.exist? '.prospectus.d'
15
+ raise('No .prospectus/.prospectus.d found') unless Dir.exist? '.prospectus.d'
16
16
  files = Dir.glob('.prospectus.d/*')
17
- fail('No files in .prospectus.d') if files.empty?
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
- fail("Value does not match regex: #{value}") unless value.match(@find)
8
+ raise("Value does not match regex: #{value}") unless value.match(@find)
9
9
  value.sub(@find, @replace)
10
10
  end
11
11
 
@@ -19,11 +19,11 @@ module Prospectus
19
19
  end
20
20
 
21
21
  def expected
22
- @expected || fail("No expected state was loaded for #{name}")
22
+ @expected || raise("No expected state was loaded for #{name}")
23
23
  end
24
24
 
25
25
  def actual
26
- @actual || fail("No actual state was loaded for #{name}")
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
- fail('No slug provided') unless @slug
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
- fail("API lookup on gemnasium failed: #{resp['message']}")
41
+ raise("API lookup on gemnasium failed: #{resp['message']}")
42
42
  end
43
43
 
44
44
  def creds
@@ -9,7 +9,7 @@ module LogCabin
9
9
  chdir_helper do
10
10
  short_arg = @long ? '' : '--short'
11
11
  hash = `git rev-parse #{short_arg} HEAD 2>/dev/null`.chomp
12
- fail('No hash found') if hash.empty?
12
+ raise('No hash found') if hash.empty?
13
13
  @state.value = hash
14
14
  end
15
15
  end
@@ -7,7 +7,7 @@ module LogCabin
7
7
 
8
8
  def load!
9
9
  tag = `git describe --tags --abbrev=0 2>/dev/null`.chomp
10
- fail('No tags found') if tag.empty?
10
+ raise('No tags found') if tag.empty?
11
11
  @state.value = regex_helper(tag)
12
12
  end
13
13
  end
@@ -6,7 +6,7 @@ module LogCabin
6
6
  include Prospectus.helpers.find(:github_api)
7
7
 
8
8
  def load!
9
- fail('No repo specified') unless @repo
9
+ raise('No repo specified') unless @repo
10
10
  @branch ||= 'master'
11
11
  @state.value = @long ? hash : hash.slice(0, 7)
12
12
  end
@@ -10,7 +10,7 @@ module LogCabin
10
10
  include Prospectus.helpers.find(:github_api)
11
11
 
12
12
  def load!
13
- fail('No repo specified') unless @repo
13
+ raise('No repo specified') unless @repo
14
14
  @state.value = regex_helper(release)
15
15
  end
16
16
 
@@ -10,7 +10,7 @@ module LogCabin
10
10
  include Prospectus.helpers.find(:github_api)
11
11
 
12
12
  def load!
13
- fail('No repo specified') unless @repo
13
+ raise('No repo specified') unless @repo
14
14
  @state.value = regex_helper(tag)
15
15
  end
16
16
 
@@ -10,7 +10,7 @@ module LogCabin
10
10
  include Prospectus.helpers.find(:gitlab_api)
11
11
 
12
12
  def load!
13
- fail('No repo specified') unless @repo
13
+ raise('No repo specified') unless @repo
14
14
  @state.value = regex_helper(tag)
15
15
  end
16
16
 
@@ -6,7 +6,7 @@ module LogCabin
6
6
  include Prospectus.helpers.find(:regex)
7
7
 
8
8
  def load!
9
- fail('No file specified') unless @file
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
- fail("No lines in #{@file} matched #{@find}")
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
- fail('No name specified') unless @name
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
- fail('No name specified') unless @name
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
@@ -4,7 +4,7 @@ module LogCabin
4
4
  # Simple text class, uses "set 'value'" to declare value
5
5
  module Static
6
6
  def load!
7
- fail('Must use `set` to provide a value') unless @value
7
+ raise('Must use `set` to provide a value') unless @value
8
8
  @state.value = @value
9
9
  end
10
10
 
@@ -10,8 +10,8 @@ module LogCabin
10
10
  include Prospectus.helpers.find(:regex)
11
11
 
12
12
  def load!
13
- fail('No url provided') unless @url
14
- fail('No xpath provided') unless @xpath
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
@@ -2,5 +2,5 @@
2
2
  ##
3
3
  # Declare package version
4
4
  module Prospectus
5
- VERSION = '0.0.12'.freeze
5
+ VERSION = '0.0.13'.freeze
6
6
  end
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.36.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.12
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-01-28 00:00:00.000000000 Z
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.36.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.36.0
54
+ version: 0.37.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement