fossil 0.4.18 → 0.4.19

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.18
1
+ 0.4.19
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.18"
8
+ s.version = "0.4.19"
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-09-13}
12
+ s.date = %q{2010-09-22}
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 = [
@@ -118,6 +118,7 @@ Gem::Specification.new do |s|
118
118
  "lib/models/visa.rb",
119
119
  "lib/number_helper.rb",
120
120
  "lib/sequel/code_group.rb",
121
+ "lib/sequel/core_patch.rb",
121
122
  "lib/sequel/fos_dates.rb",
122
123
  "lib/sequel/metaprogramming.rb",
123
124
  "lib/sequel/model_patch.rb",
@@ -138,6 +139,7 @@ Gem::Specification.new do |s|
138
139
  "spec/models/trip_leg_spec.rb",
139
140
  "spec/models/trip_spec.rb",
140
141
  "spec/models/vendor_document_spec.rb",
142
+ "spec/sequel/core_patch_spec.rb",
141
143
  "spec/sequel/fos_dates_spec.rb",
142
144
  "spec/sequel/model_patch_spec.rb",
143
145
  "spec/sequel/pervasive_adapter_spec.rb",
@@ -159,6 +161,7 @@ Gem::Specification.new do |s|
159
161
  "spec/be_model_with_values_matcher_spec.rb",
160
162
  "spec/sequel/model_patch_spec.rb",
161
163
  "spec/sequel/fos_dates_spec.rb",
164
+ "spec/sequel/core_patch_spec.rb",
162
165
  "spec/sequel/spec_helper_tables.rb",
163
166
  "spec/sequel/serializer/json_serializer_spec.rb",
164
167
  "spec/sequel/serializer/xml_serializer_spec.rb",
@@ -0,0 +1,15 @@
1
+ module Sequel
2
+
3
+ class << self
4
+ def fos(odbc_name,opts={})
5
+ db = Sequel.odbc(odbc_name,opts)
6
+ db.extend(Sequel::Pervasive::DatabaseMethods)
7
+ db
8
+ end
9
+
10
+ # sets the db to all sequel models
11
+ def set_db(db)
12
+ Sequel::Model.find_children.each { |klass| klass.to_s.constantize.db=db }
13
+ end
14
+ end
15
+ end
@@ -5,6 +5,14 @@ class Sequel::Model
5
5
  self.use_transactions=false
6
6
  plugin :validation_helpers
7
7
 
8
+ def self.find_children
9
+ Module.constants.find_all do |c_klass|
10
+ if c_klass!=c_klass.upcase
11
+ self > (Object.const_get c_klass) rescue nil
12
+ end
13
+ end
14
+ end
15
+
8
16
  # Passing in an array of attribute / method names, fills a hash with values from
9
17
  # the model. Can pass in attributes with __ like :passenger__name and the 'name'
10
18
  # value will be delegated to 'passenger' with the delegator being created on the fly.
@@ -0,0 +1,27 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Sequel do
4
+
5
+ describe "has method 'fos' that" do
6
+ before :all do
7
+ @db = Sequel.fos('fos')
8
+ end
9
+
10
+ it "instantiate a fos/pervasive db from an odbc name" do
11
+ @db.should_not be nil
12
+ end
13
+
14
+ it "actually works to see a fos table" do
15
+ TripLeg.db=@db
16
+ TripLeg.first.should_not be nil
17
+ end
18
+ end
19
+
20
+ it "set_db method finds sets db on all Sequel models" do
21
+ db = Sequel.fos('fos')
22
+ Sequel.set_db db
23
+ Trip.db.should == db
24
+ end
25
+
26
+ end
27
+
@@ -3,6 +3,10 @@ require File.dirname(__FILE__) + '/spec_helper_tables' unless metaclass.class_va
3
3
 
4
4
  describe "Sequel::Model extentions" do
5
5
 
6
+ it "find_children method finds find Sequel::Models" do
7
+ Sequel::Model.find_children # should not blow up
8
+ end
9
+
6
10
  describe "fill_hash method" do
7
11
 
8
12
  it "works with attributes as array" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 18
9
- version: 0.4.18
8
+ - 19
9
+ version: 0.4.19
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-09-13 00:00:00 -07:00
17
+ date: 2010-09-22 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -171,6 +171,7 @@ files:
171
171
  - lib/models/visa.rb
172
172
  - lib/number_helper.rb
173
173
  - lib/sequel/code_group.rb
174
+ - lib/sequel/core_patch.rb
174
175
  - lib/sequel/fos_dates.rb
175
176
  - lib/sequel/metaprogramming.rb
176
177
  - lib/sequel/model_patch.rb
@@ -191,6 +192,7 @@ files:
191
192
  - spec/models/trip_leg_spec.rb
192
193
  - spec/models/trip_spec.rb
193
194
  - spec/models/vendor_document_spec.rb
195
+ - spec/sequel/core_patch_spec.rb
194
196
  - spec/sequel/fos_dates_spec.rb
195
197
  - spec/sequel/model_patch_spec.rb
196
198
  - spec/sequel/pervasive_adapter_spec.rb
@@ -236,6 +238,7 @@ test_files:
236
238
  - spec/be_model_with_values_matcher_spec.rb
237
239
  - spec/sequel/model_patch_spec.rb
238
240
  - spec/sequel/fos_dates_spec.rb
241
+ - spec/sequel/core_patch_spec.rb
239
242
  - spec/sequel/spec_helper_tables.rb
240
243
  - spec/sequel/serializer/json_serializer_spec.rb
241
244
  - spec/sequel/serializer/xml_serializer_spec.rb