purchase 1.0.0 → 1.0.1

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.
@@ -133,25 +133,26 @@ Feature: Purchase Committee Calculations
133
133
  Scenario Outline: Sector shares committee from industry and product line shares
134
134
  Given a purchase emitter
135
135
  And a characteristic "merchant_category.mcc" of "<mcc>"
136
+ And a characteristic "adjusted_cost" of "1"
136
137
  When the "merchant_categories_industries" committee is calculated
137
138
  And the "industry_shares" committee is calculated
138
139
  And the "product_line_shares" committee is calculated
139
140
  And the "industries_sectors" committee is calculated
140
141
  And the "sector_shares" committee is calculated
141
- Then the conclusion of the committee should be a vector with values "<26>,<A>,<B>,<C>,<D>"
142
+ Then the conclusion of the committee should be a vector with values "<1>,<10>,<11>,<12>,<13>,<14>,<15>,<16>,<17>,<18>,<19>,<2>,<20>,<21>,<22>,<23>,<24>,<25>,<26>,<3>,<4>,<44100>,<44102>,<44103>,<44104>,<44105>,<5>,<6>,<7>,<8>,<9>,<A>,<B>,<C>,<D>"
142
143
  Examples:
143
- |mcc | 26 | A | B | C | D |
144
- |5218| 1.0 | 0 | 0 | 0 | 0 |
145
- |9999| 0 | 0.5625| 0.3125| 0.0625| 0.0625|
144
+ | mcc|1|10|11|12|13|14|15|16|17|18|19|2|20|21|22|23|24|25| 26|3|4|44100|44102|44103|44104|44105|5|6|7|8|9| A| B| C| D|
145
+ |5812|0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|0| 0| 0| 0| 0| 0| 0|1.0|0|0| 0| 0| 0| 0| 0|0|0|0|0|0| 0| 0| 0| 0|
146
+ |9999|0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|0| 0| 0| 0| 0| 0| 0| 0|0|0| 0| 0| 0| 0| 0|0|0|0|0|0|0.1875|0.1875|0.0625|0.0625|
146
147
 
147
148
  Scenario: Sector direct requirements
148
149
  Given a purchase emitter
149
150
  When the "sector_direct_requirements" committee is calculated
150
- Then the conclusion of the committee should be a square matrix with "32" rows and columns
151
+ Then the conclusion of the committee should be a square matrix with "35" rows and columns
151
152
 
152
- Scenario Outline: Economic flows from merchant category
153
+ Scenario: Economic flows from merchant category
153
154
  Given a purchase emitter
154
- And a characteristic "merchant_category.mcc" of "<mcc>"
155
+ And a characteristic "merchant_category.mcc" of "5812"
155
156
  And a characteristic "date" of "2010-08-01"
156
157
  And a characteristic "cost" of "100"
157
158
  When the "adjusted_cost" committee is calculated
@@ -162,14 +163,7 @@ Feature: Purchase Committee Calculations
162
163
  And the "sector_shares" committee is calculated
163
164
  And the "sector_direct_requirements" committee is calculated
164
165
  And the "economic_flows" committee is calculated
165
- Then the conclusion of the committee should be a vector with values "<1>,<2>,<3>,<4>,<5>,<6>,<7>,<8>,<9>,<10>,<11>,<12>,<13>,<14>,<15>,<16>,<17>,<18>,<19>,<20>,<21>,<22>,<23>,<24>,<25>,<26>,<44100>,<44101>,<44102>,<44103>,<44104>,<44105>"
166
- Examples:
167
- |mcc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20| 21| 22| 23| 24| 25| 26| 44100| 44101| 44102| 44103| 44104| 44105|
168
- |3504|192.42878|190.54222|245.14686|242.78968|295.60384|292.81512|346.78566|404.30912|400.59986|465.29127|528.62004|482.35635|466.74323|468.52286|501.11032|468.42401|424.06313|393.05155|506.82714|413.31948|408.00708|380.41657|307.66401|449.85893|372.82038|836.30767|931.90473|897.58914|713.25686|712.54645|62108.49751|64007.92880|
169
- |5111|217.60851|188.33439|240.23898|246.58722|289.15336|286.35133|338.69552|401.57566|392.30640|454.36248|510.67639|465.48678|453.29908|452.07535|479.07926|433.58397|390.81556|366.40189|414.39616|398.88015|410.43100|392.65385|319.38796|469.25412|389.47876|878.05118|979.36178|943.33243|749.79844|749.05163|65344.72371|67343.77541|
170
- |5172|183.87087|182.06822|234.24153|231.98921|282.45806|279.79336|331.44594|386.67305|383.12559|443.95827|505.08363|460.93482|446.66308|449.71238|471.64803|451.80455|409.65115|384.25908|428.91553|462.17754|412.89024|378.40441|304.83450|439.98234|360.24151|801.81579|892.45620|859.55691|682.82806|682.14796|59460.87972|61279.36469|
171
- |5732|183.11569|181.32043|231.15559|228.93294|278.83247|276.20197|324.59174|375.74672|372.29950|465.95439|483.12194|455.69859|419.53135|417.80920|435.45569|407.12840|367.62744|345.95575|392.16116|378.09709|388.34638|373.09854|303.76218|440.33643|377.80083|806.53673|894.12118|861.03177|683.26595|682.58541|59509.68769|61329.79292|
172
- |5812|171.55784|169.87590|218.54218|216.44081|263.51360|261.02763|309.15838|360.69762|357.38846|414.47227|471.13666|429.92363|416.23221|419.67110|442.44048|419.01368|379.60402|362.16497|413.97706|402.64335|419.92739|407.41210|332.40488|496.30587|413.33528|951.16340|982.78937|943.83794|734.26687|733.53553|64092.82756|66054.79463|
166
+ Then the conclusion of the committee should be a vector with "35" items
173
167
 
