rubysl-date 2.0.6 → 2.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
  SHA1:
3
- metadata.gz: 2d40e6d8fc233f1fa22bdb0e253ee9be22f9c3a1
4
- data.tar.gz: 19f817d2445ef061f8ff6620e2e3f3512eb77526
3
+ metadata.gz: 15a5c9e1a6382cebf9dcb0066e38531ed7dda2cc
4
+ data.tar.gz: 01a181b9bf7f42df885b2b5204f07aa1ae8e1826
5
5
  SHA512:
6
- metadata.gz: f775ec2a1d31951d7f93c6376e55fe06a47b4f8434d53d668290f0cdf082b7e4a09958521c95875eadb65d8c2548b11d52cba53660431de283531812275f26ca
7
- data.tar.gz: 59dadd4e96ac3067c0110ccbd3b4b4ba4c65482119652d3e7d1db23b8ddb1cd956826b81d438a28cc25b48f5eb935ad692887f572e155386ab64d86a0838e68f
6
+ metadata.gz: 4e60fe68246f81777d2c291181322736ee670ae332b9723ffd5fd4e7eaea0816b236f291f075eec55725936f0241193e7ae755fb878c99a13599853ebb010a5b
7
+ data.tar.gz: 110f4dd874b0b96c40ff7922c571022d8f718e87ed936a2e1dced438347a9c9dd7601f092159c41e425a212a25af7f39ecfe93fb042029341d9dffef90d0a341
@@ -1,14 +1,7 @@
1
1
  language: ruby
2
2
  env:
3
- - RUBYLIB=lib
4
- - RUBYLIB=
3
+ - RUBYLIB=lib:.
5
4
  script: mspec spec
6
5
  rvm:
7
- - 2.0.0
8
- - rbx-2.1.1
9
- matrix:
10
- exclude:
11
- - rvm: 2.0.0
12
- env: RUBYLIB=lib
13
- - rvm: rbx-2.1.1
14
- env: RUBYLIB=
6
+ - 2.1.0
7
+ - rbx-2
@@ -559,8 +559,8 @@ class Date
559
559
  e._cent ||= if val >= 69 then 19 else 20 end
560
560
  when 'Z', /\A:{0,3}z/
561
561
  return unless str.sub!(/\A((?:gmt|utc?)?[-+]\d+(?:[,.:]\d+(?::\d+)?)?
562
- |[[:alpha:].\s]+(?:standard|daylight)\s+time\b
563
- |[[:alpha:]]+(?:\s+dst)?\b
562
+ |(?-i:[[:alpha:].\\s]+)(?:standard|daylight)\\stime\\b
563
+ |(?-i:[[:alpha:]]+)(?:\\sdst)?\\b
564
564
  )/ix, '')
565
565
  val = $1
566
566
  e.zone = val
@@ -718,9 +718,9 @@ class Date
718
718
  (
719
719
  (?:gmt|utc?)?[-+]\d+(?:[,.:]\d+(?::\d+)?)?
720
720
  |
721
- [[:alpha:].\s]+(?:standard|daylight)\stime\b
721
+ (?-i:[[:alpha:].\s]+)(?:standard|daylight)\stime\b
722
722
  |
723
- [[:alpha:]]+(?:\sdst)?\b
723
+ (?-i:[[:alpha:]]+)(?:\sdst)?\b
724
724
  )
725
725
  )?
726
726
  /ix,
@@ -1784,7 +1784,7 @@ class Time
1784
1784
  def to_time() getlocal end
1785
1785
 
1786
1786
  def to_date
1787
- jd = Date.__send__(:civil_to_jd, year, mon, mday, Date::ITALY)
1787
+ jd = Date.__send__(:civil_to_jd, year, mon, mday, Date::GREGORIAN)
1788
1788
  Date.new!(Date.__send__(:jd_to_ajd, jd, 0, 0), 0, Date::ITALY)
1789
1789
  end
1790
1790
 
@@ -1,5 +1,5 @@
1
1
  module RubySL
2
2
  module Date
3
- VERSION = "2.0.6"
3
+ VERSION = "2.0.8"
4
4
  end
5
5
  end
@@ -0,0 +1,12 @@
1
+ require 'date'
2
+
3
+ describe "Date#_parse" do
4
+ it "parses 10:00 UTC as hour, min, zone and offset" do
5
+ Date._parse("10:00 UTC").should == {
6
+ :hour => 10,
7
+ :min => 0,
8
+ :offset => 0,
9
+ :zone => "UTC",
10
+ }
11
+ end
12
+ end
@@ -0,0 +1,27 @@
1
+ require 'date'
2
+
3
+ describe "Time#to_date" do
4
+ describe "date before the Gregorian calendar adoption in Italy" do
5
+ it "converts a Gregorian Time object into a Julian Date object" do
6
+ date = Time.local(1582, 10, 14).to_date
7
+ date.julian?.should be_true
8
+ date.gregorian?.should be_false
9
+
10
+ date.year.should == 1582
11
+ date.mon.should == 10
12
+ date.mday.should == 4
13
+ end
14
+ end
15
+
16
+ describe "date after the Gregorian calendar adoption in Italy" do
17
+ it "converts a Gregorian Time object into a Gregorian Date object" do
18
+ date = Time.local(1582, 10, 15).to_date
19
+ date.julian?.should be_false
20
+ date.gregorian?.should be_true
21
+
22
+ date.year.should == 1582
23
+ date.mon.should == 10
24
+ date.mday.should == 15
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysl-date
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Shirai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-24 00:00:00.000000000 Z
11
+ date: 2014-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -88,6 +88,7 @@ files:
88
88
  - lib/rubysl/date/date.rb
89
89
  - lib/rubysl/date/version.rb
90
90
  - rubysl-date.gemspec
91
+ - spec/date/_parse_spec.rb
91
92
  - spec/date/accessor_spec.rb
92
93
  - spec/date/add_month_spec.rb
93
94
  - spec/date/add_spec.rb
@@ -242,6 +243,7 @@ files:
242
243
  - spec/datetime/to_time_spec.rb
243
244
  - spec/datetime/xmlschema_spec.rb
244
245
  - spec/datetime/zone_spec.rb
246
+ - spec/time/to_date_spec.rb
245
247
  homepage: https://github.com/rubysl/rubysl-date
246
248
  licenses:
247
249
  - BSD
@@ -262,11 +264,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
262
264
  version: '0'
263
265
  requirements: []
264
266
  rubyforge_project:
265
- rubygems_version: 2.0.7
267
+ rubygems_version: 2.2.2
266
268
  signing_key:
267
269
  specification_version: 4
268
270
  summary: Ruby standard library date.
269
271
  test_files:
272
+ - spec/date/_parse_spec.rb
270
273
  - spec/date/accessor_spec.rb
271
274
  - spec/date/add_month_spec.rb
272
275
  - spec/date/add_spec.rb
@@ -421,4 +424,4 @@ test_files:
421
424
  - spec/datetime/to_time_spec.rb
422
425
  - spec/datetime/xmlschema_spec.rb
423
426
  - spec/datetime/zone_spec.rb
424
- has_rdoc:
427
+ - spec/time/to_date_spec.rb