fossil 0.3.30 → 0.3.31
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 +1 -1
- data/fossil.gemspec +2 -2
- data/lib/models/trip_leg.rb +8 -12
- data/spec/models/trip_leg_spec.rb +7 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.31
|
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.
|
8
|
+
s.version = "0.3.31"
|
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-
|
12
|
+
s.date = %q{2010-03-23}
|
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/models/trip_leg.rb
CHANGED
@@ -627,12 +627,6 @@ class TripLeg < Sequel::Model(:'trip legs')
|
|
627
627
|
# delegators
|
628
628
|
delegate :lead_pax, :to => :trip
|
629
629
|
delegate :passenger_list, :to => :trip
|
630
|
-
delegate :name, :to => :arrival_airport, :prefix=>true, :allow_nil=>true
|
631
|
-
delegate :name, :to => :departure_airport, :prefix=>true, :allow_nil=>true
|
632
|
-
delegate :city, :to => :arrival_airport, :prefix=>true, :allow_nil=>true
|
633
|
-
delegate :city, :to => :departure_airport, :prefix=>true, :allow_nil=>true
|
634
|
-
delegate :state_abbreviation, :to => :arrival_airport, :prefix=>true, :allow_nil=>true
|
635
|
-
delegate :state_abbreviation, :to => :departure_airport, :prefix=>true, :allow_nil=>true
|
636
630
|
|
637
631
|
# Column views
|
638
632
|
column_view :dept_date_act_gmt, :date, :actual_departure_date_gmt
|
@@ -715,7 +709,9 @@ class TripLeg < Sequel::Model(:'trip legs')
|
|
715
709
|
def sic_crew; pilot_crew(:sic); end
|
716
710
|
|
717
711
|
def ebt_time
|
718
|
-
|
712
|
+
# subtracting the two datetimes yields a fraction of a day, so multiplying by minutes
|
713
|
+
# in day ( 1440 ) to get total minutes difference. assumes flights not more than 24 hours.
|
714
|
+
minutes_between = (planned_arrival_date_time_gmt - planned_departure_date_time_gmt) * 1440;
|
719
715
|
Time.from_minutes(minutes_between)
|
720
716
|
end
|
721
717
|
|
@@ -725,19 +721,19 @@ class TripLeg < Sequel::Model(:'trip legs')
|
|
725
721
|
# icao's that you make are valid icao codes, but you can't search the airport based it, since these
|
726
722
|
# airport rows don't have an icao code at all, they only have the prefix and airport_id. whacky.
|
727
723
|
def departure_icao_val
|
728
|
-
departure_icao
|
724
|
+
departure_icao.blank? ? depart_ap_prefix + depart_airport_id : ''
|
729
725
|
end
|
730
726
|
|
731
727
|
# same comment as above
|
732
728
|
def arrival_icao_val
|
733
|
-
arrival_icao
|
729
|
+
arrival_icao.blank? ? arrival_ap_prefix + arrival_airport_id : ''
|
734
730
|
end
|
735
731
|
|
736
732
|
def departure_icao_expanded
|
737
|
-
"#{departure_icao_val} #{
|
733
|
+
"#{departure_icao_val} #{departure_airport__name} #{departure_airport__city} ,#{departure_airport__state_abbreviation}"
|
738
734
|
end
|
739
|
-
|
735
|
+
|
740
736
|
def arrival_icao_expanded
|
741
|
-
"#{arrival_icao_val} #{
|
737
|
+
"#{arrival_icao_val} #{arrival_airport__name} #{arrival_airport__city} ,#{arrival_airport__state_abbreviation}"
|
742
738
|
end
|
743
739
|
end
|
@@ -5,6 +5,13 @@ describe TripLeg do
|
|
5
5
|
before do
|
6
6
|
end
|
7
7
|
|
8
|
+
it "ebt_time method produces correct Time with minutes" do
|
9
|
+
dept_date_act_gmt = Date.new(2000,1,1)
|
10
|
+
tl = TripLeg.new(:arrival_date_gmt=>dept_date_act_gmt.to_fos_days, :eta_gmt=>40,
|
11
|
+
:dept_date_gmt=>dept_date_act_gmt.to_fos_days, :etd_gmt=>20)
|
12
|
+
tl.ebt_time.should == Time.from_minutes(20)
|
13
|
+
end
|
14
|
+
|
8
15
|
it "actual take off date_time dates are after dept_date_act_gmt if take off time is less than depart time" do
|
9
16
|
dept_date_act_gmt = Date.new(1900,1,1)
|
10
17
|
tl = TripLeg.new(:dept_date_act_gmt=>dept_date_act_gmt.to_fos_days,:t_o_time_act_gmt=>20,:dept_time_act_gmt=>1420)
|
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.
|
4
|
+
version: 0.3.31
|
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-
|
12
|
+
date: 2010-03-23 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|