string_foundation 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +9 -9
  4. data/Gemfile.lock +19 -19
  5. data/{LICENSE.txt → LICENSE} +1 -1
  6. data/PULL_REQUEST_TEMPLATE.md +14 -0
  7. data/README.md +244 -104
  8. data/Rakefile +3 -3
  9. data/bin/console +1 -0
  10. data/coverage/assets/{0.10.0 → 0.10.2}/application.css +0 -0
  11. data/coverage/assets/{0.10.0 → 0.10.2}/application.js +0 -0
  12. data/coverage/assets/{0.10.0 → 0.10.2}/colorbox/border.png +0 -0
  13. data/coverage/assets/{0.10.0 → 0.10.2}/colorbox/controls.png +0 -0
  14. data/coverage/assets/{0.10.0 → 0.10.2}/colorbox/loading.gif +0 -0
  15. data/coverage/assets/{0.10.0 → 0.10.2}/colorbox/loading_background.png +0 -0
  16. data/coverage/assets/{0.10.0 → 0.10.2}/favicon_green.png +0 -0
  17. data/coverage/assets/{0.10.0 → 0.10.2}/favicon_red.png +0 -0
  18. data/coverage/assets/{0.10.0 → 0.10.2}/favicon_yellow.png +0 -0
  19. data/coverage/assets/{0.10.0 → 0.10.2}/loading.gif +0 -0
  20. data/coverage/assets/{0.10.0 → 0.10.2}/magnify.png +0 -0
  21. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  22. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  23. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  24. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  25. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  26. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  27. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  28. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  29. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-icons_222222_256x240.png +0 -0
  30. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  31. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-icons_454545_256x240.png +0 -0
  32. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-icons_888888_256x240.png +0 -0
  33. data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  34. data/coverage/index.html +5885 -3160
  35. data/lib/string_foundation.rb +4 -2
  36. data/lib/string_foundation/blank.rb +17 -0
  37. data/lib/string_foundation/case.rb +28 -38
  38. data/lib/string_foundation/convert.rb +9 -9
  39. data/lib/string_foundation/convertible.rb +4 -4
  40. data/lib/string_foundation/is.rb +13 -0
  41. data/lib/string_foundation/length.rb +56 -0
  42. data/lib/string_foundation/like.rb +4 -4
  43. data/lib/string_foundation/version.rb +2 -2
  44. data/lib/string_foundation/with.rb +7 -7
  45. data/pkg/string_foundation-1.1.0.gem +0 -0
  46. data/spec/spec_helper.rb +10 -10
  47. data/spec/string_foundation/blank_spec.rb +91 -0
  48. data/spec/string_foundation/case_spec.rb +398 -433
  49. data/spec/string_foundation/convert_spec.rb +98 -98
  50. data/spec/string_foundation/convertible_spec.rb +286 -0
  51. data/spec/string_foundation/is_spec.rb +62 -0
  52. data/spec/string_foundation/length_spec.rb +226 -0
  53. data/spec/string_foundation/like_spec.rb +103 -103
  54. data/spec/string_foundation/version_spec.rb +4 -4
  55. data/spec/string_foundation/with_spec.rb +48 -48
  56. data/spec/support/enhanced_matchers_extension.rb +1 -0
  57. data/string_foundation.gemspec +15 -14
  58. metadata +46 -37
  59. data/circle.yml +0 -14
  60. data/pkg/string_foundation-1.0.0.gem +0 -0
  61. data/spec/string_foundation/convertaile_spec.rb +0 -286
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 364ff7438ace10942b553e927848df3d7ca5f99d
4
- data.tar.gz: d30ac8b18e271e3176352eeae5f9e3ab5b0f0fa9
3
+ metadata.gz: 3832f5782195390b3ea596e3b22038182cc01148
4
+ data.tar.gz: 30fde3c3f84156b30a1e7e2ba553755fbf58e206
5
5
  SHA512:
6
- metadata.gz: 8426ac4262df45928da1d9593e5c6189187b772999315540b73264d2e48a9ff9b1f8c6a814ec2b66fd6f493995e114d5a7d0c09b3630c50238e33bfd4ef84356
7
- data.tar.gz: 304dc272d7c6ed55d7f98ffeea7604afe5e27b695f27ed3240da07eda117b9bbdf3fd3552c35ee305c2fcbc674840335d03ba58c679efdd9e68a6a87673196f2
6
+ metadata.gz: c635d349867d6aba69ebab82cd163d644fd5bdc27391cb453aa7f825400164bc4dcbe35aaa278e2041501422ed050f86c09e7df80370dfa08a9e432929a0f37f
7
+ data.tar.gz: 760e85994bf3d8b65882ed10d6a8e8da10ef70fc2f85e64edc07cefb4982bdc7e0d1362534ae6e304333747b4e06354ff2c29cd922007934bffd7f9bb3cf9a4e
@@ -2,6 +2,11 @@
2
2
  <!-- CHANGELOG -->
