truther 0.0.2 → 0.0.3

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: 2a1c06e2b96b3d63caee3be42c1840ff5f437a34
4
- data.tar.gz: c9a9938aafea95e6e26d0c580e1e003cd156e8a8
3
+ metadata.gz: 2fe0a6a29afc15aceb4c9679437dd5d00a57b5f7
4
+ data.tar.gz: 120efec8142397b22cc9f1fc580f39fada80d3c1
5
5
  SHA512:
6
- metadata.gz: 14a10bb03ada51f7de1cf5500843e4bb912735b9f7ffefff9ef121561498e42d8c161f4b480f71b12a35aca7f5a97e2f385cc2a9ffc3a084e3e4c7d81610c6b1
7
- data.tar.gz: 085e59b948a886ede2c699e66ce170e03c9d6373151931129eea3e9d830c858ee6786cac16634514053a9fb6ac53c72f441217d92c2feb3c39c3298702b3d8ba
6
+ metadata.gz: 09f13256e5314469710b9937c6438d20dd7877707e7a7f76a1b3d725b0e5b9820f6a1a6840c7978e07b17755a0e942f5b8ad0797b07d13ac251d406d91544d56
7
+ data.tar.gz: fa090e0ede76cf70a75d45edd7872d7d4f3b0858e842f00f9316c94d1251409d4cc4eb6d73dc4ae323a2cbfd9e8a5eb2809bd940c0bbf02a421e770cf52c75c8
data/README.md CHANGED
@@ -26,7 +26,7 @@ Use `#to_b` on `String`, `Integer`, `Float`, `nil`, `true` or `false`.
26
26
 
27
27
  Check `Truther::TRUTHER_STRINGS` and `Truther::FALSY_STRINGS` to find out how strings are mapped to boolean.
28
28
 
29
- An unrecognized string will raise `Truther::NeitherTrueNoFalseError` unless a default value is provided. In which case the default value will be returned.
29
+ An unrecognized string will raise `Truther::NeitherTrueNorFalseError` unless a default value is provided. In which case the default value will be returned.
30
30
 
31
31
  'maybe'.to_b(:i_dont_know) == :i_dont_know
32
32
 
data/lib/truther.rb CHANGED
@@ -4,7 +4,7 @@ module Truther
4
4
  TRUTHER_STRINGS = ['true', '1', 'yes', 'y', 'oui', 'vrai']
5
5
  FALSY_STRINGS = ['false', '0', 'no', 'n', 'non', 'faux']
6
6
 
7
- class NeitherTrueNoFalseError < StandardError
7
+ class NeitherTrueNorFalseError < StandardError
8
8
  def initialize(str)
9
9
  super("'#{str}' is not recognized as truther or falsy.")
10
10
  end
@@ -18,7 +18,7 @@ class String
18
18
  return false if Truther::FALSY_STRINGS.include? sanitized_string
19
19
 
20
20
  if when_not_recognized == :raise
21
- raise Truther::NeitherTrueNoFalseError.new sanitized_string
21
+ raise Truther::NeitherTrueNorFalseError.new sanitized_string
22
22
  else
23
23
  when_not_recognized
24
24
  end
@@ -1,3 +1,3 @@
1
1
  module Truther
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/spec/truther_spec.rb CHANGED
@@ -23,7 +23,7 @@ describe :to_b do
23
23
  end
24
24
 
25
25
  it 'raises error on unrecognized strings' do
26
- expect {'asdf'.to_b}.to raise_error Truther::NeitherTrueNoFalseError
26
+ expect {'asdf'.to_b}.to raise_error Truther::NeitherTrueNorFalseError
27
27
  end
28
28
 
29
29
  it 'returns default on unrecognized strings' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: truther
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephane Bisson