hellobase 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: 4edaf03ad055e6fac048204d52f6d33f14a5db9e458dfc186e39066ca8ccea06
4
- data.tar.gz: 9d55c88166736f17e9e8309e8cb905f48ae2f0bcdad38ccbd8750cc3edb93c9c
3
+ metadata.gz: c9a3bef090b09fe7abe292328fa8b00651b5848175316252dade58061967cb26
4
+ data.tar.gz: 11b1384b3789910fe052ee4ae90d9d74253d917aefff90895a24caec54226566
5
5
  SHA512:
6
- metadata.gz: abf79988dce3db4c20d9c4e9b901539d0ce4f71e1d4e65a4e2b68d8245dc909250ef690a59091b7b61dc1c34ddf1d896537fc926ed558914750ed491bbc75cf9
7
- data.tar.gz: f8261405b13b7e13d47a0bf0b9bcd75f3edb4a4d7d53595f440798ed4bd26ddfc03db44dc664f43a03948e2ce5a4843d85da3afe55c2077d7fc191d35fff7f2d
6
+ metadata.gz: f5bd340087ddc083027a3eefbf14c5874646399652891f522fda9d5a988886ff5724cfd1a8861a208a13044af70d98dfe7f08aba11a5a4c9b3b3e641735a6f7e
7
+ data.tar.gz: 23e2691a82055e76dc64cbd464bfe739de824c1843805a8ee4ad6e2c0a2114522952aeb39163068b7d5f6910378adc7fb0c5f549bbc91e185b75737175cc9c3b
data/lib/hellobase.rb CHANGED
@@ -15,7 +15,7 @@ require 'hellobase/time_creation'
15
15
  module Hellobase
16
16
  DATE_FORMAT = /^\d{4}-\d{2}-\d{2}$/
17
17
  TIME_FORMAT = /^\d{2}:\d{2}:\d{2}$/
18
- DATETIME_FORMAT = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/
18
+ DATETIME_FORMAT = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} UTC$/
19
19
 
20
20
  class Error < StandardError
21
21
  attr_reader :type, :object
@@ -1,12 +1,12 @@
1
1
  Date.singleton_class.prepend(
2
2
  Module.new do
3
3
  def parse(string)
4
- raise Hellobase::Error.new(:date_parse, nil, string) unless string =~ Hellobase::DATE_FORMAT
4
+ raise Hellobase::Error.new(:date_format, nil, string) unless string =~ Hellobase::DATE_FORMAT
5
5
 
6
6
  begin
7
7
  super
8
8
  rescue ArgumentError
9
- raise Hellobase::Error.new(:date_parse, nil, string)
9
+ raise Hellobase::Error.new(:date_value, nil, string)
10
10
  end
11
11
  end
12
12
 
@@ -14,7 +14,7 @@ Date.singleton_class.prepend(
14
14
  begin
15
15
  super
16
16
  rescue ArgumentError
17
- raise Hellobase::Error.new(:date_new, nil, *args)
17
+ raise Hellobase::Error.new(:date_value, nil, *args)
18
18
  end
19
19
  end
20
20
  end
@@ -1,21 +1,25 @@
1
1
  Time.singleton_class.prepend(
2
2
  Module.new do
3
3
  def parse(string)
4
- raise Hellobase::Error.new(:datetime_parse, nil, string) unless string =~ Hellobase::DATETIME_FORMAT
4
+ raise Hellobase::Error.new(:datetime_format, nil, string) unless string =~ Hellobase::DATETIME_FORMAT
5
5
 
6
6
  begin
7
7
  super
8
8
  rescue ArgumentError
9
- raise Hellobase::Error.new(:datetime_parse, nil, string)
9
+ raise Hellobase::Error.new(:datetime_value, nil, string)
10
10
  end
11
11
  end
12
12
 
13
- def new(*args)
13
+ def utc(*args)
14
14
  begin
15
15
  super
16
16
  rescue ArgumentError
17
- raise Hellobase::Error.new(:datetime_new, nil, *args)
17
+ raise Hellobase::Error.new(:datetime_value, nil, *args)
18
18
  end
19
19
  end
20
+
21
+ def new(*args)
22
+ raise Hellobase::Error.new(:datetime_new, nil)
23
+ end
20
24
  end
21
25
  )
@@ -1,12 +1,12 @@
1
1
  Tod::TimeOfDay.singleton_class.prepend(
2
2
  Module.new do
3
3
  def parse(string)
4
- raise Hellobase::Error.new(:time_parse, nil, string) unless string =~ Hellobase::TIME_FORMAT
4
+ raise Hellobase::Error.new(:time_format, nil, string) unless string =~ Hellobase::TIME_FORMAT
5
5
 
6
6
  begin
7
7
  super
8
8
  rescue ArgumentError
9
- raise Hellobase::Error.new(:time_parse, nil, string)
9
+ raise Hellobase::Error.new(:time_value, nil, string)
10
10
  end
11
11
  end
12
12
 
@@ -14,7 +14,7 @@ Tod::TimeOfDay.singleton_class.prepend(
14
14
  begin
15
15
  super
16
16
  rescue ArgumentError
17
- raise Hellobase::Error.new(:time_new, nil, *args)
17
+ raise Hellobase::Error.new(:time_value, nil, *args)
18
18
  end
19
19
  end
20
20
  end
@@ -1,3 +1,3 @@
1
1
  module Hellobase
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hellobase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Wang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-12 00:00:00.000000000 Z
11
+ date: 2020-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport