README.md in lucky_case-1.0.4 vs README.md in lucky_case-1.1.0
- old
+ new
@@ -1,9 +1,11 @@
# lucky_case
The lucky ruby gem to identify and convert strings from any letter case to another. Plus some extra functions.
+I also created a javascript port named [lucky-case](https://github.com/magynhard/lucky-case).
+
Useful when working with conventions, where class names, method names and file names needs to be converted.
* Converters: Only characters, numbers, dashes and underlines are allowed inside a string.
* Must not start with dash or number, underlines at the beginning are allowed by default and can be allowed/removed/controlled by parameter (when used for private methods for example)
@@ -49,10 +51,11 @@
# transformers
LuckyCase.lower_case('Some_FuckingShit') # => 'some_fuckingshit'
LuckyCase.upper_case('Some_FuckingShit') # => 'SOME_FUCKINGSHIT'
LuckyCase.capital('example') # => 'Example'
LuckyCase.capitalize('example') # => 'Example'
+LuckyCase.decapitalize('ExaMple') # => 'exaMple'
LuckyCase.swap_case('SomeSwappy_Case-Example') # => 'sOMEsWAPPY-cASE_eXAMPLE'
LuckyCase.constantize('some_constant') # => SomeConstant
LuckyCase.constantize('SOME_CONSTANT') # => SomeConstant
LuckyCase.constantize('some/path_example/folder') # => Some::PathExample::Folder
LuckyCase.deconstantize(SomeConstant) # => 'some_constant' // default case_type: :snake_case
@@ -77,21 +80,23 @@
LuckyCase.mixed_case?('mixed_Case') # => true
LuckyCase.upper_case?('UPPER50984') # => true
LuckyCase.lower_case?('lower_cheese') # => true
LuckyCase.capital?('Some') # => true
LuckyCase.capitalized?('some') # => false
+LuckyCase.decapitalized?('soMe') # => true
+LuckyCase.not_capital?('Some') # => false
LuckyCase.valid_case_type?(:snake_case) # => true
LuckyCase.valid_case_type?(:apple_case) # => false
LuckyCase.valid_case_string?('validString') # => true
LuckyCase.valid_case_string?('1nV4lid$tring') # => false
```
### Approach 2: Monkey patch the string class
-With monkey patching you can access the same methods (except deconstantize, valid_case_type?) of LuckyCase directly from strings.
+With monkey patching you can access the same methods (except `#deconstantize`, `#valid_case_type?`) of LuckyCase directly from strings.
Additionally they provide versions with exclamation mark for direct manipulation.
-Because the method #case and #cases are so general and could lead to conflicts, they are called #letter_case and #letter_cases at strings.
+Because the methods `#case` and `#cases` are so general and could lead to conflicts, they are called `#letter_case` and `#letter_cases` at strings.
```ruby
require 'lucky_case/string'
a = 'ExampleString'