rubyhelper 0.2.3.5 → 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/rubyhelper/stringhelper.rb +12 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c821c362cc1520ecfca8057736a2822960fc33f8
|
4
|
+
data.tar.gz: 1dae1f8ac6991d29c0cacdff681d7f991f140255
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 299aca8153165eb7a6d15ae623360484ccfa622d31153e993b55115d8eadfcf5c0e52848eadc51472a31e91bda9543dec987b64a390348f143b202c37a78654e
|
7
|
+
data.tar.gz: f102e264cd1602530f42fb698299a8e83f01bc945fbf764b326663284957bab21b1ca0c161e0f5cf705e15f1c55077c87ca2982d381daeb47338d6f9dc8b2500
|
@@ -18,7 +18,7 @@ module StringHelper
|
|
18
18
|
return string
|
19
19
|
end
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
def to_case(case_mod = :downcase)
|
23
23
|
if case_mod == :upcase
|
24
24
|
return self.to_plain.upcase
|
@@ -26,7 +26,7 @@ module StringHelper
|
|
26
26
|
return self.to_plain.downcase
|
27
27
|
end
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def to_ascii(case_mod = :upcase)
|
31
31
|
return to_case(case_mod)
|
32
32
|
end
|
@@ -73,6 +73,16 @@ module StringHelper
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
#get only the digits and symbols in the string
|
77
|
+
def get_int
|
78
|
+
return self.gsub(/[^\d\-\+]/, "")
|
79
|
+
end
|
80
|
+
|
81
|
+
#as get_int but with . and ,
|
82
|
+
def get_float
|
83
|
+
return self.gsub(/[^\d\.\,\-\+]/, "")
|
84
|
+
end
|
85
|
+
|
76
86
|
end
|
77
87
|
|
78
88
|
class String
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyhelper
|
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
|
- poulet_a
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A list of utils for the basic Class of ruby.
|
14
14
|
email:
|
@@ -50,6 +50,6 @@ rubyforge_project:
|
|
50
50
|
rubygems_version: 2.4.1
|
51
51
|
signing_key:
|
52
52
|
specification_version: 4
|
53
|
-
summary:
|
53
|
+
summary: to_int / float
|
54
54
|
test_files: []
|
55
55
|
has_rdoc:
|