timesteps 1.0.7 → 1.0.8

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: 7260409d0d9c17a7b0f00020d5774871940e54cde85f93755543beeb136a54e3
4
- data.tar.gz: 0720a029275da64424874156a74dfe2ed5a2b6454e95e6e2f5c9025d7b7fa020
3
+ metadata.gz: f2250572f5f280515d33d4928c198739ba3f5ba9c69ad3dfeb64ee55d982a206
4
+ data.tar.gz: 38a8b7b8e6339cfa77665c60194eab228ccb2eabdae71617955a0fe2beb2b303
5
5
  SHA512:
6
- metadata.gz: cde29693895634ce436b83f96893900ab2e55fbb832263a53d72f2525a82075f01094f58fdb32888c856de26d581ae84ee7be97880bd3f08187c675f5aba2c07
7
- data.tar.gz: 1179663617b43bc8a98ca2cdb266607921e0f45d24ecce3027695665f9655d7ad0cb9f9da4cc4fd300c93236c188198ac9ed9fe27b40309d10fb5c913e614f13
6
+ metadata.gz: 5d21b7ad3e786ffca4966c9c7be8637ee316dd91a0e8bf9703c59ccb054c18cd4e3be9fb50f1056b07fac6e7d0391f4718123aeab677ceb2a62801289c810996
7
+ data.tar.gz: 56462ea294eab5163d9bad21b36939bc3f6cb02204c02efccdc697def79b03298d5de517cabc1ecc1ff5dc0a507217903e23e79e098aea8c801f2868600d2a1a
@@ -45,6 +45,10 @@ class DateTime
45
45
  mday = 1
46
46
  rest = $4
47
47
  hash = DateTime._parse("#{year}-#{month}-#{mday} 00:00:00 #{rest}")
48
+ elsif spec =~ /\A(\d{1,2}:\d{2}(:\d{2})?)\s*([+\-]\d{1,2}(:\d{2})?)?\z/
49
+ time = $1
50
+ offset = $3 || ""
51
+ hash = DateTime._parse("1970-01-01 #{time}#{offset}")
48
52
  else
49
53
  hash = DateTime._parse(spec)
50
54
  end
@@ -135,6 +135,10 @@ describe "TimeStep.new" do
135
135
  is_asserted_by { TimeStep.new("sec").origin == DateTime.new(1970,1,1) }
136
136
 
137
137
  end
138
+
139
+ example 'without since hh:mm+hh:mm' do
140
+ is_asserted_by { TimeStep.new("3 hours since 02:00").origin == DateTime.new(1970,1,1,2,0) }
141
+ end
138
142
 
139
143
  example 'since option with format' do
140
144
 
@@ -503,3 +507,5 @@ describe "TimeStep#truncate" do
503
507
  end
504
508
 
505
509
  end
510
+
511
+
data/timesteps.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  Gem::Specification::new do |s|
3
- version = '1.0.7'
3
+ version = '1.0.8'
4
4
 
5
5
  files = Dir.glob('**/*') + ['.yardopts'] - [
6
6
  Dir.glob('timesteps-*.gem'),
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timesteps
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroki Motoyoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-30 00:00:00.000000000 Z
11
+ date: 2022-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  requirements: []
88
- rubygems_version: 3.0.3
88
+ rubygems_version: 3.1.6
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: A library for handling discrete time series in constant increments