commonthread-rails 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{commonthread-rails}
8
- s.version = "0.3.3"
8
+ s.version = "0.3.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["CommonThread"]
12
- s.date = %q{2010-11-25}
12
+ s.date = %q{2010-11-26}
13
13
  s.description = %q{commonthread-rails is a collection of things that make rails development better for us. It includes date formats, monkey patches to String, Array and NilClass to make things nicer. An Encrypter using blowfish. Also, some rails filters}
14
14
  s.email = %q{hello@commonthread.com}
15
15
  s.extra_rdoc_files = [
@@ -15,7 +15,7 @@ common_formats = {
15
15
  :full_time_24 => '%H:%M:%S' # 16:30:24
16
16
  }
17
17
 
18
- if defined?(ActiveSupport)
18
+ if defined?(ActiveSupport::CoreExtensions)
19
19
  ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(common_formats)
20
20
  ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(common_formats)
21
21
  end
@@ -46,6 +46,15 @@ class String
46
46
  rand_string
47
47
  end
48
48
 
49
+ def self.rand_hex(length = 12)
50
+ alphabet = ('a' .. 'f').to_a + ('0' .. '9').to_a
51
+ rand_string = ''
52
+ length.times do
53
+ rand_string << alphabet.rand
54
+ end
55
+ rand_string
56
+ end
57
+
49
58
  def email?
50
59
  if self =~ /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
51
60
  return true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commonthread-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 3
10
- version: 0.3.3
9
+ - 4
10
+ version: 0.3.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - CommonThread
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-25 00:00:00 -06:00
18
+ date: 2010-11-26 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency