to_insane 0.2.0 → 0.2.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.
- data/CHANGELOG +11 -1
- data/VERSION +1 -1
- data/lib/to_insane.rb +2 -2
- data/to_insane.gemspec +1 -1
- metadata +1 -1
data/CHANGELOG
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
= 0.2.1
|
2
|
+
- Fixed lower base limit
|
3
|
+
|
4
|
+
= 0.2.0
|
5
|
+
- Fixed :max
|
6
|
+
|
7
|
+
= 0.1.0
|
8
|
+
-initial conversion
|
9
|
+
-FORK to to_insane
|
10
|
+
|
1
11
|
= 0.0.4
|
2
12
|
- Gracefully deals with bad input. Thanks to isnotvalid on Github.
|
3
13
|
|
@@ -8,4 +18,4 @@
|
|
8
18
|
- Fixed typos.
|
9
19
|
|
10
20
|
= 0.0.1
|
11
|
-
- Initial release.
|
21
|
+
- Initial release.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/to_insane.rb
CHANGED
@@ -13,7 +13,7 @@ class String
|
|
13
13
|
alpha = INSANECHARACTERS
|
14
14
|
end
|
15
15
|
raise ArgumentError, "Base Value is not valid. Integer, :max, :url_safe" unless base_val.kind_of? Integer
|
16
|
-
raise ArgumentError, "Base size is too large for given character set. Please use a Base value larger than
|
16
|
+
raise ArgumentError, "Base size is too large for given character set. Please use a Base value larger than 1 and less than #{alpha.length}" if base_val > alpha.length or base_val <= 1
|
17
17
|
raise ArgumentError, "Character set needs to be larger than 0" if alpha.size <= 0
|
18
18
|
raise ArgumentError, "Character set has duplicate characters" if alpha.size != alpha.split(//).uniq.size
|
19
19
|
int_val = 0
|
@@ -35,7 +35,7 @@ class Integer
|
|
35
35
|
alpha = INSANECHARACTERS
|
36
36
|
end
|
37
37
|
raise ArgumentError, "Base Value is not valid. Integer, :max, :url_safe" unless base_val.kind_of? Integer
|
38
|
-
raise ArgumentError, "Base size is too large for given character set. Please use a Base value larger than
|
38
|
+
raise ArgumentError, "Base size is too large for given character set. Please use a Base value larger than 1 and less than #{alpha.length}" if base_val > alpha.length or base_val <= 2
|
39
39
|
raise ArgumentError, "Character set needs to be larger than 0" if alpha.size <= 0
|
40
40
|
raise ArgumentError, "Character set has duplicate characters" if alpha.size != alpha.split(//).uniq.size
|
41
41
|
char_ref = alpha[0..base_val]
|
data/to_insane.gemspec
CHANGED