glowing-archer 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/glowing-archer/version.rb +1 -1
- data/lib/glowing-archer.rb +13 -0
- metadata +4 -4
data/lib/glowing-archer.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Glowing
|
2
2
|
module Archer
|
3
3
|
|
4
|
+
# generate html for bootstrap badges (tags)
|
4
5
|
def bootstrap_badges(badges, style = "")
|
5
6
|
style = (" " + style) unless style.nil_or_empty?
|
6
7
|
html = ""
|
@@ -11,6 +12,18 @@ module Glowing
|
|
11
12
|
return html.html_safe
|
12
13
|
end
|
13
14
|
|
15
|
+
# generate invite code http://railscasts.com/episodes/124-beta-invitations
|
16
|
+
# => "bf35184b0e7ebb5baad116bfe4a8dbdfb58277d2"
|
17
|
+
def invite_code
|
18
|
+
Digest::SHA1.hexdigest([Time.now, rand].join)
|
19
|
+
end
|
20
|
+
|
21
|
+
# generate random key #2 http://stackoverflow.com/questions/6021372/best-way-to-create-unique-token-in-rails
|
22
|
+
# => "Sk349WNovoUDRZ930Uha"
|
23
|
+
def secure_key(length = 15)
|
24
|
+
SecureRandom.base64(length).tr('+/=', '0aZ').strip.delete("\n")
|
25
|
+
end
|
26
|
+
|
14
27
|
end
|
15
28
|
end
|
16
29
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glowing-archer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -61,7 +61,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
61
61
|
version: '0'
|
62
62
|
segments:
|
63
63
|
- 0
|
64
|
-
hash:
|
64
|
+
hash: 4408525370439168681
|
65
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
66
|
none: false
|
67
67
|
requirements:
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
version: '0'
|
71
71
|
segments:
|
72
72
|
- 0
|
73
|
-
hash:
|
73
|
+
hash: 4408525370439168681
|
74
74
|
requirements: []
|
75
75
|
rubyforge_project:
|
76
76
|
rubygems_version: 1.8.23
|