3
3
  <!-- ======================================================================= -->
4
4
  # Changelog
5
+ ## 1.1.0 (2018-05-28)
6
+ - Add methods to compare characters length ([#31](https://github.com/jagaapple/string_foundation.rb/pull/31)) ([#32](https://github.com/jagaapple/string_foundation.rb/pull/32)) - [@akaryu0206](https://github.com/akaryu0206)
7
+ - Add methods to check whether or not a string is empty ([#37](https://github.com/jagaapple/string_foundation.rb/pull/37)) - [@akaryu0206](https://github.com/akaryu0206)
8
+ - Add a method to compare symbol ([#38](https://github.com/jagaapple/string_foundation.rb/pull/38)) - [@akaryu0206](https://github.com/akaryu0206)
9
+
5
10
  ## 1.0.0 (2017-05-09)
6
11
  - Initial public release - [@jagaapple](https://github.com/jagaapple), [@cosmicphi](https://github.com/cosmicphi)
7
12
 
data/Gemfile CHANGED
@@ -1,8 +1,8 @@
1
1
  # ==============================================================================
2
2
  # GEM FILE
3
- # ==============================================================================
4
3
  # frozen_string_literal: true
5
- source 'https://rubygems.org'
4
+ # ==============================================================================
5
+ source "https://rubygems.org"
6
6
 
7
7
  # Specify your gem's dependencies in string_foundation.gemspec.
8
8
  gemspec
@@ -13,8 +13,8 @@ gemspec
13
13
  group :development, :test do
14
14
 
15
15
  # Install bundler and rake.
16
- gem 'bundler'
17
- gem 'rake'
16
+ gem "bundler"
17
+ gem "rake"
18
18
 
19
19
  end
20
20
 
@@ -25,14 +25,14 @@ end
25
25
  group :test do
26
26
 
27
27
  # Use RSpec for unit test.
28
- gem 'rspec'
28
+ gem "rspec"
29
29
  # Use a code coverage analysis tool for Ruby.
30
- gem 'simplecov'
30
+ gem "simplecov"
31
31
  # Output the result of SimpleCov to a console.
32
- gem 'simplecov-console'
32
+ gem "simplecov-console"
33
33
  # Use Codecov to get status badges.
34
- gem 'codecov'
34
+ gem "codecov"
35
35
  # Generate random text.
36
- gem 'random_token'
36
+ gem "random_token"
37
37
 
38
38
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- string_foundation (1.0.0)
4
+ string_foundation (1.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -11,34 +11,34 @@ GEM
11
11
  json
12
12
  simplecov
13
13
  url
14
- diff-lcs (1.2.5)
14
+ diff-lcs (1.3)
15
15
  docile (1.1.5)
16
16
  hirb (0.7.3)
17
- json (2.0.3)
18
- rake (12.0.0)
17
+ json (2.1.0)
18
+ rake (12.3.0)
19
19
  random_token (1.1.1)
20
- rspec (3.5.0)
21
- rspec-core (~> 3.5.0)
22
- rspec-expectations (~> 3.5.0)
23
- rspec-mocks (~> 3.5.0)
24
- rspec-core (3.5.4)
25
- rspec-support (~> 3.5.0)
26
- rspec-expectations (3.5.0)
20
+ rspec (3.7.0)
21
+ rspec-core (~> 3.7.0)
22
+ rspec-expectations (~> 3.7.0)
23
+ rspec-mocks (~> 3.7.0)
24
+ rspec-core (3.7.0)
25
+ rspec-support (~> 3.7.0)
26
+ rspec-expectations (3.7.0)
27
27
  diff-lcs (>= 1.2.0, < 2.0)
28
- rspec-support (~> 3.5.0)
29
- rspec-mocks (3.5.0)
28
+ rspec-support (~> 3.7.0)
29
+ rspec-mocks (3.7.0)
30
30
  diff-lcs (>= 1.2.0, < 2.0)
31
- rspec-support (~> 3.5.0)
32
- rspec-support (3.5.0)
33
- simplecov (0.14.0)
31
+ rspec-support (~> 3.7.0)
32
+ rspec-support (3.7.0)
33
+ simplecov (0.15.1)
34
34
  docile (~> 1.1.0)
35
35
  json (>= 1.8, < 3)
36
36
  simplecov-html (~> 0.10.0)
37
- simplecov-console (0.4.1)
37
+ simplecov-console (0.4.2)
38
38
  ansi
39
39
  hirb
40
40
  simplecov
41
- simplecov-html (0.10.0)
41
+ simplecov-html (0.10.2)
42
42
  url (0.3.2)
43
43
 
44
44
  PLATFORMS
@@ -55,4 +55,4 @@ DEPENDENCIES
55
55
  string_foundation!
56
56
 
57
57
  BUNDLED WITH
58
- 1.14.6
58
+ 1.16.0
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright 2017 Brushdown
3
+ Copyright 2017 Jaga Apple
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,14 @@
1
+ # New Features
2
+ - Add ...
3
+ - Implement to ...
4
+ - Enable ...
5
+
6
+
7
+ # Changes and Fixes
8
+ - Change ...
9
+ - Fix ...
10
+ - Modify ...
11
+
12
+
13
+ # Refactors
14
+ - Clean ...
data/README.md CHANGED
@@ -5,10 +5,10 @@
5
5
 
6
6
  ---
7
7
 
8
- [![CircleCI](https://img.shields.io/circleci/project/github/brushdown/string_foundation.rb/master.svg)](https://circleci.com/gh/brushdown/string_foundation.rb)
9
- [![codecov](https://img.shields.io/codecov/c/github/brushdown/string_foundation.rb/master.svg)](https://codecov.io/gh/brushdown/string_foundation.rb)
8
+ [![CircleCI](https://img.shields.io/circleci/project/github/jagaapple/string_foundation.rb/master.svg)](https://circleci.com/gh/jagaapple/string_foundation.rb)
9
+ [![codecov](https://img.shields.io/codecov/c/github/jagaapple/string_foundation.rb/master.svg)](https://codecov.io/gh/jagaapple/string_foundation.rb)
10
10
  [![Gem](https://img.shields.io/gem/v/string_foundation.svg)](https://rubygems.org/gems/string_foundation/)
11
- [![license](https://img.shields.io/github/license/brushdown/string_foundation.rb.svg)](https://opensource.org/licenses/MIT)
11
+ [![license](https://img.shields.io/github/license/jagaapple/string_foundation.rb.svg)](https://opensource.org/licenses/MIT)
12
12
  [![@jagaapple](https://img.shields.io/badge/contact-%40jagaapple-blue.svg)](https://twitter.com/jagaapple)
13
13
 
14
14
  String Foundation is a Ruby library that provides useful methods for the Ruby
@@ -17,18 +17,30 @@ string class.
17
17
 
18
18
  ## Table of Contents
19
19
 
20
- <!-- MarkdownTOC autolink="true" bracket="round" -->
20
+ <!-- TOC depthFrom:2 -->
21
21
 
22
+ - [Table of Contents](#table-of-contents)
22
23
  - [Quick Start](#quick-start)
23
24
  - [Requirements](#requirements)
24
25
  - [Installation](#installation)
25
26
  - [Basic Usage](#basic-usage)
27
+ - [The Blank Methods](#the-blank-methods)
28
+ - [Check To Blank](#check-to-blank)
29
+ - [Check To Present](#check-to-present)
30
+ - [The Is Methods](#the-is-methods)
31
+ - [Is Symbol](#is-symbol)
32
+ - [The Length Methods](#the-length-methods)
33
+ - [Equal To](#equal-to)
34
+ - [Less Than](#less-than)
35
+ - [Less Than Or Equal To](#less-than-or-equal-to)
36
+ - [Greater Than](#greater-than)
37
+ - [Greater Than Or Equal To](#greater-than-or-equal-to)
26
38
  - [The Convertible Methods](#the-convertible-methods)
27
39
  - [To Integer](#to-integer)
28
40
  - [To Float](#to-float)
29
41
  - [To TrueClass / FalseClass](#to-trueclass--falseclass)
30
42
  - [The With Methods](#the-with-methods)
31
- - [Remove Leading Zeros \(Zero Padding\)](#remove-leading-zeros-zero-padding)
43
+ - [Remove Leading Zeros (Zero Padding)](#remove-leading-zeros-zero-padding)
32
44
  - [The Convert Methods](#the-convert-methods)
33
45
  - [To TrueClass / FalseClass](#to-trueclass--falseclass-1)
34
46
  - [To Proper Class](#to-proper-class)
@@ -40,7 +52,7 @@ string class.
40
52
  - [Contributing to String Foundation](#contributing-to-string-foundation)
41
53
  - [License](#license)
42
54
 
43
- <!-- /MarkdownTOC -->
55
+ <!-- /TOC -->
44
56
 
45
57
 
46
58
  ## Quick Start
@@ -58,7 +70,7 @@ $ gem install string_foundation
58
70
  If you are using Bundler, add this line to your application's Gemfile:
59
71
 
60
72
  ```ruby
61
- gem 'string_foundation'
73
+ gem "string_foundation"
62
74
  ```
63
75
 
64
76
  And then run `bundle install` .
@@ -67,19 +79,148 @@ And then run `bundle install` .
67
79
  The following is a sample of what String Foundation provides.
68
80
 
69
81
  ```ruby
82
+ # Check characters length.
83
+ "abc".length?(3) #=> true
84
+ "password".length?(8..32) #=> true
85
+ "password".gte?(8) #=> true
86
+ "password".lte?(32) #=> true
87
+
88
+ # Compare a symbol.
89
+ "abc".is_sym?(:abc) #=> true
90
+
70
91
  # Check for convertible.
71
- '123'.to_i? #=> true
72
- 'x123'.to_i? #=> false
92
+ "123".to_i? #=> true
93
+ "x123".to_i? #=> false
73
94
 
74
95
  # Remove leading zeros.
75
- '00000123'.without_leading_zeros #=> '123'
96
+ "00000123".without_leading_zeros #=> "123"
76
97
 
77
98
  # Convert a value to the appropriate type.
78
- 'false'.to_pretty #=> false
79
- '.5'.to_pretty #=> 0.5
99
+ "false".to_pretty #=> false
100
+ ".5".to_pretty #=> 0.5
80
101
 
81
102
  # Convert to lowerCamelCase.
82
- 'user_id'.to_lcamel #=> 'userId'
103
+ "user_id".to_lcamel #=> "userId"
104
+ ```
105
+
106
+
107
+ ## The Blank Methods
108
+ The Blank Methods enable you to check whether or not a string is empty. These
109
+ methods return `true` or `false` .
110
+
111
+ ### Check To Blank
112
+ The `blank?` method checks whether a string is blank (it is an empty string or
113
+ includes only half-width spaces or newlines). If a string is blank, return `true` ,
114
+ unless return `false` .
115
+
116
+ ```ruby
117
+ "".blank? #=> true
118
+ " ".blank? #=> true
119
+ " ".blank? #=> true
120
+ " \n ".blank? #=> true
121
+
122
+ "abc".blank? #=> false
123
+ ```
124
+
125
+ ### Check To Present
126
+ The `present?` method checks whether a string is present (it is not an empty string
127
+ or does not include only half-width spaces or newlines). If a string is present,
128
+ return `true` , unless return `false` .
129
+
130
+ ```ruby
131
+ "".present? #=> false
132
+ " ".present? #=> false
133
+ " ".present? #=> false
134
+ " \n ".present? #=> false
135
+
136
+ "abc".present? #=> true
137
+ ```
138
+
139
+
140
+ ## The Is Methods
141
+ The Is Methods enable you to check whether or not a string is nearly equal to
142
+ a specific value. These methods return `true` or `false` .
143
+
144
+ ### Is Symbol
145
+ The `is_sym?` method checks whether a string is nearly equal to a specific Symbol.
146
+ This returns `true` only if it is, unless return `false` . This method accepts
147
+ only Symbol.
148
+
149
+ ```ruby
150
+ "abc".is_sym?(:abc) #=> true
151
+ "".is_sym?(:"") #=> true
152
+ "abc".is_sym?(:def) #=> false
153
+
154
+ "abc".is_sym?("abc") #=> ArgumentError
155
+ ```
156
+
157
+
158
+ ## The Length Methods
159
+ The Length methods enable you to check whether or not characters length is a
160
+ specific length. These methods return `true` or `false` .
161
+
162
+ ### Equal To
163
+ The `length?` method checks whether characters length is equal to a specific
164
+ length. If its case, return `true` , unless return `false` .
165
+ This method accepts number of Integer (including Fixnum and Bignum classes).
166
+
167
+ ```ruby
168
+ "abc".length?(3) #=> true
169
+ "abc".length?(4) #=> false
170
+
171
+ "abc".length?("3") #=> ArgumentError
172
+ ```
173
+
174
+ Also this method accepts Range. In that case, characters length is within a range,
175
+ return `true` , unless return `false` .
176
+
177
+ ```ruby
178
+ "abc".length?(2..5) #=> true
179
+ "abc".length?(8..32) #=> false
180
+ ```
181
+
182
+ ### Less Than
183
+ The `length_lt?` method checks whether characters length is less than a specific
184
+ length. If its case, return `true` , unless return `false` .
185
+ This method accepts only number of Integer (including Fixnum and Bignum classes).
186
+
187
+ ```ruby
188
+ "abc".length_lt?(2) #=> false
189
+ "abc".length_lt?(3) #=> false
190
+ "abc".length_lt?(4) #=> true
191
+ ```
192
+
193
+ ### Less Than Or Equal To
194
+ The `length_lte?` method checks whether characters length is less than or equal
195
+ to a specific length. If its case, return `true` , unless return `false` .
196
+ This method accepts only number of Integer (including Fixnum and Bignum classes).
197
+
198
+ ```ruby
199
+ "abc".length_lte?(2) #=> false
200
+ "abc".length_lte?(3) #=> true
201
+ "abc".length_lte?(4) #=> true
202
+ ```
203
+
204
+ ### Greater Than
205
+ The `length_gt?` method checks whether characters length is greater than a specific
206
+ length. If its case, return `true` , unless return `false` .
207
+ This method accepts only number of Integer (including Fixnum and Bignum classes).
208
+
209
+ ```ruby
210
+ "abc".length_gt?(2) #=> true
211
+ "abc".length_gt?(3) #=> false
212
+ "abc".length_gt?(4) #=> false
213
+ ```
214
+
215
+ ### Greater Than Or Equal To
216
+ The `length_gte?` method checks whether characters length is greater than or equal
217
+ to a specific length. If its case, return `true` , unless return `false` .
218
+ This method accepts only number of Integer (including Fixnum and Bignum classes).
219
+
220
+ ```ruby
221
+ "abc".length_gte?(2) #=> true
222
+ "abc".length_gte?(3) #=> true
223
+ "abc".length_gte?(4) #=> false
83
224
  ```
84
225
 
85
226
 
@@ -93,21 +234,21 @@ The `to_i?` method checks whether a string can be converted to an Integer
93
234
  is convertible, therefore it is not required for the argument to be an integral
94
235
  number. If you pass a floating point number as an argument to this method, it will
95
236
  return `true` because it can be converted using the `to_i` Ruby built-in method
96
- (for example, `'0.4'.to_i` returns `0` ).
237
+ (for example, `"0.4".to_i` returns `0` ).
97
238
 
98
239
  ```ruby
99
- '123'.to_i? #=> true
100
- '0.3'.to_i? #=> true
101
- '.2'.to_i? #=> true
240
+ "123".to_i? #=> true
241
+ "0.3".to_i? #=> true
242
+ ".2".to_i? #=> true
102
243
 
103
- 'abc'.to_i? #=> false
104
- '2x'.to_i? #=> false
244
+ "abc".to_i? #=> false
245
+ "2x".to_i? #=> false
105
246
  ```
106
247
 
107
248
  If an argument has leading zeros, they will be removed before checking.
108
249
 
109
250
  ```ruby
110
- '00000123'.to_i? #=> true
251
+ "00000123".to_i? #=> true
111
252
  ```
112
253
 
113
254
  ### To Float
@@ -115,42 +256,41 @@ The `to_f?` method is to check convertibility to the Float class. This returns
115
256
  `true` only when an argument is convertible, therefore it is not required for the
116
257
  argument to be a floating point number. If you pass an integral number as an
117
258
  argument to this method, it will return `true` because it can be converted using
118
- the `to_f` Ruby built-in method (for example, `'2'.to_f` returns `2.0` ).
259
+ the `to_f` Ruby built-in method (for example, `"2".to_f` returns `2.0` ).
119
260
 
120
261
  ```ruby
121
- '0.3'.to_f? #=> true
122
- '2'.to_f? #=> true
123
- '.2'.to_f? #=> true
262
+ "0.3".to_f? #=> true
263
+ "2".to_f? #=> true
264
+ ".2".to_f? #=> true
124
265
 
125
- 'abc'.to_f? #=> false
126
- '2.0x'.to_f? #=> false
266
+ "abc".to_f? #=> false
267
+ "2.0x".to_f? #=> false
127
268
  ```
128
269
 
129
-
130
270
  ### To TrueClass / FalseClass
131
271
  The `to_bool?` method checks whether a string is convertible to TrueClass or
132
- FalseClass. This returns `true` or `false` only when the string is `'true'` or
133
- `'false'` .
272
+ FalseClass. This returns `true` or `false` only when the string is `"true"` or
273
+ `"false"` .
134
274
 
135
275
  ```ruby
136
- 'true'.to_bool? #=> true
137
- 'false'.to_bool? #=> true
276
+ "true".to_bool? #=> true
277
+ "false".to_bool? #=> true
138
278
 
139
- 'abc'.to_bool? #=> false
140
- '123'.to_bool? #=> false
279
+ "abc".to_bool? #=> false
280
+ "123".to_bool? #=> false
141
281
  ```
142
282
 
143
283
  String Foundation also provides a check for a string's convertibility to a "Booly"
144
284
  (truthy or falsy). This returns `true` only when the string is a positive number,
145
- `'true'` , or an empty string. If not, it returns `false` .
285
+ `"true"` , or an empty string. If not, it returns `false` .
146
286
 
147
287
  ```ruby
148
- 'true'.to_booly? #=> true
149
- '123'.to_booly? #=> true
150
- ''.to_booly? #=> true
151
- '-3'.to_booly? #=> true
288
+ "true".to_booly? #=> true
289
+ "123".to_booly? #=> true
290
+ "".to_booly? #=> true
291
+ "-3".to_booly? #=> true
152
292
 
153
- 'abc'.to_booly? #=> false
293
+ "abc".to_booly? #=> false
154
294
  ```
155
295
 
156
296
 
@@ -163,10 +303,10 @@ The `without_leading_zeros` method removes leading zeros (called "zero padding")
163
303
  This supports a floating point number and a string starting with a plus or minus sign.
164
304
 
165
305
  ```ruby
166
- '00001'.without_leading_zeros #=> '1'
167
- '-0000.3'.without_leading_zeros #=> '-0.3'
306
+ "00001".without_leading_zeros #=> "1"
307
+ "-0000.3".without_leading_zeros #=> "-0.3"
168
308
 
169
- %w(00001 00003 00008).map { |num| num.without_leading_zeros } #=> ['1', '3', '8']
309
+ ["00001", "00003", "00008"].map { |num| num.without_leading_zeros } #=> ["1", "3", "8"]
170
310
  ```
171
311
 
172
312
 
@@ -178,53 +318,53 @@ or a proper class object. The Convert Methods make it easy to convert to these
178
318
  excluded classes.
179
319
 
180
320
  ### To TrueClass / FalseClass
181
- The `to_bool` method is for converting from a `'true'` or `'false'` string to `true`
321
+ The `to_bool` method is for converting from a `"true"` or `"false"` string to `true`
182
322
  or `false` , otherwise it will raise a `TypeError` .
183
323
 
184
324
  ```ruby
185
- 'true'.to_bool #=> true
186
- 'false'.to_bool #=> false
187
-
188
- '1'.to_bool #=> TypeError
189
- '0'.to_bool #=> TypeError
190
- '-1'.to_bool #=> TypeError
191
- 'abc'.to_bool #=> TypeError
192
- ''.to_bool #=> TypeError
325
+ "true".to_bool #=> true
326
+ "false".to_bool #=> false
327
+
328
+ "1".to_bool #=> TypeError
329
+ "0".to_bool #=> TypeError
330
+ "-1".to_bool #=> TypeError
331
+ "abc".to_bool #=> TypeError
332
+ "".to_bool #=> TypeError
193
333
  ```
194
334
 
195
335
  If you want to convert a Booly string, you can use the `to_booly` method. When a
196
- string is `'true'` or a positive number, this method will return `true` . Otherwise
336
+ string is `"true"` or a positive number, this method will return `true` . Otherwise
197
337
  it will return `false` .
198
338
 
199
339
  ```ruby
200
- 'true'.to_booly #=> true
201
- 'false'.to_booly #=> false
202
-
203
- '1'.to_booly #=> true
204
- '0'.to_booly #=> false
205
- '-1'.to_booly #=> false
206
- 'abc'.to_booly #=> TypeError
207
- ''.to_booly #=> false
340
+ "true".to_booly #=> true
341
+ "false".to_booly #=> false
342
+
343
+ "1".to_booly #=> true
344
+ "0".to_booly #=> false
345
+ "-1".to_booly #=> false
346
+ "abc".to_booly #=> TypeError
347
+ "".to_booly #=> false
208
348
  ```
209
349
 
210
350
  ### To Proper Class
211
351
  The `to_pretty` method is powerful. This method can convert to a proper class,
212
- for example, it will return a TrueClass `true` when a string is `'true'`, or returns
213
- an Integer `1` when a string is `'1'`.
352
+ for example, it will return a TrueClass `true` when a string is `"true"`, or returns
353
+ an Integer `1` when a string is `"1"`.
214
354
  Also this returns `nil` when a string is an empty string.
215
355
 
216
356
  ```ruby
217
- '1'.to_pretty #=> 1
218
- '-3'.to_pretty #=> -3
219
- '0004'.to_pretty #=> 4
220
- '0.1'.to_pretty #=> 0.1
221
- '-.5'.to_pretty #=> -0.5
222
- '00.01'.to_pretty #=> 0.01
357
+ "1".to_pretty #=> 1
358
+ "-3".to_pretty #=> -3
359
+ "0004".to_pretty #=> 4
360
+ "0.1".to_pretty #=> 0.1
361
+ "-.5".to_pretty #=> -0.5
362
+ "00.01".to_pretty #=> 0.01
223
363
 
224
- 'true'.to_pretty #=> true
225
- 'false'.to_pretty #=> false
364
+ "true".to_pretty #=> true
365
+ "false".to_pretty #=> false
226
366
 
227
- ''.to_pretty #=> nil
367
+ "".to_pretty #=> nil
228
368
  ```
229
369
 
230
370
  ### Newlines To Characters
@@ -232,8 +372,8 @@ The `nl_to` method converts a string with newlines to its specific characters.
232
372
  The `nl2` method is an alias for `nl_to` .
233
373
 
234
374
  ```ruby
235
- "Hi!\nWe are Brushdown.".nl_to(' / ') #=> 'Hi! / We are Brushdown.'
236
- "Hi!\nWe are Brushdown.".nl2(' / ') #=> 'Hi! / We are Brushdown.'
375
+ "Hi!\nI am Jaga Apple.".nl_to(" / ") #=> "Hi! / I am Jaga Apple."
376
+ "Hi!\nI am Jaga Apple.".nl2(" / ") #=> "Hi! / I am Jaga Apple."
237
377
  ```
238
378
 
239
379
  The `nl_to_br` method replaces the newlines in a string with HTML tag `<br>` for
@@ -241,14 +381,14 @@ break line.
241
381
  The `nl2br` method is an alias for `nl_to_br` .
242
382
 
243
383
  ```ruby
244
- "Hi!\nWe are Brushdown.".nl_to_br #=> 'Hi!<br>We are Brushdown.'
245
- "Hi!\nWe are Brushdown.".nl2br #=> 'Hi!<br>We are Brushdown.'
384
+ "Hi!\nI am Jaga Apple.".nl_to_br #=> "Hi!<br>I am Jaga Apple."
385
+ "Hi!\nI am Jaga Apple.".nl2br #=> "Hi!<br>I am Jaga Apple."
246
386
  ```
247
387
 
248
388
 
249
389
  ## The Like Methods
250
390
  The Like Methods provide to check whether a string is an integral number or a
251
- floating point number. These method ignore leading zeros, so the string `'000123'`
391
+ floating point number. These method ignore leading zeros, so the string `"000123"`
252
392
  is regarded as an integral number. These method return `true` or `false` .
253
393
 
254
394
  The Like Methods check whether a string is an integral number or a floating point
@@ -259,26 +399,26 @@ as an integral number. These methods return `true` or `false` .
259
399
  The `like_i?` method checks whether a string is an integral number.
260
400
 
261
401
  ```ruby
262
- '123'.like_i? #=> true
263
- '00123'.like_i? #=> true
264
- '0.3'.like_i? #=> false
265
- '.2'.like_i? #=> false
402
+ "123".like_i? #=> true
403
+ "00123".like_i? #=> true
404
+ "0.3".like_i? #=> false
405
+ ".2".like_i? #=> false
266
406
 
267
- 'abc'.like_i? #=> false
268
- '2x'.like_i? #=> false
407
+ "abc".like_i? #=> false
408
+ "2x".like_i? #=> false
269
409
  ```
270
410
 
271
411
  ### Like Float
272
412
  The `like_f?` method checks whether a string is a floating point number.
273
413
 
274
414
  ```ruby
275
- '123'.like_f? #=> false
276
- '00123'.like_f? #=> false
277
- '0.3'.like_f? #=> true
278
- '.2'.like_f? #=> true
415
+ "123".like_f? #=> false
416
+ "00123".like_f? #=> false
417
+ "0.3".like_f? #=> true
418
+ ".2".like_f? #=> true
279
419
 
280
- 'abc'.like_f? #=> false
281
- '2x'.like_f? #=> false
420
+ "abc".like_f? #=> false
421
+ "2x".like_f? #=> false
282
422
  ```
283
423
 
284
424
 
@@ -286,28 +426,28 @@ The `like_f?` method checks whether a string is a floating point number.
286
426
  The Case Methods convert to a case style, such as `lowerCamelCase` and
287
427
  `lower_snake_case` . The following methods are available.
288
428
 
289
- | METHOD NAME | CASE STYLE | EXAMPLE |
290
- |:------------|:------------------------------|:-------------------|
291
- | `to_lcamel` | Lower Camel Case | `weAreBrushdown` |
292
- | `to_ucamel` | Upper Camel Case | `WeAreBrushdown` |
293
- | `to_lsnake` | Lower Snake Case | `we_are_brushdown` |
294
- | `to_usnake` | Upper Snake Case () | `We_Are_Brushdown` |
295
- | `to_lkebab` | Lower Kebab Case (Chain Case) | `we-are-brushdown` |
296
- | `to_ukebab` | Upper Kebab Case (Train Case) | `We-Are-Brushdown` |
297
- | `to_lspace` | Lower Space Case (Lower Case) | `we are brushdown` |
298
- | `to_uspace` | Upper Space Case (Start Case) | `We Are Brushdown` |
299
- | `to_ldot` | Lower Dot Case | `we.are.brushdown` |
300
- | `to_udot` | Upper Dot Case | `We.Are.Brushdown` |
429
+ | METHOD NAME | CASE STYLE | EXAMPLE |
430
+ |:------------|:------------------------------|:------------------|
431
+ | `to_lcamel` | Lower Camel Case | `iAmJagaApple` |
432
+ | `to_ucamel` | Upper Camel Case | `IAmJagaApple` |
433
+ | `to_lsnake` | Lower Snake Case | `i_am_jaga_apple` |
434
+ | `to_usnake` | Upper Snake Case | `I_Am_Jaga_Apple` |
435
+ | `to_lkebab` | Lower Kebab Case (Chain Case) | `i-am-jaga-apple` |
436
+ | `to_ukebab` | Upper Kebab Case (Train Case) | `I-Am-Jaga-Apple` |
437
+ | `to_lspace` | Lower Space Case (Lower Case) | `i am jaga apple` |
438
+ | `to_uspace` | Upper Space Case (Start Case) | `I Am Jaga Apple` |
439
+ | `to_ldot` | Lower Dot Case | `i.am.jaga.apple` |
440
+ | `to_udot` | Upper Dot Case | `I.Am.Jaga.Apple` |
301
441
 
302
442
  ```ruby
303
- 'user_id'.to_lcamel #=> 'userId'
304
- 'createdAt'.to_lsnake #=> 'created_at'
443
+ "user_id".to_lcamel #=> "userId"
444
+ "createdAt".to_lsnake #=> "created_at"
305
445
  ```
306
446
 
307
447
 
308
448
  ## Contributing to String Foundation
309
449
  Bug reports and pull requests are welcome on GitHub at
310
- [https://github.com/brushdown/string_foundation.rb](https://github.com/brushdown/string_foundation.rb).
450
+ [https://github.com/jagaapple/string_foundation.rb](https://github.com/jagaapple/string_foundation.rb).
311
451
  This project is intended to be a safe, welcoming space for collaboration, and
312
452
  contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org)
313
453
  code of conduct.
@@ -321,4 +461,4 @@ For more details, see [GitHub Flow – Scott Chacon](http://scottchacon.com/2011
321
461
  ## License
322
462
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
323
463
 
324
- Copyright 2017 Jaga Apple and Brushdown. All rights reserved.
464
+ Copyright 2017 Jaga Apple. All rights reserved.