lucky_case 0.2.3 → 0.2.4
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/lib/lucky_case.rb +6 -6
- data/lib/lucky_case/version.rb +1 -1
- 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: 44cb7edfeae8e3d330f2709c441e2ed38b6b29c3aeec8039831606bd5f9489e6
|
4
|
+
data.tar.gz: df3a7a195ed45ca1b1a66571f6f5616403fd7e38dff9806d558c99ac72556e5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3785b9b371fed6dd88db71b6dd89e01ccd540c54a4f00b04f7b5fc29e9fd6ea38d6b5eb6fc8c52a4a826e5903edb3096a514aff87b5a812ff6cb3d313c49abcf
|
7
|
+
data.tar.gz: e8677f3b9ea32606c41c8b60a30730cc303f206c644c386129720d154705d7e4dda99a982ef0f027b916682e48ea4d4567d0aee0b883c7f7657405ab8226717f
|
data/lib/lucky_case.rb
CHANGED
@@ -77,9 +77,9 @@ module LuckyCase
|
|
77
77
|
end
|
78
78
|
if matched_cases.empty?
|
79
79
|
nil
|
80
|
-
# reject mixed case if there are other matches
|
81
|
-
# because it would always be included if one other case matches
|
82
80
|
elsif matched_cases.size > 1
|
81
|
+
# reject :mixed_case if there are other matches
|
82
|
+
# because it would always be included if one other case matches
|
83
83
|
matched_cases.reject { |e| e == :mixed_case }
|
84
84
|
else
|
85
85
|
matched_cases
|
@@ -115,7 +115,7 @@ module LuckyCase
|
|
115
115
|
|
116
116
|
# Check if the string matches any of the available cases
|
117
117
|
#
|
118
|
-
# @param [String]
|
118
|
+
# @param [String] string
|
119
119
|
# @return [Boolean]
|
120
120
|
def self.valid_case_string?(string)
|
121
121
|
self.case(string) != nil
|
@@ -802,10 +802,10 @@ module LuckyCase
|
|
802
802
|
# Check if the given case matches the string
|
803
803
|
#
|
804
804
|
# @param [String] string
|
805
|
-
# @param [Symbol,String]
|
805
|
+
# @param [Symbol,String] case_type
|
806
806
|
# @return [Boolean]
|
807
|
-
def self._case_match?(string,
|
808
|
-
!!(string =~ CASES[
|
807
|
+
def self._case_match?(string, case_type)
|
808
|
+
!!(string =~ CASES[case_type.to_sym])
|
809
809
|
end
|
810
810
|
|
811
811
|
#----------------------------------------------------------------------------------------------------
|
data/lib/lucky_case/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucky_case
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthäus J. N. Beyrle
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|