174
168
  Scenario Outline: Impacts committee from economic flows
175
169
  Given a purchase emitter
@@ -186,11 +180,11 @@ Feature: Purchase Committee Calculations
186
180
  And the "economic_flows" committee is calculated
187
181
  And the "impact_vectors" committee is calculated
188
182
  And the "impacts" committee is calculated
189
- Then the conclusion of the committee should be a vector with values "<1>,<2>,<3>,<4>,<5>,<6>,<7>,<8>,<9>,<10>,<11>,<12>,<13>,<14>,<15>,<16>,<17>,<18>,<19>,<20>,<21>,<22>,<23>,<24>,<25>,<26>,<44100>,<44101>,<44102>,<44103>,<44104>,<44105>"
183
+ Then the conclusion of the committee should be a vector with values "<1>,<10>,<11>,<12>,<13>,<14>,<15>,<16>,<17>,<18>,<19>,<2>,<20>,<21>,<22>,<23>,<24>,<25>,<26>,<3>,<4>,<44100>,<44102>,<44103>,<44104>,<44105>,<5>,<6>,<7>,<8>,<9>,<A>,<B>,<C>,<D>"
190
184
  Examples:
191
- |mcc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20| 21| 22| 23| 24| 25| 26| 44100| 44101| 44102| 44103| 44104| 44105|
192
- |3504|155.86731|104.03605|87.76257|291.34762|319.25215|182.42382|196.62746|114.82379|148.22195|168.43544|116.29640|264.81364|253.90832|250.65973|50.61214|114.76388|97.53452|73.10758|283.31637|826.63897|530.40921|342.37491|61.53280|539.83071|596.51261|669.04614|652.33331|89.75891|499.27980|855.05574|86951.89652|19202.37864|
193
- |5111|176.26289|102.83058|86.00555|295.90467|312.28563|178.39687|192.04036|114.04748|145.15336|164.47922|112.34880|255.55224|246.59470|241.86031|48.38700|106.22807|89.88757|68.15075|231.64745|797.76030|533.56031|353.38847|63.87759|563.10495|623.16602|702.44095|685.55325|94.33324|524.85891|898.86196|91482.61320|20203.13262|
194
- |5172|148.93540| 99.40924|83.85847|278.38705|305.05470|174.31126|187.92985|109.81514|141.75647|160.71289|111.11839|253.05321|242.98472|240.59612|47.63645|110.69211|94.21976|71.47218|239.76378|924.35508|536.75732|340.56397|60.96690|527.97880|576.38642|641.45263|624.71934|85.95569|477.97964|818.57755|83245.23160|18383.80940|
195
- |5732|148.32370| 99.00095|82.75370|274.71953|301.13906|172.07383|184.04352|106.71206|137.75081|168.67549|106.28682|250.17853|228.22505|223.52792|43.98102| 99.74646|84.55431|64.34777|219.21809|756.19418|504.85029|335.78869|60.75243|528.40372|604.48133|645.22938|625.88482|86.10317|478.28616|819.10249|83313.56277|18398.93787|
196
- |5812|138.96185| 92.75224|78.23810|259.72898|284.59469|162.62021|175.29280|102.43812|132.23373|150.03896|103.65006|236.02807|226.43032|224.52403|44.68648|102.65835|87.30892|67.36268|231.41317|805.28671|545.90561|366.67089|66.48097|595.56705|661.33645|760.93072|687.95256|94.38379|513.98681|880.24264|89729.95858|19816.43838|
185
+ | mcc|1|10|11|12|13|14|15|16|17|18|19|2|20|21|22|23|24|25| 26|3|4|44100|44102|44103|44104|44105|5|6|7|8|9| A| B| C| D|
186
+ |3504| 34.20759 | 22.83238 | 21.58704 | 71.66304 | 75.34399 | 43.05229 | 44.19605 | 24.59386 | 31.74734 | 34.23285 | 38.90812 | 50.97981 | 42.48382 | 38.68232 | 7.06766 | 14.44985 | 11.89899 | 7.95409 | 24.56535 | 75.44609 | 41.91640 | 21.38395 | 3.61236 | 20.87780 | 20.49698 | 5.33446 | 0.28203 | 2.65319 | 3.94288 | 4.60106 | 71.40280 | 24.44457 | 24.44457 | 24.56517 | 21.88041 |
187
+ |5111| 43.11882 | 14.80914 | 11.03291 | 36.54622 | 46.29633 | 26.17054 | 32.10542 | 13.52681 | 17.39109 | 19.28008 | 12.79735 | 29.46601 | 26.80161 | 25.34407 | 4.74774 | 9.84523 | 8.12740 | 5.76849 | 17.87935 | 55.05595 | 39.96103 | 15.46327 | 2.35871 | 13.67770 | 13.18761 | 4.14058 | 2.01647 | 4.80043 | 6.27992 | 12.36538 | 79.88824 | 27.42322 | 27.42322 | 27.48354 | 24.08718 |
188
+ |5172| 35.58872 | 23.75424 | 19.71380 | 65.44441 | 70.92181 | 40.52542 | 46.99530 | 26.65128 | 34.40320 | 37.53618 | 24.68486 | 55.96723 | 82.58029 | 48.39434 | 8.55823 | 16.05688 | 13.17485 | 7.93908 | 24.20801 | 72.40388 | 39.79780 | 20.18866 | 3.40454 | 19.65695 | 19.28569 | 4.97658 | 0.23634 | 2.57416 | 3.79738 | 4.40459 | 68.84678 | 23.57193 | 23.57193 | 23.68206 | 20.88125 |
189
+ |5732| 23.82496 | 38.07691 | 13.11535 | 67.43841 | 47.01503 | 26.86485 | 28.54448 | 16.48957 | 21.28581 | 23.75176 | 16.05288 | 36.48537 | 34.13793 | 33.78076 | 6.37445 | 13.50597 | 11.33464 | 10.34780 | 23.80141 | 71.08195 | 37.57537 | 19.56198 | 3.32479 | 19.24582 | 18.92542 | 4.96435 | 0.29751 | 2.39136 | 3.54334 | 4.20360 | 64.55618 | 22.09769 | 22.09769 | 22.17096 | 20.29572 |
190
+ |5812| 34.59232 | 23.08918 | 19.48251 | 64.67657 | 70.88026 | 40.50168 | 43.64568 | 25.42384 | 32.81874 | 37.49322 | 25.83877 | 58.82688 | 56.29772 | 54.71279 | 11.61328 | 25.17174 | 21.33815 | 14.31873 | 81.35713 | 123.84802 | 53.98569 | 22.37338 | 3.51343 | 20.06660 | 19.35014 | 4.96561 | 0.24528 | 2.52186 | 3.73916 | 4.34106 | 67.67328 | 23.16928 | 23.16928 | 23.27813 | 20.55662 |
@@ -4,29 +4,29 @@ Feature: Purchase Emissions Calculations
4
4
  Scenario: Calculations starting from nothing
