drexed-datetime 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3195a371e9617f1f20167177fca7ca21dc45c9c
4
- data.tar.gz: 0c580bf728a2d7f879644bad6006c6bf48b5ca39
3
+ metadata.gz: 0c2e2a88cec5ebc63836b5e7622adeadb1c7ae83
4
+ data.tar.gz: 9e16a9aaa6c4e6a74cc627944ab646fb2f5386c1
5
5
  SHA512:
6
- metadata.gz: f5b90092e40de110084dbd9ebf98c4f1127c48ff924fa1767819e92d68ed342de6def65f29dee9bcfd21f226f61b3bc29a9829a7e781fa0a0e3a77bafbce5851
7
- data.tar.gz: a9ae676beb47202dcd0ec1eac13882d5fd017555be1b04431cd192ff66cb0b61eb7ce350d1f57f2c3d3187a72084326ec1fc042b51b3aeee39df1f4186e73b22
6
+ metadata.gz: c043cb3941f983ebdcabc8a8ae7e3efcc15022369c6791b694ebe18f9f92ccbdf2e7a9b154099b8cebc27819e497817b3c5ff13a8d1e275efd6cf8e073938201
7
+ data.tar.gz: 8355bf0e830d0eaa8ae62a24e7b1a3df093fae82e9d02cc7f89c89072b72f6dfe31d1f150c1d447885f1d2835b9eae59a4f21872d2f78181880ec8189e68b1a3
@@ -2,28 +2,30 @@ require "drexed/datetime/version"
2
2
 
3
3
  module Drexed
4
4
  module Datetime
5
- ## Time.datetime_to("yyyy-mm-dd") => "2012-03-04"
6
- def datetime_to(tach)
7
- delineators = tach.scan /\W+/
8
- formatters = tach.scan /[a-z]+/i
9
- units = { "yy" => "y",
10
- "yyyy" => "Y",
11
- "m" => "-m",
12
- "mm" => "m",
13
- "M" => "b",
14
- "MM" => "B",
15
- "d" => "-d",
16
- "dd" => "d",
17
- "D" => "a",
18
- "DD" => "A",
19
- "h" => "-I",
20
- "hh" => "I",
21
- "H" => "-H",
22
- "HH" => "H",
23
- "mi" => "M",
24
- "p" => "P",
25
- "P" => "p" }
26
- strftime(formatters.map{ |f| "%#{units[f]}#{delineators.shift || ""}" }.join)
5
+ class Engine < ::Rails::Engine
6
+ ## Time.datetime_to("yyyy-mm-dd") => "2012-03-04"
7
+ def datetime_to(tach)
8
+ delineators = tach.scan /\W+/
9
+ formatters = tach.scan /[a-z]+/i
10
+ units = { "yy" => "y",
11
+ "yyyy" => "Y",
12
+ "m" => "-m",
13
+ "mm" => "m",
14
+ "M" => "b",
15
+ "MM" => "B",
16
+ "d" => "-d",
17
+ "dd" => "d",
18
+ "D" => "a",
19
+ "DD" => "A",
20
+ "h" => "-I",
21
+ "hh" => "I",
22
+ "H" => "-H",
23
+ "HH" => "H",
24
+ "mi" => "M",
25
+ "p" => "P",
26
+ "P" => "p" }
27
+ strftime(formatters.map{ |f| "%#{units[f]}#{delineators.shift || ""}" }.join)
28
+ end
27
29
  end
28
30
  end
29
31
  end
@@ -1,5 +1,5 @@
1
1
  module Drexed
2
2
  module Datetime
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drexed-datetime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez