cubicle 0.1.29 → 0.1.30
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/CHANGELOG.rdoc +125 -122
- data/cubicle.gemspec +2 -2
- data/lib/cubicle/duration.rb +52 -51
- data/lib/cubicle/version.rb +2 -2
- data/test/cubicle/duration_test.rb +4 -2
- data/test/cubicles/defect_cubicle.rb +57 -56
- data/test/log/test.log +6874 -0
- data/test/models/defect.rb +105 -103
- metadata +4 -4
data/test/models/defect.rb
CHANGED
@@ -1,104 +1,106 @@
|
|
1
|
-
class Defect
|
2
|
-
#include MongoMapper::Document
|
3
|
-
|
4
|
-
#key :defect_id, String
|
5
|
-
#key :manufacture_date, String
|
6
|
-
#key :manufacture_time, Time
|
7
|
-
#key :product, Product
|
8
|
-
#key :plant, Plant
|
9
|
-
#key :operator, String
|
10
|
-
#key :outcome, String
|
11
|
-
#key :cost, Float
|
12
|
-
#key :root_cause, String
|
13
|
-
|
14
|
-
def self.collection
|
15
|
-
Cubicle.mongo.database["defects"]
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.create(attributes)
|
19
|
-
self.collection.insert(attributes)
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.create_duration_test_data
|
23
|
-
time = "1/1/2000".to_time
|
24
|
-
t1,t2,t3 = time,time.advance(:days=>1),time.advance(:days=>3)
|
25
|
-
Defect.create :defect_id=>"1",
|
26
|
-
:manufacture_date=>"2010-01-01",
|
27
|
-
:manufacture_time=>"2010-01-01".to_time,
|
28
|
-
:product=>{:name=>"Sad Day Moonshine",:category=>"Alcohol"},
|
29
|
-
:plant=>{:name=>"Plant1",:address=>{:region=>"West",:location=>"San Francisco, Ca"}},
|
30
|
-
:operator=>"a",
|
31
|
-
:outcome=>"Repaired",
|
32
|
-
:cost=>0.78,
|
33
|
-
:root_cause=>:act_of_god,
|
34
|
-
:ms1=>t1,
|
35
|
-
:ms2=>t2,
|
36
|
-
:ms3=>t3
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
47
|
-
:
|
48
|
-
:
|
49
|
-
:
|
50
|
-
:
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
:
|
58
|
-
:
|
59
|
-
:
|
60
|
-
:
|
61
|
-
:
|
62
|
-
:
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
:
|
68
|
-
:
|
69
|
-
:
|
70
|
-
:
|
71
|
-
:
|
72
|
-
:
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
:
|
78
|
-
:
|
79
|
-
:
|
80
|
-
:
|
81
|
-
:
|
82
|
-
:
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
:
|
88
|
-
:
|
89
|
-
:
|
90
|
-
:
|
91
|
-
:
|
92
|
-
:
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
:
|
98
|
-
:
|
99
|
-
:
|
100
|
-
:
|
101
|
-
:
|
102
|
-
:
|
103
|
-
|
1
|
+
class Defect
|
2
|
+
#include MongoMapper::Document
|
3
|
+
|
4
|
+
#key :defect_id, String
|
5
|
+
#key :manufacture_date, String
|
6
|
+
#key :manufacture_time, Time
|
7
|
+
#key :product, Product
|
8
|
+
#key :plant, Plant
|
9
|
+
#key :operator, String
|
10
|
+
#key :outcome, String
|
11
|
+
#key :cost, Float
|
12
|
+
#key :root_cause, String
|
13
|
+
|
14
|
+
def self.collection
|
15
|
+
Cubicle.mongo.database["defects"]
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.create(attributes)
|
19
|
+
self.collection.insert(attributes)
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.create_duration_test_data
|
23
|
+
time = "1/1/2000".to_time
|
24
|
+
t1,t2,t3,t4 = time,time.advance(:days=>1),time.advance(:days=>3),time.advance(:days=>22)
|
25
|
+
Defect.create :defect_id=>"1",
|
26
|
+
:manufacture_date=>"2010-01-01",
|
27
|
+
:manufacture_time=>"2010-01-01".to_time,
|
28
|
+
:product=>{:name=>"Sad Day Moonshine",:category=>"Alcohol"},
|
29
|
+
:plant=>{:name=>"Plant1",:address=>{:region=>"West",:location=>"San Francisco, Ca"}},
|
30
|
+
:operator=>"a",
|
31
|
+
:outcome=>"Repaired",
|
32
|
+
:cost=>0.78,
|
33
|
+
:root_cause=>:act_of_god,
|
34
|
+
:ms1=>t1,
|
35
|
+
:ms2=>t2,
|
36
|
+
:ms3=>t3,
|
37
|
+
:ms4=>t4
|
38
|
+
|
39
|
+
t1,t2,t3,t4 = time, time.advance(:days=>2),time.advance(:days=>4),time.advance(:days=>28)
|
40
|
+
Defect.create :defect_id=>"2",
|
41
|
+
:manufacture_date=>"2010-01-01",
|
42
|
+
:manufacture_time=>"2010-01-01".to_time,
|
43
|
+
:product=>{:name=>"Sad Day Moonshine",:category=>"Alcohol"},
|
44
|
+
:plant=>{:name=>"Plant1",:address=>{:region=>"West",:location=>"San Francisco, Ca"}},
|
45
|
+
:operator=>"b",
|
46
|
+
:outcome=>"Repaired",
|
47
|
+
:cost=>0.78,
|
48
|
+
:root_cause=>:act_of_god,
|
49
|
+
:ms1=>t1,
|
50
|
+
:ms2=>t2,
|
51
|
+
:ms3=>t3,
|
52
|
+
:ms4=>t4
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.create_test_data
|
56
|
+
Defect.create :defect_id=>"1",
|
57
|
+
:manufacture_date=>"2010-01-01",
|
58
|
+
:manufacture_time=>"2010-01-01".to_time,
|
59
|
+
:product=>{:name=>"Sad Day Moonshine",:category=>"Alcohol"},
|
60
|
+
:plant=>{:name=>"Plant1",:address=>{:region=>"West",:location=>"San Francisco, Ca"}},
|
61
|
+
:operator=>"Franny",
|
62
|
+
:outcome=>"Repaired",
|
63
|
+
:cost=>6.50,
|
64
|
+
:root_cause=>:act_of_god
|
65
|
+
|
66
|
+
Defect.create :defect_id=>"2",
|
67
|
+
:manufacture_date=>"2010-01-05",
|
68
|
+
:manufacture_time=>"2010-01-05".to_time,
|
69
|
+
:product=>{:name=>"Evil's Pickling Spice",:category=>"Baking"},
|
70
|
+
:plant=>{:name=>"Plant2",:address=>{:region=>"Midwest",:location=>"Des Moines, Ia"}},
|
71
|
+
:operator=>"Seymour",
|
72
|
+
:outcome=>"Discarded",
|
73
|
+
:cost=>0.02,
|
74
|
+
:root_cause=>:operator_error
|
75
|
+
|
76
|
+
Defect.create :defect_id=>"3",
|
77
|
+
:manufacture_date=>"2010-02-01",
|
78
|
+
:manufacture_time=>"2010-02-01".to_time,
|
79
|
+
:product=>{:name=>"Sad Day Moonshine",:category=>"Alcohol"},
|
80
|
+
:plant=>{:name=>"Plant1",:address=>{:region=>"West",:location=>"San Francisco, Ca"}},
|
81
|
+
:operator=>"Zooey",
|
82
|
+
:outcome=>"Consumed",
|
83
|
+
:cost=>2.94,
|
84
|
+
:root_cause=>:poor_judgment
|
85
|
+
|
86
|
+
Defect.create :defect_id=>"4",
|
87
|
+
:manufacture_date=>"2009-12-09",
|
88
|
+
:manufacture_time=>"2009-12-09".to_time,
|
89
|
+
:product=>{:name=>"Brush Fire Bottle Rockets",:category=>"Fireworks"},
|
90
|
+
:plant=>{:name=>"Plant19",:address=>{:region=>"South",:location=>"Burmingham, Al"}},
|
91
|
+
:operator=>"Buddy",
|
92
|
+
:outcome=>"Repaired",
|
93
|
+
:cost=>0.43,
|
94
|
+
:root_cause=>:act_of_god
|
95
|
+
|
96
|
+
Defect.create :defect_id=>"5",
|
97
|
+
:manufacture_date=>"2010-01-01",
|
98
|
+
:manufacture_time=>"2010-01-01".to_time,
|
99
|
+
:product=>{:name=>"Sad Day Moonshine",:category=>"Alcohol"},
|
100
|
+
:plant=>{:name=>"Plant3",:address=>{:region=>"West",:location=>"Oakland, Ca"}},
|
101
|
+
:operator=>"Franny",
|
102
|
+
:outcome=>"Repaired",
|
103
|
+
:cost=>12.19,
|
104
|
+
:root_cause=>:defective_materials
|
105
|
+
end
|
104
106
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cubicle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 39
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 30
|
10
|
+
version: 0.1.30
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nathan Stults
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-07 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|