fossil 0.5.17 → 0.5.18

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.5.17
1
+ 0.5.18
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fossil}
8
- s.version = "0.5.17"
8
+ s.version = "0.5.18"
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-12-06}
12
+ s.date = %q{2010-12-08}
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.extra_rdoc_files = [
@@ -798,7 +798,7 @@ class TripLeg < Sequel::Model(:'trip legs')
798
798
  return "CANC" if cancel_code > 0
799
799
  return "VERI" if verify_date > 0
800
800
  return "FLOG" if status != 1 and flight_time_actual > 0
801
- case status
801
+ case status.to_i
802
802
  when 0 then "SCHED"
803
803
  when 1 then "VERI"
804
804
  when 10,23 then "CANC"
@@ -11,15 +11,15 @@ class Date
11
11
 
12
12
  ######## from Ruby Cookbook #########
13
13
  def to_gm_time
14
- to_time(new_offset, :gm)
14
+ to_time_special(new_offset, :gm)
15
15
  end
16
16
 
17
17
  def to_local_time
18
- to_time(new_offset(DateTime.now.offset-offset), :local)
18
+ to_time_special(new_offset(DateTime.now.offset-offset), :local)
19
19
  end
20
20
 
21
21
  private
22
- def to_time(dest, method)
22
+ def to_time_special(dest, method)
23
23
  #Convert a fraction of a day to a number of microseconds
24
24
  usec = (dest.send(:sec_fraction) * 60 * 60 * 24 * (10**6)).to_i
25
25
  Time.send(method, dest.year, dest.month, dest.day, dest.send(:hour), dest.send(:min), dest.send(:sec), usec)
@@ -3,9 +3,10 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
3
3
  describe TripLeg do
4
4
 
5
5
  describe "leg_status" do
6
- it "shows scheduled maint status" do
7
- t = TripLeg.filter(:trip_number=>68070,:leg_number=> 5).first
8
- t.leg_status.should == "MAINT"
6
+ it "shows maint status" do
7
+ trip_leg = TripLeg.new(:cancel_code=>0, :status=>21, :flight_time_actual=>0, :verify_date=>0)
8
+ trip_leg.status= 21
9
+ trip_leg.leg_status.should == "MAINT"
9
10
  end
10
11
  end
11
12
 
@@ -158,9 +159,6 @@ describe TripLeg do
158
159
  end
159
160
 
160
161
 
161
-
162
-
163
-
164
162
  describe 'crew brief fields' do
165
163
  before :all do
166
164
  set_fos_db([TripLeg, Comment])
@@ -188,10 +186,11 @@ describe TripLeg do
188
186
  end
189
187
 
190
188
  it "crew fbo comment value" do
191
- @trip_leg.crew_fbo_comment_value.should == nil
189
+ @trip_leg.crew_fbo_comment.should == nil
192
190
  end
193
191
  end
194
192
 
193
+ #
195
194
  ## NEED TO REMOVE, TESTS SHOULD BE IN FlightLogExpense spec
196
195
  # describe "fuel passdown data columns" do
197
196
  #
@@ -299,7 +298,7 @@ describe TripLeg do
299
298
  # @tl.arr_fuel_cost.should == 0
300
299
  # end
301
300
  # end
302
- #
301
+
303
302
  # # FUEL PASSDOWN SPECS
304
303
  # describe "different tier pricing selection" do
305
304
  # it "has fuel qty <= second lowest tier" do
@@ -310,7 +310,7 @@ describe "Sequel::Model extentions" do
310
310
 
311
311
  it "should create a class method to get all codes for that type" do
312
312
  Dude.should respond_to(:get_all_ranch_codes)
313
- Dude.get_all_ranch_codes.should have(1).things
313
+ Dude.get_all_ranch_codes.size.should == 1
314
314
  Dude.get_all_ranch_codes.first.should == 'manly ranch'
315
315
  end
316
316
 
@@ -2,46 +2,36 @@ require 'fossil'
2
2
  require 'logger'
3
3
  require 'pp'
4
4
 
5
- module Sequel
6
- class Model
7
- module InstanceMethods
8
- def this
9
- if primary_key.is_a?(Array) and primary_key.include?(:'kid - user')
10
- @this ||= model.dataset.filter(pk_hash.soft_delete(:'kid - user')).filter(:kid_user.like("%#{kid_user}%")).limit(1).naked
11
- else
12
- @this ||= model.dataset.filter(pk_hash).limit(1).naked
13
- end
14
- end
15
- end
16
- end
17
- end
18
5
  # 800 557-9965
19
6
  # 0279507735
20
7
 
21
- DB = Sequel.fos('flyos', :loggers=>[Logger.new($stdout)])
8
+ #DB = Sequel.fos('flyos', :loggers=>[Logger.new($stdout)])
22
9
 
23
- [Airport,TripLeg,AirportFbo].each{|m| m.db=DB}
10
+ #[Airport,TripLeg,AirportFbo].each{|m| m.db=DB}
24
11
  #[Trip,CrewLeg,TripLeg,Passenger,Aircraft,Airport,AirportFbo,CrewLeg,Code,Personnel,Comment].each{|m| m.db=DB}
25
12
  #p TripLeg.all.collect{ |t| [t.pic,t.sic,t.departure_fbo__name,t.arrival_fbo__name]}
26
13
  #t = Trip.filter(:trips__trip_number=>8).eager_graph(:trip_legs).all.first
27
14
  #p t
28
15
  #p AirportFbo[Sequel.fos_id_to_lookup_key("D-0-2-75-21071")]
29
16
  #p [:kid_user,:kid_mult,:kid_comm,:kid_date,:kid_time].zip(Sequel.fos_id_to_lookup_key("D-0-2-75-21071"))
30
- def pk_list(prefix)
31
- ['kid - user','kid - mult','kid - comm','kid - date','kid - time'].collect{|v| "#{prefix} #{v}" }
32
- #[:kid_user,:kid_mult,:kid_comm,:kid_date,:kid_time].collect{|v| "#{prefix} #{v.to_s}" }
33
- end
17
+ # def pk_list(prefix)
18
+ # ['kid - user','kid - mult','kid - comm','kid - date','kid - time'].collect{|v| "#{prefix} #{v}" }
19
+ # [:kid_user,:kid_mult,:kid_comm,:kid_date,:kid_time].collect{|v| "#{prefix} #{v.to_s}" }
20
+ # end
34
21
 
35
22
  #p AirportFbo.filter(:icao=>'KSFO').count
36
- tl = TripLeg.filter(:trip_number=>8,:leg_number=>1).first#eager_graph(:arrival_fbo).all.first
23
+ #DB.execute('Update "trip legs" set "pax count" = 9 where "trip number" = 62 and "leg number" = 1 ')
24
+ #tl = TripLeg.filter(:trip_number=>62,:leg_number=>1).first#eager_graph(:arrival_fbo).all.first
25
+ #p tl.fos_id
26
+ #p tl.pax_count
37
27
  #tl2 = TripLeg.filter(tl.pk_hash.soft_delete(:'kid - user')).filter(:kid_user.like("%#{tl.kid_user}%")).first
38
28
  #p tl.pk_hash
39
29
  #tl.update(:fs_hotel=>"dan lodge")
40
30
  #ku = tl.pk_hash.soft_delete(:'kid - user')
41
31
  #p ku
42
32
  #p tl.pk_hash.delete(:'kid - user')
43
- fbo = Airport.filter(:icao=>tl.arrival_icao).eager_graph(:airport_fbos).all.first
44
- tl.update(pk_list('fbo').zip(fbo.pk))
33
+ #fbo = Airport.filter(:icao=>tl.arrival_icao).eager_graph(:airport_fbos).all.first
34
+ #tl.update(pk_list('fbo').zip(fbo.pk))
45
35
 
46
36
  #p fbo.pk
47
37
  #p fbo.primary_key
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 17
9
- version: 0.5.17
8
+ - 18
9
+ version: 0.5.18
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-12-06 00:00:00 -08:00
17
+ date: 2010-12-08 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency