lotus-utils 0.5.1 → 0.5.2
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/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/lotus-utils.rb +1 -0
- data/lib/lotus/utils/string.rb +37 -0
- data/lib/lotus/utils/version.rb +1 -1
- data/lotus-utils.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75c83ed0bc5b3b7e00e70735e023117f38ef9d67
|
4
|
+
data.tar.gz: 17cd9f71360e17c3adddadf260c38fc8b27622b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d25381aa757c98d2549d8619a8ba7525f50d9a752b6473d8e329d8eabb7ada701ceecefae9b301136bdb71b2d836f1a6ee4ba8a0cdeaf71edb66ca127f127e9
|
7
|
+
data.tar.gz: cd21b6ea4701af1949fedad3f91b3d11579de79abef45bc6b4a7c66e8814ecaec88ab765bb0afce36b5804279e9d595124cc5998fdeeb0a47ab62ae3e0849846
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Lotus::Utils
|
2
2
|
Ruby core extentions and class utilities for Lotus
|
3
3
|
|
4
|
+
## v0.5.2 - 2015-09-30
|
5
|
+
### Added
|
6
|
+
- [Luca Guidi] Added `Lotus::Utils::String#capitalize`
|
7
|
+
- [Trung Lê] Official support for JRuby 9k+
|
8
|
+
|
4
9
|
## v0.5.1 - 2015-07-10
|
5
10
|
### Fixed
|
6
11
|
- [Thiago Felippe] Ensure `Lotus::Utils::PathPrefix#join` won't remote duplicate entries (eg `/admin/dashboard/admin`)
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Ruby core extentions and class utilities for [Lotus](http://lotusrb.org)
|
|
22
22
|
|
23
23
|
## Rubies
|
24
24
|
|
25
|
-
__Lotus::Utils__ supports Ruby (MRI) 2+, JRuby
|
25
|
+
__Lotus::Utils__ supports Ruby (MRI) 2+, JRuby 9k+ & Rubinius 2.3+
|
26
26
|
|
27
27
|
## Installation
|
28
28
|
|
data/lib/lotus-utils.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'lotus/utils'
|
data/lib/lotus/utils/string.rb
CHANGED
@@ -48,6 +48,12 @@ module Lotus
|
|
48
48
|
# @api private
|
49
49
|
TITLEIZE_SEPARATOR = ' '.freeze
|
50
50
|
|
51
|
+
# Separator for #capitalize
|
52
|
+
#
|
53
|
+
# @since 0.5.2
|
54
|
+
# @api private
|
55
|
+
CAPITALIZE_SEPARATOR = ' '.freeze
|
56
|
+
|
51
57
|
# Separator for #dasherize
|
52
58
|
#
|
53
59
|
# @since 0.4.0
|
@@ -86,6 +92,37 @@ module Lotus
|
|
86
92
|
self.class.new underscore.split(CLASSIFY_SEPARATOR).map(&:capitalize).join(TITLEIZE_SEPARATOR)
|
87
93
|
end
|
88
94
|
|
95
|
+
# Return a capitalized version of the string
|
96
|
+
#
|
97
|
+
# @return [Lotus::Utils::String] the transformed string
|
98
|
+
#
|
99
|
+
# @since 0.5.2
|
100
|
+
#
|
101
|
+
# @example
|
102
|
+
# require 'lotus/utils/string'
|
103
|
+
#
|
104
|
+
# string = Lotus::Utils::String.new 'lotus'
|
105
|
+
# string.capitalize # => "Lotus"
|
106
|
+
#
|
107
|
+
# string = Lotus::Utils::String.new 'lotus utils'
|
108
|
+
# string.capitalize # => "Lotus utils"
|
109
|
+
#
|
110
|
+
# string = Lotus::Utils::String.new 'Lotus Utils'
|
111
|
+
# string.capitalize # => "Lotus utils"
|
112
|
+
#
|
113
|
+
# string = Lotus::Utils::String.new 'lotus_utils'
|
114
|
+
# string.capitalize # => "Lotus utils"
|
115
|
+
#
|
116
|
+
# string = Lotus::Utils::String.new 'lotus-utils'
|
117
|
+
# string.capitalize # => "Lotus utils"
|
118
|
+
def capitalize
|
119
|
+
head, *tail = underscore.split(CLASSIFY_SEPARATOR)
|
120
|
+
|
121
|
+
self.class.new(
|
122
|
+
tail.unshift(head.capitalize).join(CAPITALIZE_SEPARATOR)
|
123
|
+
)
|
124
|
+
end
|
125
|
+
|
89
126
|
# Return a CamelCase version of the string
|
90
127
|
#
|
91
128
|
# @return [String] the transformed string
|
data/lib/lotus/utils/version.rb
CHANGED
data/lotus-utils.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'lotus/utils/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'lotus-utils'
|
8
8
|
spec.version = Lotus::Utils::VERSION
|
9
|
-
spec.authors = ['Luca Guidi', 'Trung Lê', 'Alfonso Uceda
|
9
|
+
spec.authors = ['Luca Guidi', 'Trung Lê', 'Alfonso Uceda']
|
10
10
|
spec.email = ['me@lucaguidi.com', 'trung.le@ruby-journal.com', 'uceda73@gmail.com']
|
11
11
|
spec.description = %q{Lotus utilities}
|
12
12
|
spec.summary = %q{Ruby core extentions and Louts utilities}
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lotus-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
- Trung Lê
|
9
|
-
- Alfonso Uceda
|
9
|
+
- Alfonso Uceda
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-09-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- CHANGELOG.md
|
67
67
|
- LICENSE.md
|
68
68
|
- README.md
|
69
|
+
- lib/lotus-utils.rb
|
69
70
|
- lib/lotus/interactor.rb
|
70
71
|
- lib/lotus/logger.rb
|
71
72
|
- lib/lotus/utils.rb
|
@@ -105,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
106
|
version: '0'
|
106
107
|
requirements: []
|
107
108
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.4.
|
109
|
+
rubygems_version: 2.4.5.1
|
109
110
|
signing_key:
|
110
111
|
specification_version: 4
|
111
112
|
summary: Ruby core extentions and Louts utilities
|