5
5
  Given a purchase has nothing
6
6
  When emissions are calculated
7
- Then the emission value should be within "0.001" kgs of "120694.715"
7
+ Then the emission value should be within "0.001" kgs of "756.667"
8
8
 
9
9
  Scenario: Calculations starting from purchase amount
10
10
  Given a purchase has "purchase_amount" of "107.11"
11
11
  When emissions are calculated
12
- Then the emission value should be within "0.001" kgs of "120694.715"
12
+ Then the emission value should be within "0.001" kgs of "756.667"
13
13
 
14
14
  Scenario: Calculations starting from date
15
15
  Given a purchase has "date" of "2010-07-28"
16
16
  When emissions are calculated
17
- Then the emission value should be within "0.001" kgs of "120694.715"
17
+ Then the emission value should be within "0.001" kgs of "756.667"
18
18
 
19
19
  Scenario Outline: Calculations starting from a merchant
20
20
  Given a purchase has "merchant.id" of "<id>"
21
21
  When emissions are calculated
22
22
  Then the emission value should be within "0.001" kgs of "<emission>"
23
23
  Examples:
24
- | id | emission |
25
- | 1 | 120694.715|
26
- | 2 | 110152.836|
27
- | 3 | 118426.103|
28
- | 4 | 115090.859|
29
- | 5 | 110346.441|
24
+ | id | emission |
25
+ | 1 | 756.667 |
26
+ | 2 | 828.562 |
27
+ | 3 | 1158.876 |
28
+ | 4 | 1007.731 |
29
+ | 5 | 1034.378 |
30
30
 
