fossil 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
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.4.1"
8
+ s.version = "0.4.2"
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-06-08}
12
+ s.date = %q{2010-06-15}
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 = [
data/lib/fossil.rb CHANGED
@@ -11,6 +11,7 @@ begin
11
11
  gem 'activesupport', '=2.3.5'
12
12
  require('active_support')
13
13
  rescue LoadError => e
14
+ p e.message
14
15
  raise "To use Fossil you need the active_support gem: '$ sudo gem install active_support -v=2.3.5'"
15
16
  end
16
17
 
@@ -43,9 +43,9 @@ class TripLeg < Sequel::Model(:'trip legs')
43
43
  many_to_one :alternate_arrival_airport, :class=>:Airport, :key=>nil, :dataset=>proc{ Airport.filter(:'airport id prefix'.like("%#{self[:'arr alt prefix']}"), :'airport id'.like( "%#{self[:'arr alt id']}"))}
44
44
  many_to_one :alternate_departure_airport, :class=>:Airport, :key=>nil, :dataset=>proc{ Airport.filter(:'airport id prefix'.like("%#{self[:'dep alt prefix']}"), :'airport id'.like( "%#{self[:'dep alt id']}"))}
45
45
  many_to_one :comment_value, :class=>:Comment, :key=>primary_key#, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>self[:"kid - comm"]) }
46
- many_to_one :departure_fbo_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>self[:"fueler comment"]) }
47
- many_to_one :arrival_fbo_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>self[:"fbo comment"]) }
48
- many_to_one :catering_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>self[:"catering comment"]) }
46
+ many_to_one :departure_fbo_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>43) } # must hardcode kid comms for comments
47
+ many_to_one :arrival_fbo_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>34) } # must hardcode kid comms for comments
48
+ many_to_one :catering_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>37) }
49
49
  many_to_one :limo_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>self[:"limo comment"]) }
50
50
  many_to_one :crew_fbo_comment_value, :class=>:Comment, :key=>nil, :dataset=>proc { Comment.filter( :"kid - date"=>self[:"kid - date"], :"kid - time"=>self[:"kid - time"], :"kid - user"=>self[:"kid - user"], :"kid - mult"=>self[:"kid - mult"], :"kid - comm"=>self[:"mics serv 2 comment"]) }
51
51
 
@@ -44,6 +44,9 @@ module TimeFunctions
44
44
  to_s(:hm)
45
45
  end
46
46
 
47
+ def to_fos_days
48
+ to_date.to_fos_days
49
+ end
47
50
  end
48
51
 
49
52
  class Time
@@ -7,6 +7,14 @@ describe "fos_dates" do
7
7
  DateTime.new.should respond_to(:as_minutes)
8
8
  end
9
9
 
10
+ it "Date class to_fos_days converts date to days since epoch" do
11
+ Date.new(1900,1,10).to_fos_days.should == 10
12
+ end
13
+
14
+ it "Time class to_fos_days converts time to to days since epoch" do
15
+ DateTime.new(1900,1,10,0,0,0).to_time.to_fos_days.should == 10
16
+ end
17
+
10
18
  it "converts fos date number to a Ruby Date" do
11
19
  Date.from_fos_days(10).should == Date.new(1900,1,10)
12
20
  end
data/spec/spec_helper.rb CHANGED
@@ -2,7 +2,9 @@ require 'lib/fossil'
2
2
  require 'spec'
3
3
  require 'rr'
4
4
  require 'pp'
5
- p RUBY_VERSION
5
+
6
+ p RUBY_VERSION
7
+
6
8
  unless defined?(DB_DEMO)
7
9
  DB_DEMO = Sequel.odbc('demodata')#, :loggers=>[Logger.new($stdout)])
8
10
  DB_DEMO.extend(Sequel::Pervasive::DatabaseMethods)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 1
9
- version: 0.4.1
8
+ - 2
9
+ version: 0.4.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Patrick Lardin, Daniel Sudol
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-08 00:00:00 -07:00
17
+ date: 2010-06-15 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency