verbose_truth 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/verbose_truth.rb +1 -0
- data/lib/verbose_truth/autoinclude.rb +2 -0
- data/lib/verbose_truth/verbose_truth.rb +51 -0
- data/lib/verbose_truth/version/version.rb +11 -0
- data/test/testing_verbose_truth.rb +6 -0
- data/verbose_truth.gemspec +70 -0
- metadata +62 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6060502e6d6f1ab8751d6405b1be2846c1432972cbd4e46e1ce4618a727032b5
|
4
|
+
data.tar.gz: c4b67647fe9624fb6df43d72ae441a00d67eae9fdc2346a3b0d96b264dff2103
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 66552457b48098f3f5f5f13b8be08d97076a5c77d1b69a340c4c053cadc2458bdc388183d52b84b117769d35f14ecf8e937c901541ec1dc4f9b72d43a83842de
|
7
|
+
data.tar.gz: 1ea5a707c7485fb725bf408c985c5b3eb429f4dbb42de126e3077e73730a6a97d9d1ed92f2b6bbf35612ce8891d8fbe294f84e4f76f86a51150c415ca40b0591
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'verbose_truth/verbose_truth.rb'
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# =========================================================================== #
|
2
|
+
# To use this module, do:
|
3
|
+
# require 'verbose_truth'; include VerboseTruth
|
4
|
+
# =========================================================================== #
|
5
|
+
require 'verbose_truth/version/version.rb'
|
6
|
+
|
7
|
+
module VerboseTruth
|
8
|
+
|
9
|
+
# ========================================================================= #
|
10
|
+
# === VerboseTruth.verbose_truth
|
11
|
+
#
|
12
|
+
# With this method we can convert "true" and "false" into "Yes" and "No",
|
13
|
+
# which allows us to use well-formulated english sentences. For now we
|
14
|
+
# include the '.' character all the time.
|
15
|
+
#
|
16
|
+
# Specific usage examples for this method:
|
17
|
+
# verbose_truth(true)
|
18
|
+
# verbose_truth @traditional
|
19
|
+
# ========================================================================= #
|
20
|
+
def self.verbose_truth(i, append_dot = true)
|
21
|
+
i = i.to_s
|
22
|
+
case append_dot
|
23
|
+
when :no_dot
|
24
|
+
append_dot = false
|
25
|
+
end
|
26
|
+
case i
|
27
|
+
when 'true','t','yes','ja','y','j' # nil
|
28
|
+
i = 'Yes.'
|
29
|
+
when 'false','f','no','nein','n'
|
30
|
+
i = 'No.'
|
31
|
+
else # Default since as of Oct 2014. Also includes "none" and "".
|
32
|
+
i = 'No.'
|
33
|
+
end
|
34
|
+
# ======================================================================= #
|
35
|
+
# Offer a no-dot variant as well.
|
36
|
+
# ======================================================================= #
|
37
|
+
unless append_dot
|
38
|
+
i.chop! if i.end_with? '.'
|
39
|
+
end
|
40
|
+
return i
|
41
|
+
end; self.instance_eval { alias [] verbose_truth } # === VerboseTruth[]
|
42
|
+
|
43
|
+
# ========================================================================= #
|
44
|
+
# === verbose_truth
|
45
|
+
# ========================================================================= #
|
46
|
+
def verbose_truth(i)
|
47
|
+
VerboseTruth.verbose_truth(i)
|
48
|
+
end; alias vt verbose_truth
|
49
|
+
alias yes_no verbose_truth
|
50
|
+
|
51
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# =========================================================================== #
|
2
|
+
# require 'verbose_truth/version/version.rb'
|
3
|
+
# =========================================================================== #
|
4
|
+
module VerboseTruth
|
5
|
+
|
6
|
+
# ========================================================================= #
|
7
|
+
# === VerboseTruth::VERSION
|
8
|
+
# ========================================================================= #
|
9
|
+
VERSION = '1.0.12'
|
10
|
+
|
11
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# =========================================================================== #
|
2
|
+
# Gemspec for Project VerboseTruth.
|
3
|
+
# =========================================================================== #
|
4
|
+
require 'verbose_truth/version/version.rb'
|
5
|
+
|
6
|
+
Gem::Specification.new { |s|
|
7
|
+
|
8
|
+
s.name = 'verbose_truth'
|
9
|
+
s.version = VerboseTruth::VERSION
|
10
|
+
s.date = Time.now.strftime('%Y-%m-%d')
|
11
|
+
|
12
|
+
s.summary = <<-EOF
|
13
|
+
|
14
|
+
This tiny module is called verbose_truth.
|
15
|
+
|
16
|
+
It just has one method called verbose_truth().
|
17
|
+
|
18
|
+
It will take a boolean value such as true or false, and
|
19
|
+
convert this into a string called Yes or No.
|
20
|
+
|
21
|
+
Now you may wonder why anyone needs this - the answer
|
22
|
+
is quite simple. Sometimes one may need a written-english
|
23
|
+
form of a boolean value, and this is exactly when one
|
24
|
+
may need this functionality.
|
25
|
+
|
26
|
+
If you have specific suggestions to make this gem more
|
27
|
+
useful for others, please drop me an email at:
|
28
|
+
|
29
|
+
shevegen@gmail.com
|
30
|
+
|
31
|
+
Thank you.
|
32
|
+
|
33
|
+
EOF
|
34
|
+
|
35
|
+
s.description = <<-EOF
|
36
|
+
|
37
|
+
This tiny module is called verbose_truth.
|
38
|
+
|
39
|
+
It just has one method called verbose_truth().
|
40
|
+
|
41
|
+
It will take a boolean value such as true or false, and
|
42
|
+
convert this into a string called Yes or No.
|
43
|
+
|
44
|
+
Now you may wonder why anyone needs this - the answer
|
45
|
+
is quite simple. Sometimes one may need a written-english
|
46
|
+
form of a boolean value, and this is exactly when one
|
47
|
+
may need this functionality.
|
48
|
+
|
49
|
+
If you have specific suggestions to make this gem more
|
50
|
+
useful for others, please drop me an email at:
|
51
|
+
|
52
|
+
shevegen@gmail.com
|
53
|
+
|
54
|
+
Thank you.
|
55
|
+
|
56
|
+
EOF
|
57
|
+
|
58
|
+
s.extra_rdoc_files = %w()
|
59
|
+
|
60
|
+
s.authors = ['Robert A. Heiler']
|
61
|
+
s.email = 'shevegen@gmail.com'
|
62
|
+
s.files = Dir['**/*']
|
63
|
+
s.license = 'GPL-2.0'
|
64
|
+
s.homepage = 'http://rubygems.org/gems/verbose_truth'
|
65
|
+
|
66
|
+
s.required_ruby_version = '>= '+RUBY_VERSION
|
67
|
+
s.required_rubygems_version = '>= '+Gem::VERSION
|
68
|
+
s.rubygems_version = '>= '+Gem::VERSION
|
69
|
+
|
70
|
+
}
|
metadata
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: verbose_truth
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.12
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Robert A. Heiler
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-07-12 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: "\n This tiny module is called verbose_truth.\n\n It just has one
|
14
|
+
method called verbose_truth().\n\n It will take a boolean value such as true
|
15
|
+
or false, and\n convert this into a string called Yes or No.\n \n Now you
|
16
|
+
may wonder why anyone needs this - the answer\n is quite simple. Sometimes one
|
17
|
+
may need a written-english\n form of a boolean value, and this is exactly when
|
18
|
+
one\n may need this functionality.\n\n If you have specific suggestions to
|
19
|
+
make this gem more\n useful for others, please drop me an email at:\n\n shevegen@gmail.com\n\n
|
20
|
+
\ Thank you.\n\n"
|
21
|
+
email: shevegen@gmail.com
|
22
|
+
executables: []
|
23
|
+
extensions: []
|
24
|
+
extra_rdoc_files: []
|
25
|
+
files:
|
26
|
+
- lib/verbose_truth.rb
|
27
|
+
- lib/verbose_truth/autoinclude.rb
|
28
|
+
- lib/verbose_truth/verbose_truth.rb
|
29
|
+
- lib/verbose_truth/version/version.rb
|
30
|
+
- test/testing_verbose_truth.rb
|
31
|
+
- verbose_truth.gemspec
|
32
|
+
homepage: http://rubygems.org/gems/verbose_truth
|
33
|
+
licenses:
|
34
|
+
- GPL-2.0
|
35
|
+
metadata: {}
|
36
|
+
post_install_message:
|
37
|
+
rdoc_options: []
|
38
|
+
require_paths:
|
39
|
+
- lib
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 2.5.1
|
45
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 2.7.7
|
50
|
+
requirements: []
|
51
|
+
rubyforge_project:
|
52
|
+
rubygems_version: 2.7.7
|
53
|
+
signing_key:
|
54
|
+
specification_version: 4
|
55
|
+
summary: 'This tiny module is called verbose_truth. It just has one method called
|
56
|
+
verbose_truth(). It will take a boolean value such as true or false, and convert
|
57
|
+
this into a string called Yes or No. Now you may wonder why anyone needs this -
|
58
|
+
the answer is quite simple. Sometimes one may need a written-english form of a boolean
|
59
|
+
value, and this is exactly when one may need this functionality. If you have specific
|
60
|
+
suggestions to make this gem more useful for others, please drop me an email at: shevegen@gmail.com Thank
|
61
|
+
you.'
|
62
|
+
test_files: []
|