cardamom 0.1.0 → 0.1.1
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/LICENSE +22 -0
- data/README.md +48 -0
- data/cardamom.gemspec +2 -2
- data/lib/cardamom/string_helpers.rb +6 -6
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4564f64ee543d1f15c131212984a69bb1517c618
|
4
|
+
data.tar.gz: 3e2d98b3c72d77dbb0dc269cfe1a948a88021eb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 973fa955b05ed8c8621d0860e4452edb5f7af1f9a0ff76eb7b383e0f7d3ed42a35dc60b9dd63633908675b3c59a2cbb5258e5873449958b791cfe94aeba4d0f3
|
7
|
+
data.tar.gz: 7897030f0574ff174061880af8c8d9d0628f53cb188e386da291f65fe7a8d187ab20aef96a95a83104da88efe5e0ea70f6a33691b819b75976663d7e4b6c53f9
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Matias Owsianik
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
data/README.md
CHANGED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Cardamom: Spice up your Cuba app!
|
2
|
+
|
3
|
+
[][gem]
|
4
|
+
[][gemnasium]
|
5
|
+
[][codeclimate]
|
6
|
+
[][travis]
|
7
|
+
[][codeclimate]
|
8
|
+
|
9
|
+
[gem]: http://badge.fury.io/rb/cardamom
|
10
|
+
[gemnasium]: https://gemnasium.com/matiasow/cardamom
|
11
|
+
[codeclimate]: https://codeclimate.com/github/matiasow/cardamom
|
12
|
+
[travis]: https://travis-ci.org/matiasow/cardamom
|
13
|
+
|
14
|
+
Helpers for Cuba apps
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
Simply run
|
19
|
+
|
20
|
+
```console
|
21
|
+
$ gem install cardamom
|
22
|
+
```
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
Only use what you need. For instance, if you just want to use ```string_helpers``` add this code to your application:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
require 'cardamom/string_helpers'
|
30
|
+
|
31
|
+
Cuba.plugin StringHelpers
|
32
|
+
```
|
33
|
+
|
34
|
+
To use ALL helpers available:
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
require 'cardamom'
|
38
|
+
Cuba.plugin Cardamom
|
39
|
+
```
|
40
|
+
|
41
|
+
## Available Helpers
|
42
|
+
|
43
|
+
As of today, available helpers are:
|
44
|
+
|
45
|
+
- StringHelpers
|
46
|
+
- HashHelpers
|
47
|
+
- JsonHelpers
|
48
|
+
- ResponseHelpers
|
data/cardamom.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cardamom"
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.1"
|
4
4
|
s.summary = "Cardamom: Spice up your Cuba app!"
|
5
|
-
s.description = "
|
5
|
+
s.description = "Helpers for Cuba apps"
|
6
6
|
s.authors = ["matiasow"]
|
7
7
|
s.email = ["matiasow@gmail.com"]
|
8
8
|
s.homepage = "http://github.com/matiasow/cardamom"
|
@@ -48,11 +48,11 @@ module StringHelpers
|
|
48
48
|
# sanitize_dirty_string "Ge-o/rg.e O'Hara"
|
49
49
|
# => "George O Hara"
|
50
50
|
def sanitize_dirty_string(str)
|
51
|
-
str.strip.gsub(".", "")
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
51
|
+
str.to_s.strip.gsub(".", "")
|
52
|
+
.gsub("-", "")
|
53
|
+
.gsub("_", "")
|
54
|
+
.gsub("/", "")
|
55
|
+
.gsub("'", " ")
|
56
|
+
.gsub(/\s+/, ' ')
|
57
57
|
end
|
58
58
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cardamom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- matiasow
|
@@ -84,7 +84,7 @@ dependencies:
|
|
84
84
|
- - "~>"
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
|
-
description:
|
87
|
+
description: Helpers for Cuba apps
|
88
88
|
email:
|
89
89
|
- matiasow@gmail.com
|
90
90
|
executables: []
|
@@ -93,6 +93,7 @@ extra_rdoc_files: []
|
|
93
93
|
files:
|
94
94
|
- ".gitignore"
|
95
95
|
- ".travis.yml"
|
96
|
+
- LICENSE
|
96
97
|
- README.md
|
97
98
|
- cardamom.gemspec
|
98
99
|
- lib/cardamom.rb
|