mdemare-like_time 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/like_time.rb +5 -7
  3. data/like_time.gemspec +1 -1
  4. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -48,16 +48,14 @@ class Time
48
48
  raise "Language #{lang} not supported." unless lang_data
49
49
  match_capitalization = lambda {|t,z| z == z.downcase ? t.downcase : z == z.upcase ? t.upcase : t.capitalize }
50
50
  t = s.split(/([A-Z]+)|(\d+)/i).map do |x|
51
- if y = CONVERSION[x.downcase]
52
- y
53
- elsif y = lang_data[:conversion][x.downcase]
51
+ if y = lang_data[:conversion][x.downcase]
54
52
  unit = (y == :day || y == :lday) ? wday : month
55
53
  match_capitalization[lang_data[y][unit], x]
56
- else
57
- x
54
+ else
55
+ CONVERSION[x.downcase] || x
58
56
  end
59
- end.join
60
- strftime to_sym
57
+ end
58
+ strftime t.join
61
59
  end
62
60
  end
63
61
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{like_time}
5
- s.version = "0.2.1"
5
+ s.version = "0.2.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Michiel de Mare"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdemare-like_time
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michiel de Mare