fossil 0.3.15 → 0.3.16
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 +4 -2
- data/lib/models/vendor_document.rb +13 -7
- data/spec/be_model_with_values_matcher_spec.rb +3 -3
- data/spec/models/vendor_document_spec.rb +18 -0
- metadata +4 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.16
|
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.16"
|
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
|
+
s.date = %q{2010-03-07}
|
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 = [
|
@@ -132,6 +132,7 @@ Gem::Specification.new do |s|
|
|
132
132
|
"spec/helper_methods.rb",
|
133
133
|
"spec/models/code_spec.rb",
|
134
134
|
"spec/models/trip_spec.rb",
|
135
|
+
"spec/models/vendor_document_spec.rb",
|
135
136
|
"spec/sequel/fos_dates_spec.rb",
|
136
137
|
"spec/sequel/model_patch_spec.rb",
|
137
138
|
"spec/sequel/pervasive_adapter_spec.rb",
|
@@ -154,6 +155,7 @@ Gem::Specification.new do |s|
|
|
154
155
|
"spec/helper_methods.rb",
|
155
156
|
"spec/models/code_spec.rb",
|
156
157
|
"spec/models/trip_spec.rb",
|
158
|
+
"spec/models/vendor_document_spec.rb",
|
157
159
|
"spec/sequel/fos_dates_spec.rb",
|
158
160
|
"spec/sequel/model_patch_spec.rb",
|
159
161
|
"spec/sequel/pervasive_adapter_spec.rb",
|
@@ -1,9 +1,11 @@
|
|
1
1
|
class VendorDocument < Sequel::Model(:'vendor documents')
|
2
2
|
# helper accessors for creating vendor document
|
3
3
|
# filename_prefix helps set up the path to the document
|
4
|
-
attr_accessor :doc_type_value, :doc_filename_prefix, :
|
5
|
-
|
6
|
-
|
4
|
+
attr_accessor :doc_type_value, :doc_filename_prefix, :doc_type, :doc_filename
|
5
|
+
|
6
|
+
###### helper aliases for crewres to submit new vendor documents #########
|
7
|
+
column_alias :trip_number, :number, :type => :integer
|
8
|
+
column_alias :description, :name
|
7
9
|
|
8
10
|
# Developpers must have the ability to set the PK programmatically
|
9
11
|
unrestrict_primary_key
|
@@ -26,10 +28,17 @@ class VendorDocument < Sequel::Model(:'vendor documents')
|
|
26
28
|
self.kid_date=Date.today.to_fos_days
|
27
29
|
self.kid_time=Time.now.as_minutes
|
28
30
|
self.kid_comm=0
|
29
|
-
self.kid_mult=
|
31
|
+
self.kid_mult=serial_value
|
30
32
|
self.kid_user="ADMN"
|
31
33
|
end
|
32
34
|
|
35
|
+
@@kid_mult_index = -1
|
36
|
+
def serial_value
|
37
|
+
@@kid_mult_index = -1 if @@kid_mult_index == 255
|
38
|
+
@@kid_mult_index += 1
|
39
|
+
@@kid_mult_index
|
40
|
+
end
|
41
|
+
|
33
42
|
def set_other_vars
|
34
43
|
self.doc_date =
|
35
44
|
case doc_date
|
@@ -49,9 +58,6 @@ class VendorDocument < Sequel::Model(:'vendor documents')
|
|
49
58
|
self.document_type= doc_type_value if Code.valid_value_for_group?(doc_type_value, :aircraft_document)
|
50
59
|
end
|
51
60
|
|
52
|
-
###### helper aliases for crewres to submit new vendor documents #########
|
53
|
-
column_alias :trip_number, :number, :type => :integer
|
54
|
-
column_alias :description, :name
|
55
61
|
|
56
62
|
#### BEGIN GENERATED SECTION ####
|
57
63
|
set_primary_key [:'kid - user', :'kid - mult', :'kid - comm', :'kid - date', :'kid - time']
|
@@ -24,7 +24,7 @@ describe "spec matchers" do
|
|
24
24
|
begin
|
25
25
|
dude.should be_model_with_values( {:kid_date=>1, :kid_time=>2} )
|
26
26
|
rescue => e
|
27
|
-
e.message.should match("unequal values: \nexpected: \\{
|
27
|
+
e.message.should match("unequal values: \nexpected: \\{\"kid_time\"=>2\\} \n but got:\n\\{\"kid_time\"=>\"2\"\\}")
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -33,7 +33,7 @@ describe "spec matchers" do
|
|
33
33
|
begin
|
34
34
|
dude.should be_model_with_values( {:kid_date=>1, :kid_time=>2} )
|
35
35
|
rescue => e
|
36
|
-
e.message.should match("missing keys: \\[
|
36
|
+
e.message.should match("missing keys: \\[\"kid_time\"\\]")
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -42,7 +42,7 @@ describe "spec matchers" do
|
|
42
42
|
begin
|
43
43
|
dude.should be_model_with_values( {:kid_date=>1, :kid_time=>2} )
|
44
44
|
rescue => e
|
45
|
-
e.message.should match("unequal values: \nexpected: \\{
|
45
|
+
e.message.should match("unequal values: \nexpected: \\{\"kid_time\"=>2\\} \n but got:\n\\{\"kid_time\"=>3\\}")
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe "VendorDocument" do
|
4
|
+
|
5
|
+
before do
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should rotate kid_mult from 0-255" do
|
9
|
+
stub(VendorDocument).set_other_vars {}
|
10
|
+
arr = []
|
11
|
+
0.upto(256) do |n|
|
12
|
+
arr << VendorDocument.new.kid_mult
|
13
|
+
end
|
14
|
+
arr.should == (0..255).to_a << 0
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
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.16
|
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-
|
12
|
+
date: 2010-03-07 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- spec/helper_methods.rb
|
171
171
|
- spec/models/code_spec.rb
|
172
172
|
- spec/models/trip_spec.rb
|
173
|
+
- spec/models/vendor_document_spec.rb
|
173
174
|
- spec/sequel/fos_dates_spec.rb
|
174
175
|
- spec/sequel/model_patch_spec.rb
|
175
176
|
- spec/sequel/pervasive_adapter_spec.rb
|
@@ -214,6 +215,7 @@ test_files:
|
|
214
215
|
- spec/helper_methods.rb
|
215
216
|
- spec/models/code_spec.rb
|
216
217
|
- spec/models/trip_spec.rb
|
218
|
+
- spec/models/vendor_document_spec.rb
|
217
219
|
- spec/sequel/fos_dates_spec.rb
|
218
220
|
- spec/sequel/model_patch_spec.rb
|
219
221
|
- spec/sequel/pervasive_adapter_spec.rb
|