truther 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4ef43222e0c4a36ad3b2cdd621f8a8370632fa4
4
- data.tar.gz: ce30bfe4db2ef424cf991592f386c95c96df8ae8
3
+ metadata.gz: 2a1c06e2b96b3d63caee3be42c1840ff5f437a34
4
+ data.tar.gz: c9a9938aafea95e6e26d0c580e1e003cd156e8a8
5
5
  SHA512:
6
- metadata.gz: a4abb775f92e3128262749bee91bfd0940fb7591b663a2680ecb85fa66b56ff4cfc5cb8d30c382767320797078e5de00965e19908c409c4fcdc3e5cd14374f9a
7
- data.tar.gz: 65099bab315c6991c38b409856cf93c28a6e8eb066e6ae320b4aff82f82c4e9d7208e9026a2ec34aae64c6d66b2b4666a4b191595ccb37e6196c4cd5f1c8238b
6
+ metadata.gz: 14a10bb03ada51f7de1cf5500843e4bb912735b9f7ffefff9ef121561498e42d8c161f4b480f71b12a35aca7f5a97e2f385cc2a9ffc3a084e3e4c7d81610c6b1
7
+ data.tar.gz: 085e59b948a886ede2c699e66ce170e03c9d6373151931129eea3e9d830c858ee6786cac16634514053a9fb6ac53c72f441217d92c2feb3c39c3298702b3d8ba
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in truthy.gemspec
3
+ # Specify your gem's dependencies in truther.gemspec
4
4
  gemspec
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Truther
2
2
 
3
- Easy convertion to boolean from truthy and falsy values.
3
+ Easy convertion to boolean from truther and falsy values.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'truthy'
9
+ gem 'truther'
10
10
 
11
11
  And then execute:
12
12
 
@@ -14,7 +14,7 @@ And then execute:
14
14
 
15
15
  Or install it yourself as:
16
16
 
17
- $ gem install truthy
17
+ $ gem install truther
18
18
 
19
19
  ## Usage
20
20
 
@@ -24,15 +24,15 @@ Use `#to_b` on `String`, `Integer`, `Float`, `nil`, `true` or `false`.
24
24
 
25
25
  'no'.to_b == false
26
26
 
27
- Check `Truthy::TRUTHY_STRINGS` and `Truthy::FALSY_STRINGS` to find out how strings are mapped to boolean.
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 `Truthy::NeitherTrueNoFalseError` unless a default value is provided. In which case the default value will be returned.
29
+ An unrecognized string will raise `Truther::NeitherTrueNoFalseError` 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
 
33
33
  ## Contributing
34
34
 
35
- 1. Fork it ( http://github.com/stephanebisson/truthy/fork )
35
+ 1. Fork it ( http://github.com/stephanebisson/truther/fork )
36
36
  2. Create your feature branch (`git checkout -b my-new-feature`)
37
37
  3. Commit your changes (`git commit -am 'Add some feature'`)
38
38
  4. Push to the branch (`git push origin my-new-feature`)
@@ -1,12 +1,12 @@
1
- require "truthy/version"
1
+ require "truther/version"
2
2
 
3
- module Truthy
4
- TRUTHY_STRINGS = ['true', '1', 'yes', 'y', 'oui', 'vrai']
3
+ module Truther
4
+ TRUTHER_STRINGS = ['true', '1', 'yes', 'y', 'oui', 'vrai']
5
5
  FALSY_STRINGS = ['false', '0', 'no', 'n', 'non', 'faux']
6
6
 
7
7
  class NeitherTrueNoFalseError < StandardError
8
8
  def initialize(str)
9
- super("'#{str}' is not recognized as truthy or falsy.")
9
+ super("'#{str}' is not recognized as truther or falsy.")
10
10
  end
11
11
  end
12
12
  end
@@ -14,11 +14,11 @@ 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 Truthy::TRUTHY_STRINGS.include? sanitized_string
18
- return false if Truthy::FALSY_STRINGS.include? sanitized_string
17
+ return true if Truther::TRUTHER_STRINGS.include? sanitized_string
18
+ return false if Truther::FALSY_STRINGS.include? sanitized_string
19
19
 
20
20
  if when_not_recognized == :raise
21
- raise Truthy::NeitherTrueNoFalseError.new sanitized_string
21
+ raise Truther::NeitherTrueNoFalseError.new sanitized_string
22
22
  else
23
23
  when_not_recognized
24
24
  end
@@ -0,0 +1,3 @@
1
+ module Truther
2
+ VERSION = "0.0.2"
3
+ end
@@ -1,4 +1,4 @@
1
- require 'truthy'
1
+ require 'truther'
2
2
 
3
3
  describe :to_b do
4
4
 
@@ -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 Truthy::NeitherTrueNoFalseError
26
+ expect {'asdf'.to_b}.to raise_error Truther::NeitherTrueNoFalseError
27
27
  end
28
28
 
29
29
  it 'returns default on unrecognized strings' do
@@ -1,11 +1,11 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'truthy/version'
4
+ require 'truther/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "truther"
8
- spec.version = Truthy::VERSION
8
+ spec.version = Truther::VERSION
9
9
  spec.authors = ["Stephane Bisson"]
10
10
  spec.email = ["stephane.c.bisson@gmail.com"]
11
11
  spec.summary = "Converts many strings to their boolean value."
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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephane Bisson
@@ -64,10 +64,10 @@ files:
64
64
  - LICENSE.txt
65
65
  - README.md
66
66
  - Rakefile
67
- - lib/truthy.rb
68
- - lib/truthy/version.rb
69
- - spec/truthy_spec.rb
70
- - truthy.gemspec
67
+ - lib/truther.rb
68
+ - lib/truther/version.rb
69
+ - spec/truther_spec.rb
70
+ - truther.gemspec
71
71
  homepage: ''
72
72
  licenses:
73
73
  - MIT
@@ -93,4 +93,4 @@ signing_key:
93
93
  specification_version: 4
94
94
  summary: Converts many strings to their boolean value.
95
95
  test_files:
96
- - spec/truthy_spec.rb
96
+ - spec/truther_spec.rb
@@ -1,3 +0,0 @@
1
- module Truthy
2
- VERSION = "0.0.1"
3
- end