dater 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Gemfile.lock +1 -1
  2. data/lib/dater.rb +14 -4
  3. data/lib/dater/version.rb +1 -1
  4. metadata +1 -1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dater (0.0.2)
4
+ dater (0.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/dater.rb CHANGED
@@ -30,12 +30,22 @@ module Dater
30
30
  else
31
31
  if period.include?('/')
32
32
  date=period.split('/')
33
- return date.join('-') if date.first.size==4
34
- return "#{date[2]}-#{date[1]}-#{date[0]}"
33
+ if @format.include? '-'
34
+ return date.join('-') if date.first.size==4
35
+ return "#{date[2]}-#{date[1]}-#{date[0]}"
36
+ else
37
+ return date.join('/') if date.first.size==4
38
+ return "#{date[2]}/#{date[1]}/#{date[0]}"
39
+ end
35
40
  elsif period.include?('-')
36
41
  date=period.split('-')
37
- return date.join('-') if date.first.size==4
38
- return "#{date[2]}-#{date[1]}-#{date[0]}"
42
+ if @format.include? '-'
43
+ return date.join('-') if date.first.size==4
44
+ return "#{date[2]}-#{date[1]}-#{date[0]}"
45
+ else
46
+ return date.join('/') if date.first.size==4
47
+ return "#{date[2]}/#{date[1]}/#{date[0]}"
48
+ end
39
49
  elsif (amount=period.scan(/\d+/)).size>0
40
50
  case @lang
41
51
  when 'es'
data/lib/dater/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dater
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: