render-text-helper 0.1.0 → 0.2.0
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 +4 -4
- data/.rubocop.yml +7 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +7 -5
- data/lib/render/text/helper/boolean.rb +4 -3
- data/lib/render/text/helper/version.rb +1 -1
- data/render-text-helper.gemspec +0 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdefeb74f5cc8c0757071203881ea156d45e126c5006c04afbd02233d2aa6196
|
4
|
+
data.tar.gz: 82aba1c3a82dfcbe9f1179a091a674243da9e255f7ebd5500eee919faec6a4c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2864cad96f2ad569c8ddf5938f03407701393881f1927aabe6bca4121d2d0700482031543e2fff8fa619b56d6d3806503d6c5f77daf46e79f8e35be70399172
|
7
|
+
data.tar.gz: 8edeb432377b5395aa56298f152298f423595bbc53061673211442a8bd12c24224035b80ede4b6abcbcac7fc67969e4183ac516ea2ef791c0bb6481e3ec15453
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -37,19 +37,21 @@ defaults to "."
|
|
37
37
|
### to yes no
|
38
38
|
|
39
39
|
This function returns a string from a boolean to yes or no.
|
40
|
+
It takes in optional casting parameter which can be either capitalize, upcase, or downcase.
|
40
41
|
|
41
42
|
```ruby
|
42
43
|
true.to_yes_no
|
43
|
-
'
|
44
|
+
'Yes'
|
44
45
|
|
45
|
-
true.to_yes_no(
|
46
|
+
true.to_yes_no(:upcase)
|
46
47
|
'YES'
|
47
48
|
|
48
|
-
false.to_yes_no
|
49
|
+
false.to_yes_no(:downcase)
|
49
50
|
'no'
|
50
51
|
|
51
|
-
false.to_yes_no
|
52
|
-
|
52
|
+
false.to_yes_no
|
53
|
+
false.to_yes_no(:capitalize)
|
54
|
+
'No'
|
53
55
|
```
|
54
56
|
|
55
57
|
### to yn
|
@@ -10,11 +10,12 @@ module BooleanHelper
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
# casting: capitalize | upcase | downcase
|
14
|
+
def to_yes_no(casting = :capitalize)
|
14
15
|
if self
|
15
|
-
|
16
|
+
'yes'.send(casting.to_sym)
|
16
17
|
else
|
17
|
-
|
18
|
+
'no'.send(casting.to_sym)
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
data/render-text-helper.gemspec
CHANGED
@@ -20,8 +20,6 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.metadata['source_code_uri'] = 'https://github.com/SaimonL/render-text-helper'
|
21
21
|
spec.metadata['changelog_uri'] = 'https://github.com/SaimonL/render-text-helper/blob/master/CHANGELOG.md'
|
22
22
|
|
23
|
-
# Specify which files should be added to the gem when it is released.
|
24
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
23
|
spec.files = Dir.chdir(__dir__) do
|
26
24
|
`git ls-files -z`.split("\x0").reject do |f|
|
27
25
|
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
@@ -30,10 +28,4 @@ Gem::Specification.new do |spec|
|
|
30
28
|
spec.bindir = 'exe'
|
31
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
30
|
spec.require_paths = ['lib']
|
33
|
-
|
34
|
-
# Uncomment to register a new dependency of your gem
|
35
|
-
# spec.add_dependency "example-gem", "~> 1.0"
|
36
|
-
|
37
|
-
# For more information and examples about making a new gem, check out our
|
38
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
39
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: render-text-helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saimon Lovell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Limit the render text, convert boolean to text etc
|
14
14
|
email:
|