31
31
  Scenario Outline: Calculations starting from a merchant with purchase amount
32
32
  Given a purchase has "merchant.id" of "<id>"
@@ -34,12 +34,12 @@ Feature: Purchase Emissions Calculations
34
34
  When emissions are calculated
35
35
  Then the emission value should be within "0.001" kgs of "<emission>"
36
36
  Examples:
37
- | id | amount | emission |
38
- | 1 | 107.11 | 120694.715|
39
- | 2 | 107.11 | 110152.836|
40
- | 3 | 107.11 | 118426.103|
41
- | 4 | 107.11 | 115090.859|
42
- | 5 | 107.11 | 110346.441|
37
+ | id | amount | emission |
38
+ | 1 | 107.11 | 756.667 |
39
+ | 2 | 107.11 | 828.562 |
40
+ | 3 | 107.11 | 1158.876 |
41
+ | 4 | 107.11 | 1007.731 |
42
+ | 5 | 107.11 | 1034.378 |
43
43
 
44
44
  Scenario Outline: Calculations starting from a merchant with purchase amount and date
45
45
  Given a purchase has "merchant.id" of "<id>"
@@ -48,12 +48,12 @@ Feature: Purchase Emissions Calculations
48
48
  When emissions are calculated
49
49
  Then the emission value should be within "0.001" kgs of "<emission>"
50
50
  Examples:
51
- | id | amount | date | emission |
52
- | 1 | 107.11 | 2010-07-28 | 120694.715|
53
- | 2 | 107.11 | 2010-07-28 | 110152.836|
54
- | 3 | 107.11 | 2010-07-28 | 118426.103|
55
- | 4 | 107.11 | 2010-07-28 | 115090.859|
56
- | 5 | 107.11 | 2010-07-28 | 110346.441|
51
+ | id | amount | date | emission |
52
+ | 1 | 107.11 | 2010-07-28 | 756.667 |
53
+ | 2 | 107.11 | 2010-07-28 | 828.562 |
54
+ | 3 | 107.11 | 2010-07-28 | 1158.876 |
55
+ | 4 | 107.11 | 2010-07-28 | 1007.731 |
56
+ | 5 | 107.11 | 2010-07-28 | 1034.378 |
57
57
 
58
58
  Scenario Outline: Calculations starting from a merchant with purchase amount, date, and tax
59
59
  Given a purchase has "merchant.id" of "<id>"
@@ -63,12 +63,12 @@ Feature: Purchase Emissions Calculations
63
63
  When emissions are calculated
64
64
  Then the emission value should be within "0.001" kgs of "<emission>"
65
65
  Examples:
66
- | id | amount | tax | date | emission |
67
- | 1 | 108.00 | 8.00 | 2010-07-28 | 120694.715|
68
- | 2 | 108.00 | 8.00 | 2010-07-28 | 110152.836|
69
- | 3 | 108.00 | 8.00 | 2010-07-28 | 118426.103|
70
- | 4 | 108.00 | 8.00 | 2010-07-28 | 115090.859|
71
- | 5 | 108.00 | 8.00 | 2010-07-28 | 110346.441|
66
+ | id | amount | tax | date | emission |
67
+ | 1 | 108.00 | 8.00 | 2010-07-28 | 756.667 |
68
+ | 2 | 108.00 | 8.00 | 2010-07-28 | 828.562 |
69
+ | 3 | 108.00 | 8.00 | 2010-07-28 | 1158.876 |
70
+ | 4 | 108.00 | 8.00 | 2010-07-28 | 1007.731 |
71
+ | 5 | 108.00 | 8.00 | 2010-07-28 | 1034.378 |
72
72
 
