fossil 0.3.26 → 0.3.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.26
1
+ 0.3.27
data/fossil.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fossil}
8
- s.version = "0.3.26"
8
+ s.version = "0.3.27"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Patrick Lardin, Daniel Sudol"]
12
- s.date = %q{2010-03-16}
12
+ s.date = %q{2010-03-19}
13
13
  s.description = %q{Access FOS/betrieve db with this Sequel based orm wrapper}
14
14
  s.email = %q{plardin@xojet.com}
15
15
  s.files = [
@@ -74,6 +74,16 @@ class Time
74
74
  args = :hm unless args
75
75
  self.original_to_s(args)
76
76
  end
77
+
78
+ # overriding default behavior from module TimeFunctions
79
+ # to ensure that if you want to convert the DateTime that this function returns,
80
+ # you can convert is safely to a Time class. To do this the Date part must be
81
+ # at least (1901,12,14), so I am rounding to (1902,1,1), and calling that
82
+ # the beginning date for a time with no hours, mins and seconds.
83
+ def self.from_fos_time(minutes)
84
+ return DateTime.new(1902,1,1) if minutes == 0
85
+ DateTime.new(1899, 12, 31).advance(:minutes=>minutes)
86
+ end
77
87
  end
78
88
 
79
89
  class DateTime
@@ -16,7 +16,11 @@ describe "fos_dates" do
16
16
  Date.from_fos_days(10).should == Date.new(1900,1,10)
17
17
  end
18
18
 
19
- it "converts fos time number to a Ruby Time" do
19
+ it "converts fos time number of 0 to a DateTime of (1902,1,1)" do
20
+ Time.from_fos_time(0).should == DateTime.new(1902,1,1,0,0,0)
21
+ end
22
+
23
+ it "converts fos time number to a Ruby DateTime" do
20
24
  Time.from_fos_time(100).should == DateTime.new(1899,12,31,1,40,0)
21
25
  end
22
26
 
@@ -31,4 +35,5 @@ describe "fos_dates" do
31
35
  it "Time view defaults to M:H" do
32
36
  Time.parse('Sept 9, 2009 07:10').to_s.should == "07:10"
33
37
  end
38
+
34
39
  end
@@ -265,7 +265,7 @@ describe "Sequel::Model extentions" do
265
265
 
266
266
  it "datetime can handle nil date or time" do
267
267
  add_test_table_data({:date_col => nil, :time_col => nil})
268
- TestTable.first.datetime_col.should == DateTime.new(1899,12,31,0,0,0)
268
+ TestTable.first.datetime_col.should == DateTime.new(1902,1,1,0,0,0)
269
269
  end
270
270
 
271
271
  end
data/spec/spec_helper.rb CHANGED
@@ -4,10 +4,10 @@ require 'rr'
4
4
  require 'pp'
5
5
 
6
6
  unless defined?(DB_DEMO)
7
- DB_DEMO = Sequel.odbc('demodata')#, :loggers=>[Logger.new($stdout)])
7
+ DB_DEMO = Sequel.odbc('demodatadev')#, :loggers=>[Logger.new($stdout)])
8
8
  DB_DEMO.extend(Sequel::Pervasive::DatabaseMethods)
9
9
 
10
- DB_FOS = Sequel.odbc('fos')#, :loggers=>[Logger.new($stdout)])
10
+ DB_FOS = Sequel.odbc('fosdev')#, :loggers=>[Logger.new($stdout)])
11
11
  DB_FOS.extend(Sequel::Pervasive::DatabaseMethods)
12
12
  end
13
13
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fossil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.26
4
+ version: 0.3.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Lardin, Daniel Sudol
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-16 00:00:00 -07:00
12
+ date: 2010-03-19 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency