surveyor 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/surveyor.rb +6 -2
- data/surveyor.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.4
|
data/lib/surveyor.rb
CHANGED
@@ -5,10 +5,14 @@ require 'surveyor/config'
|
|
5
5
|
require 'surveyor/acts_as_response'
|
6
6
|
|
7
7
|
module Surveyor
|
8
|
-
RAND_CHARS = [('a'..'z'), ('A'..'Z'), (0..9)].map
|
8
|
+
RAND_CHARS = [('a'..'z'), ('A'..'Z'), (0..9)].map{|r| r.to_a}.flatten.to_s
|
9
9
|
|
10
10
|
def self.make_tiny_code(len = 10)
|
11
|
-
|
11
|
+
if RUBY_VERSION < "1.8.7"
|
12
|
+
(1..len).to_a.map{|i| RAND_CHARS[rand(RAND_CHARS.size), 1] }.to_s
|
13
|
+
else
|
14
|
+
len.times.map{|i| RAND_CHARS[rand(RAND_CHARS.size), 1] }.to_s
|
15
|
+
end
|
12
16
|
end
|
13
17
|
|
14
18
|
def self.to_normalized_string(text)
|
data/surveyor.gemspec
CHANGED