73
73
  Scenario Outline: Calculations starting from a merchant category
74
74
  Given a purchase has "merchant_category.mcc" of "<mcc>"
@@ -77,12 +77,12 @@ Feature: Purchase Emissions Calculations
77
77
  When emissions are calculated
78
78
  Then the emission value should be within "0.001" kgs of "<emission>"
79
79
  Examples:
80
- | mcc | cost | date | emission |
81
- | 5111 | 100.00 | 2010-07-28 | 120694.715|
82
- | 5732 | 100.00 | 2010-07-28 | 110152.836|
83
- | 5812 | 100.00 | 2010-07-28 | 118426.103|
84
- | 3504 | 100.00 | 2010-07-28 | 115090.859|
85
- | 5172 | 100.00 | 2010-07-28 | 110346.441|
80
+ | mcc | cost | date | emission |
81
+ | 5111 | 100.00 | 2010-07-28 | 756.667 |
82
+ | 5732 | 100.00 | 2010-07-28 | 828.562 |
83
+ | 5812 | 100.00 | 2010-07-28 | 1158.876 |
84
+ | 3504 | 100.00 | 2010-07-28 | 1007.731 |
85
+ | 5172 | 100.00 | 2010-07-28 | 1034.378 |
86
86
 
87
87
  Scenario Outline: Calculations starting from industry
88
88
  Given a purchase has "naics_code" of "<naics>"
@@ -92,12 +92,12 @@ Feature: Purchase Emissions Calculations
92
92
  Then the emission value should be within "0.001" kgs of "<emission>"
93
93
  Examples:
94
94
  | naics | cost | date | emission |
95
- | 45321 | 100.00 | 2010-07-28 |120694.715|
96
- | 443112 | 100.00 | 2010-07-28 |110152.836|
97
- | 72211 | 100.00 | 2010-07-28 |118426.103|
98
- | 72111 | 100.00 | 2010-07-28 |115090.859|
99
- | 32411 | 100.00 | 2010-07-28 |112285.552|
100
- | 324121 | 100.00 | 2010-07-28 | 94684.359|
101
- | 324122 | 100.00 | 2010-07-28 |106509.038|
102
- | 324191 | 100.00 | 2010-07-28 |104811.125|
103
- | 324199 | 100.00 | 2010-07-28 |104355.468|
95
+ | 45321 | 100.00 | 2010-07-28 | 756.667 |
96
+ | 443112 | 100.00 | 2010-07-28 | 828.562 |
97
+ | 72211 | 100.00 | 2010-07-28 | 1158.876 |
98
+ | 72111 | 100.00 | 2010-07-28 | 1007.731 |
99
+ | 32411 | 100.00 | 2010-07-28 | 1029.897 |
100
+ | 324121 | 100.00 | 2010-07-28 | 1032.748 |
101
+ | 324122 | 100.00 | 2010-07-28 | 1029.932 |
102
+ | 324191 | 100.00 | 2010-07-28 | 1059.298 |
103
+ | 324199 | 100.00 | 2010-07-28 | 1087.243 |
@@ -1,3 +1,8 @@
1
+ Then /^the conclusion of the committee should be a vector with "(.*)" items$/ do |count|
2
+ vector = @report.conclusion
3
+ vector.size.should == count.to_i
4
+ end
5
+
1
6
  Then /^the conclusion of the committee should be a vector with value "(.*)" and position for key "(.*)"$/ do |value, key|
2
7
  vector = @report.conclusion
3
8
  position = BrighterPlanet::Purchase.key_map.index key
@@ -15,7 +20,5 @@ Then /^the conclusion of the committee should be a vector with values "(.*)"$/ d
15
20
  vector = @report.conclusion
16
21
  vector = vector.row(0) if vector.is_a? Matrix #some vectors are single-row matrices
17
22
 
18
- BrighterPlanet::Purchase.key_map.each_with_index do |key, index|
19
- vector[index].should be_close(column_values[index].to_f, 0.00001)
20
- end
23
+ vector.should have_column_values(column_values)
21
24
  end
@@ -36,3 +36,31 @@ class Vector
36
36
  str
37
37
  end
38
38
  end
