fossil 0.5.29 → 0.5.30
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/fossil.gemspec +5 -3
- data/lib/fossil_dbr.rb +1 -0
- data/lib/models/aircraft.rb +1 -0
- data/spec/sequel/core_patch_spec.rb +10 -25
- data/spec/silly_spec.rb +20 -8
- data/spec/spec_helper.rb +0 -2
- data/spec_dbr/sequel/core_patch_spec.rb +21 -0
- data/spec_dbr/spec_helper.rb +6 -0
- metadata +5 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.30
|
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.5.
|
8
|
+
s.version = "0.5.30"
|
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{2011-
|
12
|
+
s.date = %q{2011-03-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 = [
|
@@ -158,7 +158,9 @@ Gem::Specification.new do |s|
|
|
158
158
|
"spec/sequel/serializer/json_serializer_with_active_support_spec.rb",
|
159
159
|
"spec/sequel/serializer/xml_serializer_spec.rb",
|
160
160
|
"spec/sequel/spec_helper_tables.rb",
|
161
|
-
"spec/spec_helper.rb"
|
161
|
+
"spec/spec_helper.rb",
|
162
|
+
"spec_dbr/sequel/core_patch_spec.rb",
|
163
|
+
"spec_dbr/spec_helper.rb"
|
162
164
|
]
|
163
165
|
s.homepage = %q{}
|
164
166
|
s.rdoc_options = ["--charset=UTF-8"]
|
data/lib/fossil_dbr.rb
CHANGED
data/lib/models/aircraft.rb
CHANGED
@@ -5,6 +5,7 @@ class Aircraft < Sequel::Model(:'aircraft')
|
|
5
5
|
# One to many to one associations with atomic primary keys
|
6
6
|
one_to_many :trips, :class=>:Trip, :key=>:'aircraft id', :primary_key=>:'aircraft id'
|
7
7
|
one_to_many :trip_legs, :class=>:TripLeg, :key=>:'aircraft id', :primary_key=>:'aircraft id'
|
8
|
+
n_to_o :owner, :class=>:Passenger, :prefix=>'owner'
|
8
9
|
|
9
10
|
code_association :company_value, :'company code', :company
|
10
11
|
code_association :base_code_value, :base_code, :location
|
@@ -2,6 +2,16 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
2
|
|
3
3
|
describe Sequel do
|
4
4
|
|
5
|
+
it "set_db method finds sets db on all Sequel models" do
|
6
|
+
db = Sequel.fos('fos')
|
7
|
+
Sequel.set_db db
|
8
|
+
Trip.db.should == db
|
9
|
+
end
|
10
|
+
|
11
|
+
it "converts fos_id to key that can be used to query model" do
|
12
|
+
Sequel.fos_id_to_lookup_key("MERE-0-8-40443-1259").should == ['MERE',0,8,40443,1259]
|
13
|
+
end
|
14
|
+
|
5
15
|
describe "has method 'fos' that" do
|
6
16
|
before :each do
|
7
17
|
@db = Sequel.fos('fos')
|
@@ -17,30 +27,5 @@ describe Sequel do
|
|
17
27
|
end
|
18
28
|
end
|
19
29
|
|
20
|
-
# describe "has method 'fos_dbr' that" do
|
21
|
-
# before :each do
|
22
|
-
# hash = {:host=>"localhost", :user=>'root', :password=>'', :database=>'test'}
|
23
|
-
# @db = Sequel.fos_dbr(hash)
|
24
|
-
# end
|
25
|
-
#
|
26
|
-
# it "instantiates dbr/mysql db from hash of params name" do
|
27
|
-
# @db.should_not be nil
|
28
|
-
# end
|
29
|
-
#
|
30
|
-
# it "actually loaded the dbr files" do
|
31
|
-
# [Trip,Quote].each{|model| model.db=@db}
|
32
|
-
# Trip.eager_graph(:quote).sql.should =~ /(`quote`.`id` = `trips`.`quote_id`)/
|
33
|
-
# end
|
34
|
-
# end
|
35
|
-
|
36
|
-
# it "set_db method finds sets db on all Sequel models" do
|
37
|
-
# db = Sequel.fos('fos')
|
38
|
-
# Sequel.set_db db
|
39
|
-
# Trip.db.should == db
|
40
|
-
# end
|
41
|
-
|
42
|
-
it "converts fos_id to key that can be used to query model" do
|
43
|
-
Sequel.fos_id_to_lookup_key("MERE-0-8-40443-1259").should == ['MERE',0,8,40443,1259]
|
44
|
-
end
|
45
30
|
end
|
46
31
|
|
data/spec/silly_spec.rb
CHANGED
@@ -2,19 +2,31 @@ require_relative '../lib/fossil'
|
|
2
2
|
require 'logger'
|
3
3
|
require 'pp'
|
4
4
|
|
5
|
-
# 800 557-9965
|
6
|
-
# 0279507735
|
7
|
-
|
8
5
|
#DB = Sequel.fos('fosprod', :loggers=>[Logger.new($stdout)])
|
9
|
-
|
10
|
-
|
6
|
+
DB = Sequel.fos('flyos')#, :loggers=>[Logger.new($stdout)])
|
7
|
+
[Trip, TripLeg, Aircraft].each {|model| model.db = DB}
|
8
|
+
|
9
|
+
p [TripLeg.min(:dept_date_gmt),TripLeg.max(:dept_date_gmt)]
|
10
|
+
p [Date.from_fos_days(TripLeg.min(:dept_date_gmt)).to_s,Date.from_fos_days(TripLeg.max(:dept_date_gmt)).to_s]
|
11
|
+
|
12
|
+
#p TripLeg.filter(:)
|
13
|
+
#p Passenger.filter(:kid_date=>38439, :kid_time=>1428, :kid_comm=>1, :kid_mult=>0).first
|
14
|
+
#p Aircraft.filter(:kid_date=>39722).first.owner_name
|
15
|
+
#p Aircraft.select(:kid_date,:owner_kid_date,:owner_kid_time).all.collect{|c| [c.kid_date,c.owner_kid_date,c.owner_kid_time] }
|
16
|
+
#p Aircraft.select(:kid_date,:owner_name,:owner_kid_user,:owner_kid_comm,:owner_kid_mult,:owner_kid_date,:owner_kid_time).filter(~:owner_kid_date=>0).all.collect{|c| [c.kid_date,c.owner_name,c.owner_kid_user,c.owner_kid_comm,c.owner_kid_mult,c.owner_kid_date,c.owner_kid_time] }
|
17
|
+
#p Aircraft.select(:owner_name).all.collect(&:owner_name).uniq.sort
|
18
|
+
|
19
|
+
#Aircraft.first.owner
|
20
|
+
#p TripLeg.filter{flight_time_actual > 0 }.first.aft_time_view
|
21
|
+
|
11
22
|
#p TripLeg.select(:cancel_code).distinct(:cancel_code)
|
12
23
|
#p TripLeg.filter{ cancel_code >1 }.count
|
13
24
|
|
14
|
-
|
15
|
-
|
16
|
-
|
25
|
+
p TripLeg.first(:trip_number=>98,:leg_number=>3).fill_hash(
|
26
|
+
[:kid_date,:planned_departure_date_time_gmt]
|
27
|
+
)
|
17
28
|
|
29
|
+
#p QuoteLeg.filter{kid_date > (Date.today-30)}.filter{block_time_actual > 0}.first.confirmation_number
|
18
30
|
#p t.actual_departure_date_time_gmt.to_time
|
19
31
|
#p t.actual_departure_date_time_gmt.to_time.utc
|
20
32
|
#pp t.fill_hash(
|
data/spec/spec_helper.rb
CHANGED
@@ -20,8 +20,6 @@ require File.dirname(__FILE__) + "/helper_classes"
|
|
20
20
|
require File.dirname(__FILE__) + "/be_model_with_values_matcher"
|
21
21
|
|
22
22
|
RSpec.configure do |config|
|
23
|
-
config.mock_with :rr
|
24
|
-
|
25
23
|
config.include(HelperMethods)
|
26
24
|
config.mock_with :rr
|
27
25
|
config.include(BeModelWithValuesMatcher)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
describe Sequel do
|
4
|
+
|
5
|
+
describe "has method 'fos_dbr' that" do
|
6
|
+
before :each do
|
7
|
+
hash = {:host=>"localhost", :user=>'root', :password=>'', :database=>'test'}
|
8
|
+
@db = Sequel.fos_dbr(hash)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "instantiates dbr/mysql db from hash of params name" do
|
12
|
+
@db.should_not be nil
|
13
|
+
end
|
14
|
+
|
15
|
+
it "actually loaded the dbr files" do
|
16
|
+
[Trip, Quote].each { |model| model.db=@db }
|
17
|
+
Trip.eager_graph(:quote).sql.should =~ /(`quote`.`id` = `trips`.`quote_id`)/
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 30
|
9
|
+
version: 0.5.30
|
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: 2011-
|
17
|
+
date: 2011-03-08 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -210,6 +210,8 @@ files:
|
|
210
210
|
- spec/sequel/serializer/xml_serializer_spec.rb
|
211
211
|
- spec/sequel/spec_helper_tables.rb
|
212
212
|
- spec/spec_helper.rb
|
213
|
+
- spec_dbr/sequel/core_patch_spec.rb
|
214
|
+
- spec_dbr/spec_helper.rb
|
213
215
|
- spec/silly_spec.rb
|
214
216
|
has_rdoc: true
|
215
217
|
homepage: ""
|