prospectus 0.5.2 → 0.5.4

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: 83528b3a70be01cbc27824c8318f267c847d08a6
4
- data.tar.gz: 9a4c702c0631f0a88ec17628a835099730a5b481
3
+ metadata.gz: 98e4943311a0f54dfb48595d48746fb5270b109b
4
+ data.tar.gz: 14e9a8b1a8325797096f9e11d12221ea516232f8
5
5
  SHA512:
6
- metadata.gz: 3b9b9c03b87ae7180d07d1e0add8d700909d0dc02acbc20ded217903ca3f88522f9187c5ccc8a9357d1b109a9a793051ae9e6e86ed0a9bef20685b2f8062923f
7
- data.tar.gz: 46eaf6415607205e6367258f84dd14a5ad4204db4458aa30d3b1b3e59ff573a62f34785352220fd92891a7b924c252705a50ba30167ea0b12b0819dabe128bb8
6
+ metadata.gz: a6cc639fa2ecd224c6a270d61d7997e72f0f2e4ff24faaa9f3cd91322e99c6fdcaf0d6a63249d1d923dc3eedea643cea06b9ecacadebfceab7b697a9bbb6ce8b
7
+ data.tar.gz: be74c72f50bb7cb4276c2a5506335788ca5aa86d9cbc6965ab98792a550361721db0b34dca2ae2f614558a0576d41a82b05172a3344e374b004b3cfe63cdee62
@@ -25,8 +25,10 @@ module Prospectus
25
25
  end
26
26
 
27
27
  def noop
28
- @expected = 'noop'
29
- @actual = 'noop'
28
+ x = State.new
29
+ x.value = 'noop'
30
+ @expected = x
31
+ @actual = x
30
32
  end
31
33
 
32
34
  def expected
@@ -38,7 +40,7 @@ module Prospectus
38
40
  end
39
41
 
40
42
  def to_json(_ = {})
41
- { name: name, expected: expected, actual: actual }.to_json
43
+ { name: name, expected: expected.value, actual: actual.value }.to_json
42
44
  end
43
45
  end
44
46
 
@@ -75,7 +77,7 @@ module Prospectus
75
77
 
76
78
  def state(name, &block)
77
79
  state = Prospectus::State.from_block(@options, &block)
78
- @item.instance_variable_set(name, state.value)
80
+ @item.instance_variable_set(name, state)
79
81
  rescue => e
80
82
  raise("Failed to set #{name} state for #{@item.name}: #{e.message}")
81
83
  end
@@ -13,7 +13,7 @@ module Prospectus
13
13
  def check
14
14
  all, good_only = @options.values_at(:all, :good_only)
15
15
  items.select do |x|
16
- match = x.expected == x.actual
16
+ match = x.actual =~ x.expected
17
17
  true if all || (!match ^ good_only)
18
18
  end
19
19
  end
@@ -21,7 +21,7 @@ module LogCabin
21
21
  return @release if @release
22
22
  releases = github_api.releases(@repo)
23
23
  %i[draft prerelease].each { |x| releases.reject!(&x) }
24
- @release = filter_helper(releases.map(&:tag_name).first
24
+ @release = filter_helper(releases.map(&:tag_name)).first
25
25
  end
26
26
  end
27
27
  end
@@ -15,6 +15,18 @@ module Prospectus
15
15
  dsl.load!
16
16
  state
17
17
  end
18
+
19
+ def =~(other)
20
+ return super unless other.is_a? Prospectus::State
21
+ ov = other.value
22
+ return ov.include?(@value) if ov.is_a? Enumerable
23
+ return @value =~ ov if ov.is_a? Regexp
24
+ @value == ov
25
+ end
26
+
27
+ def to_s
28
+ @value.to_s
29
+ end
18
30
  end
19
31
 
20
32
  ##
@@ -3,5 +3,5 @@
3
3
  ##
4
4
  # Declare package version
5
5
  module Prospectus
6
- VERSION = '0.5.2'.freeze
6
+ VERSION = '0.5.4'.freeze
7
7
  end
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.5.2
4
+ version: 0.5.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: 2017-07-30 00:00:00.000000000 Z
11
+ date: 2017-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mercenary