39
+
40
+ RSpec::Matchers.define :have_column_values do |_expected_|
41
+ match do |actual|
42
+ ok = true
43
+ BrighterPlanet::Purchase.key_map.each_with_index do |key, index|
44
+ ok = ok && (actual[index] - _expected_[index].to_f).abs < 0.00001
45
+ end
46
+ ok
47
+ end
48
+
49
+ failure_message_for_should do |actual|
50
+ message = nil
51
+ BrighterPlanet::Purchase.key_map.each_with_index do |key, index|
52
+ unless (actual[index] - _expected_[index].to_f).abs < 0.00001
53
+ message = "expected vector at position #{key} to be #{_expected_[index]} +/- (< 0.00001), got #{actual[index]}:"
54
+ end
55
+ end
56
+ message
57
+ end
58
+
59
+ failure_message_for_should_not do |actual|
60
+ "expected #{_expected_} +/- (< #{_delta_}), got #{actual}"
61
+ end
62
+
63
+ description do
64
+ "be close to #{_expected_} (within +- #{_delta_})"
65
+ end
66
+ end
@@ -13,44 +13,48 @@ module BrighterPlanet
13
13
 
14
14
  def data
15
15
  matrix_text = <<-MATRIX
16
- | X| 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20| 21| 22| 23| 24| 25| 26|44100|44101|44102|44103|44104|44105|
17
- | 1|0.81| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|
18
- | 2| 0|0.546| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|
19
- | 3| 0| 0|0.358| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|
20
- | 4| 0| 0| 0|1.2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|
21
- | 5| 0| 0| 0| 0|1.08| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|
22
- | 6| 0| 0| 0| 0| 0|0.623| 0| 0| 0| 0| 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 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 1.2| 0| 0| 0| 0| 0| 0|
46
+ |44104| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 1.4| 0| 0| 0| 0| 0|
47
+ |44105| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0.3| 0| 0| 0| 0|
48
+ | A| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|0.1| 0| 0| 0|
49
+ | B| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|0.1| 0| 0|
50
+ | C| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|0.1| 0|
51
+ | D| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0|0.1|
52
+
49
53
  MATRIX
50
54
  lines = matrix_text.split(/\n/)
51
55
  lines.shift
52
56
  lines.map do |line|
53
- row = line.scan(/[\d\.]+/).map(&:to_f)
57
+ row = line.scan(/[^\s^|]+/).map(&:to_f)
54
58
  row.shift
55
59
  row
56
60
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: purchase
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andy Rossmeissl
@@ -19,7 +19,7 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2010-09-08 00:00:00 -04:00
22
+ date: 2010-09-20 00:00:00 -04:00
23
23
  default_executable:
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
@@ -31,13 +31,12 @@ dependencies:
31
31
  requirements:
32
32
  - - ~>
33
33
  - !ruby/object:Gem::Version
34
- hash: -1848230024
34
+ hash: 7
35
35
  segments:
36
36
  - 3
37
37
  - 0
38
38
  - 0
39
- - beta4
40
- version: 3.0.0.beta4
39
+ version: 3.0.0
41
40
  requirement: *id001
42
41
  - !ruby/object:Gem::Dependency
43
42
  type: :development
@@ -48,14 +47,12 @@ dependencies:
48
47
  requirements:
49
48
  - - ~>
50
49
  - !ruby/object:Gem::Version
51
- hash: 62196359
50
+ hash: 23
52
51
  segments:
53
52
  - 1
54
53
  - 0
55
54
  - 0
56
- - beta
57
- - 2
58
- version: 1.0.0.beta.2
55
+ version: 1.0.0
59
56
  requirement: *id002
60
57
  - !ruby/object:Gem::Dependency
61
58
  type: :development
@@ -144,12 +141,12 @@ dependencies:
144
141
  requirements:
145
142
  - - ~>
146
143
  - !ruby/object:Gem::Version
147
- hash: 3
144
+ hash: 59
148
145
  segments:
149
146
  - 0
150
147
  - 1
151
- - 12
152
- version: 0.1.12
148
+ - 16
149
+ version: 0.1.16
153
150
  requirement: *id008
154
151
  - !ruby/object:Gem::Dependency
155
152
  type: :runtime
@@ -160,12 +157,12 @@ dependencies:
160
157
  requirements:
161
158
  - - ~>
162
159
  - !ruby/object:Gem::Version
163
- hash: 19
160
+ hash: 5
164
161
  segments:
165
162
  - 0
166
163
  - 0
167
- - 6
168
- version: 0.0.6
164
+ - 13
165
+ version: 0.0.13
169
166
  requirement: *id009
170
167
  description: A software model in Ruby for the greenhouse gas emissions of a purchase
171
168
  email: seamus@brighterplanet.com