truther 0.0.4 → 0.0.5

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: c20c75eadc97f9d8b48f6a043797b7a195e3ba1d
4
- data.tar.gz: 8aa4eff040b18f6dd2c4639a600183980b8942a4
3
+ metadata.gz: 54aea950d590f54f8bfcc8ef3669dc04c172b7c6
4
+ data.tar.gz: 52e0879672c656972531a0be3a5e52049f857559
5
5
  SHA512:
6
- metadata.gz: e4ce4bcb0599078b6b86b032b816bb298718e528ad8ac735aaf8eb9b5239127e4f615d5b61293a15c8cf032383dc2a7110a48d35058684eb4e4d22c9d02c1572
7
- data.tar.gz: 9168a8c6ef5ca6119921beb8ddf609232be11b785d8142ccde2aea5462d790408834e7d48f2f34beb59eab0c18a480715ed65590350b03460c88201088f1f329
6
+ metadata.gz: 0ecfcc7e515c88064ce099b881a584ed6304c7e92dcb4567873d5afcdf847dff907a446b486ff8475f5395357ae150d1ab5b31fcc441a37a76ac6b04bec678c3
7
+ data.tar.gz: 427bcd9d4ae939fccbc3b6ba5cb884b6600c95bf5ea7003d7d992744c12dd43feb98cf42fc278bdb92d4e44d41002a67a08e0280d2b3ec5d97af6919765f587a
data/README.md CHANGED
@@ -24,7 +24,7 @@ Use `#to_b` on `String`, `Integer`, `Float`, `nil`, `true` or `false`.
24
24
 
25
25
  'no'.to_b == false
26
26
 
27
- Check `Truther::TRUTHER_STRINGS` and `Truther::FALSY_STRINGS` to find out how strings are mapped to boolean.
27
+ Check `Truther::TRUTHY_STRINGS` and `Truther::FALSY_STRINGS` to find out how strings are mapped to boolean.
28
28
 
29
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
 
data/lib/truther.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "truther/version"
2
2
 
3
3
  module Truther
4
- TRUTHER_STRINGS = ['true', '1', 'yes', 'y', 'oui', 'vrai']
4
+ TRUTHY_STRINGS = ['true', '1', 'yes', 'y', 'oui', 'vrai']
5
5
  FALSY_STRINGS = ['false', '0', 'no', 'n', 'non', 'faux']
6
6
 
7
7
  class NeitherTrueNorFalseError < StandardError
@@ -14,7 +14,7 @@ end
14
14
  class String
15
15
  def to_b(when_not_recognized=:raise)
16
16
  sanitized_string = self.downcase.strip
17
- return true if Truther::TRUTHER_STRINGS.include? sanitized_string
17
+ return true if Truther::TRUTHY_STRINGS.include? sanitized_string
18
18
  return false if Truther::FALSY_STRINGS.include? sanitized_string
19
19
 
20
20
  if when_not_recognized == :raise
@@ -1,3 +1,3 @@
1
1
  module Truther
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephane Bisson