mpxj 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d856e89f68d82e8a09a0ee15c7b1496724198f50
4
- data.tar.gz: 47439ec1960b50541543e7d3a4ac5f856dd8576e
3
+ metadata.gz: 4e6e40fb1b9d49d74fdae13c828bc474a018cde6
4
+ data.tar.gz: ffa9ff48837a143bcdb898f8aeba764e3a6bb3ff
5
5
  SHA512:
6
- metadata.gz: cc5b7f2e66c1054ac7a5a47abff6bfe570de682ef2d576654a2ebfae190ed12e60e55e8a1dc6027b270e52fe17812fb7473c3e7ed91ee8c0f06b4a4bd984320f
7
- data.tar.gz: 81dd1f3c4a39e9ea8500b0206d46f47df4003d6c70ba49cedf11b86ee616ba2d4a97ab6241013995b2b2803ad15a8104ee175f637d1d3f6636563fcbed886f0c
6
+ metadata.gz: 194d76968cb5128e693df6d3c018b510bce7a8b2d522f5501d325c5e0d4d9799c1582208216e6212eadea90d69639c4bd4a19aa7a7cde162130705c75ffd7b5a
7
+ data.tar.gz: 183c8d18df285d987daecc49fa7498220947b0ea6600b48e037f86a57dc8fe38e6a848fde8102067942d961d0541986d601fbb1effb574004c7c490a878af1fa
data/README.md ADDED
@@ -0,0 +1,113 @@
1
+ # MPXJ
2
+
3
+ This gem allows a Ruby developer to work with a read-only view of project plans saved by a number of popular project planning applications.
4
+ The work required to read data from these files is actually carried out by a [Java library](http://mpxj.sf.net), hence you will need Java installed
5
+ and available on your path in order to work with this gem. Once the project data has been read from a file, a set of Ruby objects provides access to the
6
+ structure of the project plan and its attributes.
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ gem 'mpxj'
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install mpxj
21
+
22
+ ## Supported File Types
23
+
24
+ This gem uses the file name extension to determine what kind of project data it is reading. The list below shows the supported file extensions:
25
+
26
+ * **MPP** - Microsoft Project MPP file
27
+ * **MPT** - Microsoft Project template file
28
+ * **MPX** - Microsoft Project MPX file
29
+ * **XML** - Microsoft Project MSPDI (XML) file
30
+ * **MPD** - Microsoft Project database (only when the gem is used on Microsoft Windows)
31
+ * **PLANNER** - Gnome Planner
32
+ * **XER** - Primavera XER file
33
+ * **PMXML** - Primavera PMXML file
34
+ * **PP** - Asta Powerproject file
35
+
36
+ ## Example Code
37
+
38
+ The following is a trivial example showing some basic task and resource details being queried from a project:
39
+
40
+
41
+ project = MPXJ::Reader.read("project1.mpp")
42
+
43
+ puts "There are #{project.all_tasks.size} tasks in this project"
44
+ puts "There are #{project.all_resources.size} resources in this project"
45
+
46
+ puts "The resources are:"
47
+ project.all_resources.each do |resource|
48
+ puts resource.name
49
+ end
50
+
51
+ puts "The tasks are:"
52
+ project.all_tasks.each do |task|
53
+ puts "#{task.name}: starts on #{task.start}, finishes on #{task.finish}, it's duration is #{task.duration}"
54
+ end
55
+
56
+ ## Entities
57
+
58
+ The gem represents the project plan using the following classes, all of which reside in the MPXJ module.
59
+
60
+ * Project
61
+ * Resource
62
+ * Task
63
+ * Assignment
64
+ * Relation
65
+
66
+ A **Project** contains **Resource**s and **Task**s. Each **Resource** can be **Assigned** to one ore more **Task**s.
67
+ **Task**s can have dependencies between them which are represented as **Relation**s.
68
+
69
+
70
+ ## Methods, Attributes and Data Types
71
+
72
+ There are very few explicit methods implemented by the classes noted above. Access to the attributes of each class is provided via a `method_missing` handler which checks to see if the requested method name matches a known attribute name. If it does match, the attribute value is returned, otherwise the normal method missing exception is raised.
73
+
74
+ The methods defined explicitly by these classes are:
75
+
76
+ Project#all_resources
77
+ Project#all_tasks
78
+ Project#child_tasks
79
+ Project#all_assignments
80
+ Project#get_resource_by_unique_id(unique_id)
81
+ Project#get_task_by_unique_id(unique_id)
82
+ Project#get_resource_by_id(id)
83
+ Project#get_task_by_id(id)
84
+
85
+ Resource#parent_project
86
+ Resource#assignments
87
+
88
+ Task#parent_project
89
+ Task#assignments
90
+ Task#predecessors
91
+ Task#successors
92
+ Task#child_tasks
93
+ Task#parent_task
94
+
95
+ Assignment#parent_project
96
+ Assignment#task
97
+ Assignment#resource
98
+
99
+ Each attribute supported by these classes is represented by appropriate data types:
100
+
101
+ * String
102
+ * Duration [https://rubygems.org/gems/duration](https://rubygems.org/gems/duration)
103
+ * Time
104
+ * Integer
105
+ * Float
106
+
107
+ The attributes supported by each class are listed here:
108
+
109
+ * [Task Attributes](docs/TaskAttributes.md)
110
+ * [Resource Attributes](docs/ResourceAttributes.md)
111
+ * [Assignment Attributes](docs/AssignmentAttributes.md)
112
+ * [Relation Attributes](docs/RelationAttributes.md)
113
+
@@ -0,0 +1,162 @@
1
+ # Assignment Attributes
2
+
3
+ Assignment#actual_cost
4
+ Assignment#actual_finish
5
+ Assignment#actual_overtime_cost
6
+ Assignment#actual_overtime_work
7
+ Assignment#actual_overtime_work_protected
8
+ Assignment#actual_start
9
+ Assignment#actual_work
10
+ Assignment#actual_work_protected
11
+ Assignment#acwp
12
+ Assignment#assignment_delay
13
+ Assignment#assignment_resource_guid
14
+ Assignment#assignment_task_guid
15
+ Assignment#assignment_units
16
+ Assignment#baseline1_budget_cost
17
+ Assignment#baseline1_budget_work
18
+ Assignment#baseline1_cost
19
+ Assignment#baseline1_finish
20
+ Assignment#baseline1_start
21
+ Assignment#baseline1_work
22
+ ...
23
+ Assignment#baseline10_budget_cost
24
+ Assignment#baseline10_budget_work
25
+ Assignment#baseline10_cost
26
+ Assignment#baseline10_finish
27
+ Assignment#baseline10_start
28
+ Assignment#baseline10_work
29
+ Assignment#baseline_budget_cost
30
+ Assignment#baseline_budget_work
31
+ Assignment#baseline_cost
32
+ Assignment#baseline_finish
33
+ Assignment#baseline_start
34
+ Assignment#baseline_work
35
+ Assignment#bcwp
36
+ Assignment#bcws
37
+ Assignment#budget_cost
38
+ Assignment#budget_work
39
+ Assignment#confirmed
40
+ Assignment#cost
41
+ Assignment#cost1
42
+ ...
43
+ Assignment#cost10
44
+ Assignment#cost_rate_table
45
+ Assignment#cost_variance
46
+ Assignment#created
47
+ Assignment#cv
48
+ Assignment#date1
49
+ ...
50
+ Assignment#date10
51
+ Assignment#duration1
52
+ ...
53
+ Assignment#duration10
54
+ Assignment#duration1_units
55
+ ...
56
+ Assignment#duration10_units
57
+ Assignment#enterprise_cost1
58
+ ...
59
+ Assignment#enterprise_cost10
60
+ Assignment#enterprise_custom_field1
61
+ ...
62
+ Assignment#enterprise_custom_field50
63
+ Assignment#enterprise_date1
64
+ ...
65
+ Assignment#enterprise_date30
66
+ Assignment#enterprise_duration1
67
+ ...
68
+ Assignment#enterprise_duration10
69
+ Assignment#enterprise_flag1
70
+ ...
71
+ Assignment#enterprise_flag20
72
+ Assignment#enterprise_number1
73
+ ...
74
+ Assignment#enterprise_number40
75
+ Assignment#enterprise_resource_multi_value20
76
+ ...
77
+ Assignment#enterprise_resource_multi_value29
78
+ Assignment#enterprise_resource_outline_code1
79
+ ...
80
+ Assignment#enterprise_resource_outline_code29
81
+ Assignment#enterprise_resource_rbs
82
+ Assignment#enterprise_team_member
83
+ Assignment#enterprise_text1
84
+ ...
85
+ Assignment#enterprise_text40
86
+ Assignment#finish
87
+ Assignment#finish1
88
+ ...
89
+ Assignment#finish10
90
+ Assignment#finish_variance
91
+ Assignment#fixed_material_assignment
92
+ Assignment#flag1
93
+ ...
94
+ Assignment#flag20
95
+ Assignment#guid
96
+ Assignment#hyperlink
97
+ Assignment#hyperlink_address
98
+ Assignment#hyperlink_data
99
+ Assignment#hyperlink_href
100
+ Assignment#hyperlink_screen_tip
101
+ Assignment#hyperlink_subaddress
102
+ Assignment#index
103
+ Assignment#leveling_delay
104
+ Assignment#leveling_delay_units
105
+ Assignment#linked_fields
106
+ Assignment#notes
107
+ Assignment#number1
108
+ ...
109
+ Assignment#number20
110
+ Assignment#overallocated
111
+ Assignment#overtime_cost
112
+ Assignment#overtime_work
113
+ Assignment#owner
114
+ Assignment#peak
115
+ Assignment#percent_work_complete
116
+ Assignment#project
117
+ Assignment#regular_work
118
+ Assignment#remaining_cost
119
+ Assignment#remaining_overtime_cost
120
+ Assignment#remaining_overtime_work
121
+ Assignment#remaining_work
122
+ Assignment#resource_id
123
+ Assignment#resource_name
124
+ Assignment#resource_request_type
125
+ Assignment#resource_type
126
+ Assignment#resource_unique_id
127
+ Assignment#response_pending
128
+ Assignment#start
129
+ Assignment#start1
130
+ ...
131
+ Assignment#start10
132
+ Assignment#start_variance
133
+ Assignment#summary
134
+ Assignment#sv
135
+ Assignment#task_id
136
+ Assignment#task_name
137
+ Assignment#task_outline_number
138
+ Assignment#task_summary_name
139
+ Assignment#task_unique_id
140
+ Assignment#team_status_pending
141
+ Assignment#text1
142
+ ...
143
+ Assignment#text30
144
+ Assignment#timephased_actual_overtime_work
145
+ Assignment#timephased_actual_work
146
+ Assignment#timephased_baseline1_cost
147
+ ...
148
+ Assignment#timephased_baseline10_cost
149
+ Assignment#timephased_baseline1_work
150
+ ...
151
+ Assignment#timephased_baseline10_work
152
+ Assignment#timephased_work
153
+ Assignment#unavailable
154
+ Assignment#unique_id
155
+ Assignment#update_needed
156
+ Assignment#vac
157
+ Assignment#variable_rate_units
158
+ Assignment#wbs
159
+ Assignment#work
160
+ Assignment#work_contour
161
+ Assignment#work_variance
162
+
@@ -0,0 +1,5 @@
1
+ # Relation Attributes
2
+
3
+ Relation#task_unique_id
4
+ Relation#lag
5
+ Relation#type
@@ -0,0 +1,201 @@
1
+ # Resource Attributes
2
+
3
+ Resource#accrue_at
4
+ Resource#active
5
+ Resource#actual_cost
6
+ Resource#actual_finish
7
+ Resource#actual_overtime_cost
8
+ Resource#actual_overtime_work
9
+ Resource#actual_overtime_work_protected
10
+ Resource#actual_start
11
+ Resource#actual_work
12
+ Resource#actual_work_protected
13
+ Resource#acwp
14
+ Resource#assignment
15
+ Resource#assignment_delay
16
+ Resource#assignment_owner
17
+ Resource#assignment_units
18
+ Resource#availability_data
19
+ Resource#available_from
20
+ Resource#available_to
21
+ Resource#base_calendar
22
+ Resource#baseline1_budget_cost
23
+ Resource#baseline1_budget_work
24
+ Resource#baseline1_cost
25
+ Resource#baseline1_finish
26
+ Resource#baseline1_start
27
+ Resource#baseline1_work
28
+ ...
29
+ Resource#baseline10_budget_cost
30
+ Resource#baseline10_budget_work
31
+ Resource#baseline10_cost
32
+ Resource#baseline10_finish
33
+ Resource#baseline10_start
34
+ Resource#baseline10_work
35
+ Resource#baseline_budget_cost
36
+ Resource#baseline_budget_work
37
+ Resource#baseline_cost
38
+ Resource#baseline_finish
39
+ Resource#baseline_start
40
+ Resource#baseline_work
41
+ Resource#bcwp
42
+ Resource#bcws
43
+ Resource#booking_type
44
+ Resource#budget
45
+ Resource#budget_cost
46
+ Resource#budget_work
47
+ Resource#calendar_guid
48
+ Resource#can_level
49
+ Resource#code
50
+ Resource#confirmed
51
+ Resource#cost
52
+ Resource#cost1
53
+ ...
54
+ Resource#cost10
55
+ Resource#cost_center
56
+ Resource#cost_per_use
57
+ Resource#cost_rate_a
58
+ Resource#cost_rate_b
59
+ Resource#cost_rate_c
60
+ Resource#cost_rate_d
61
+ Resource#cost_rate_e
62
+ Resource#cost_rate_table
63
+ Resource#cost_variance
64
+ Resource#created
65
+ Resource#cv
66
+ Resource#date1
67
+ ...
68
+ Resource#date10
69
+ Resource#default_assignment_owner
70
+ Resource#duration1
71
+ ...
72
+ Resource#duration10
73
+ Resource#duration1_units
74
+ ...
75
+ Resource#duration10_units
76
+ Resource#email_address
77
+ Resource#enterprise
78
+ Resource#enterprise_base_calendar
79
+ Resource#enterprise_checked_out_by
80
+ Resource#enterprise_cost1
81
+ ...
82
+ Resource#enterprise_cost10
83
+ Resource#enterprise_custom_field1
84
+ ...
85
+ Resource#enterprise_custom_field50
86
+ Resource#enterprise_data
87
+ Resource#enterprise_date1
88
+ ...
89
+ Resource#enterprise_date30
90
+ Resource#enterprise_duration1
91
+ ...
92
+ Resource#enterprise_duration10
93
+ Resource#enterprise_duration1_units
94
+ ...
95
+ Resource#enterprise_duration10_units
96
+ Resource#enterprise_flag1
97
+ ...
98
+ Resource#enterprise_flag20
99
+ Resource#enterprise_is_checked_out
100
+ Resource#enterprise_last_modified_date
101
+ Resource#enterprise_multi_value20
102
+ ...
103
+ Resource#enterprise_multi_value29
104
+ Resource#enterprise_name_used
105
+ Resource#enterprise_number1
106
+ ...
107
+ Resource#enterprise_number40
108
+ Resource#enterprise_outline_code1
109
+ ...
110
+ Resource#enterprise_outline_code29
111
+ Resource#enterprise_rbs
112
+ Resource#enterprise_required_values
113
+ Resource#enterprise_team_member
114
+ Resource#enterprise_text1
115
+ ...
116
+ Resource#enterprise_text40
117
+ Resource#enterprise_unique_id
118
+ Resource#error_message
119
+ Resource#finish
120
+ Resource#finish1
121
+ ...
122
+ Resource#finish10
123
+ Resource#flag1
124
+ ...
125
+ Resource#flag20
126
+ Resource#generic
127
+ Resource#group
128
+ Resource#group_by_summary
129
+ Resource#guid
130
+ Resource#hyperlink
131
+ Resource#hyperlink_address
132
+ Resource#hyperlink_data
133
+ Resource#hyperlink_href
134
+ Resource#hyperlink_screen_tip
135
+ Resource#hyperlink_subaddress
136
+ Resource#id
137
+ Resource#import
138
+ Resource#inactive
139
+ Resource#index
140
+ Resource#indicators
141
+ Resource#initials
142
+ Resource#leveling_delay
143
+ Resource#linked_fields
144
+ Resource#material_label
145
+ Resource#max_units
146
+ Resource#name
147
+ Resource#notes
148
+ Resource#number1
149
+ ...
150
+ Resource#number20
151
+ Resource#objects
152
+ Resource#outline_code1
153
+ ...
154
+ Resource#outline_code10
155
+ Resource#outline_code1_index
156
+ ...
157
+ Resource#outline_code10_index
158
+ Resource#overallocated
159
+ Resource#overtime_cost
160
+ Resource#overtime_rate
161
+ Resource#overtime_rate_units
162
+ Resource#overtime_work
163
+ Resource#peak
164
+ Resource#percent_work_complete
165
+ Resource#phonetics
166
+ Resource#project
167
+ Resource#regular_work
168
+ Resource#remaining_cost
169
+ Resource#remaining_overtime_cost
170
+ Resource#remaining_overtime_work
171
+ Resource#remaining_work
172
+ Resource#request_demand
173
+ Resource#response_pending
174
+ Resource#standard_rate
175
+ Resource#standard_rate_units
176
+ Resource#start
177
+ Resource#start1
178
+ ...
179
+ Resource#start10
180
+ Resource#subproject_resource_unique_id
181
+ Resource#summary
182
+ Resource#sv
183
+ Resource#task_outline_number
184
+ Resource#task_summary_name
185
+ Resource#team_assignment_pool
186
+ Resource#teamstatus_pending
187
+ Resource#text1
188
+ ...
189
+ Resource#text30
190
+ Resource#type
191
+ Resource#unavailable
192
+ Resource#unique_id
193
+ Resource#update_needed
194
+ Resource#vac
195
+ Resource#wbs
196
+ Resource#windows_user_account
197
+ Resource#work
198
+ Resource#work_contour
199
+ Resource#work_variance
200
+ Resource#workgroup
201
+
@@ -0,0 +1,318 @@
1
+ # Task Attributes
2
+
3
+ Task#active
4
+ Task#actual_cost
5
+ Task#actual_duration
6
+ Task#actual_duration_units
7
+ Task#actual_finish
8
+ Task#actual_overtime_cost
9
+ Task#actual_overtime_work
10
+ Task#actual_overtime_work_protected
11
+ Task#actual_start
12
+ Task#actual_work
13
+ Task#actual_work_protected
14
+ Task#acwp
15
+ Task#assignment
16
+ Task#assignment_delay
17
+ Task#assignment_owner
18
+ Task#assignment_units
19
+ Task#baseline1_budget_cost
20
+ Task#baseline1_budget_work
21
+ Task#baseline1_cost
22
+ Task#baseline1_deliverable_finish
23
+ Task#baseline1_deliverable_start
24
+ Task#baseline1_duration
25
+ Task#baseline1_duration_estimated
26
+ Task#baseline1_duration_units
27
+ Task#baseline1_estimated_duration
28
+ Task#baseline1_estimated_finish
29
+ Task#baseline1_estimated_start
30
+ Task#baseline1_finish
31
+ Task#baseline1_fixed_cost
32
+ Task#baseline1_fixed_cost_accrual
33
+ Task#baseline1_start
34
+ Task#baseline1_work
35
+ ...
36
+ Task#baseline10_budget_cost
37
+ Task#baseline10_budget_work
38
+ Task#baseline10_cost
39
+ Task#baseline10_deliverable_finish
40
+ Task#baseline10_deliverable_start
41
+ Task#baseline10_duration
42
+ Task#baseline10_duration_estimated
43
+ Task#baseline10_duration_units
44
+ Task#baseline10_estimated_duration
45
+ Task#baseline10_estimated_finish
46
+ Task#baseline10_estimated_start
47
+ Task#baseline10_finish
48
+ Task#baseline10_fixed_cost
49
+ Task#baseline10_fixed_cost_accrual
50
+ Task#baseline10_start
51
+ Task#baseline10_work
52
+ Task#baseline_budget_cost
53
+ Task#baseline_budget_work
54
+ Task#baseline_cost
55
+ Task#baseline_deliverable_finish
56
+ Task#baseline_deliverable_start
57
+ Task#baseline_duration
58
+ Task#baseline_duration_estimated
59
+ Task#baseline_duration_units
60
+ Task#baseline_estimated_duration
61
+ Task#baseline_estimated_finish
62
+ Task#baseline_estimated_start
63
+ Task#baseline_finish
64
+ Task#baseline_fixed_cost
65
+ Task#baseline_fixed_cost_accrual
66
+ Task#baseline_start
67
+ Task#baseline_work
68
+ Task#bcwp
69
+ Task#bcws
70
+ Task#budget_cost
71
+ Task#budget_work
72
+ Task#calendar
73
+ Task#calendar_unique_id
74
+ Task#complete_through
75
+ Task#confirmed
76
+ Task#constraint_date
77
+ Task#constraint_type
78
+ Task#contact
79
+ Task#cost
80
+ Task#cost1
81
+ ...
82
+ Task#cost10
83
+ Task#cost_rate_table
84
+ Task#cost_variance
85
+ Task#cpi
86
+ Task#created
87
+ Task#critical
88
+ Task#cv
89
+ Task#cvpercent
90
+ Task#date1
91
+ ...
92
+ Task#date10
93
+ Task#deadline
94
+ Task#deliverable_finish
95
+ Task#deliverable_guid
96
+ Task#deliverable_name
97
+ Task#deliverable_start
98
+ Task#deliverable_type
99
+ Task#duration
100
+ Task#duration1
101
+ ...
102
+ Task#duration10
103
+ Task#duration1_estimated
104
+ ...
105
+ Task#duration10_estimated
106
+ Task#duration1_units
107
+ ...
108
+ Task#duration10_units
109
+ Task#duration_text
110
+ Task#duration_units
111
+ Task#duration_variance
112
+ Task#eac
113
+ Task#early_finish
114
+ Task#early_start
115
+ Task#earned_value_method
116
+ Task#effort_driven
117
+ Task#enterprise_cost1
118
+ ...
119
+ Task#enterprise_cost10
120
+ Task#enterprise_custom_field1
121
+ ...
122
+ Task#enterprise_custom_field50
123
+ Task#enterprise_data
124
+ Task#enterprise_date1
125
+ ...
126
+ Task#enterprise_date30
127
+ Task#enterprise_duration1
128
+ ...
129
+ Task#enterprise_duration10
130
+ Task#enterprise_duration1_units
131
+ ...
132
+ Task#enterprise_duration10_units
133
+ Task#enterprise_flag1
134
+ ...
135
+ Task#enterprise_flag20
136
+ Task#enterprise_number1
137
+ ...
138
+ Task#enterprise_number40
139
+ Task#enterprise_outline_code1
140
+ ...
141
+ Task#enterprise_outline_code30
142
+ Task#enterprise_project_cost1
143
+ ...
144
+ Task#enterprise_project_cost10
145
+ Task#enterprise_project_date1
146
+ ...
147
+ Task#enterprise_project_date30
148
+ Task#enterprise_project_duration1
149
+ ...
150
+ Task#enterprise_project_duration10
151
+ Task#enterprise_project_flag1
152
+ ...
153
+ Task#enterprise_project_flag20
154
+ Task#enterprise_project_number1
155
+ ...
156
+ Task#enterprise_project_number40
157
+ Task#enterprise_project_outline_code1
158
+ ...
159
+ Task#enterprise_project_outline_code30
160
+ Task#enterprise_project_text1
161
+ ...
162
+ Task#enterprise_project_text40
163
+ Task#enterprise_text1
164
+ ...
165
+ Task#enterprise_text40
166
+ Task#error_message
167
+ Task#estimated
168
+ Task#external_task
169
+ Task#finish
170
+ Task#finish1
171
+ ...
172
+ Task#finish10
173
+ Task#finish_slack
174
+ Task#finish_text
175
+ Task#finish_variance
176
+ Task#fixed_cost
177
+ Task#fixed_cost_accrual
178
+ Task#fixed_duration
179
+ Task#flag1
180
+ ...
181
+ Task#flag20
182
+ Task#free_slack
183
+ Task#group_by_summary
184
+ Task#guid
185
+ Task#hide_bar
186
+ Task#hyperlink
187
+ Task#hyperlink_address
188
+ Task#hyperlink_data
189
+ Task#hyperlink_href
190
+ Task#hyperlink_screen_tip
191
+ Task#hyperlink_subaddress
192
+ Task#id
193
+ Task#ignore_resource_calendar
194
+ Task#ignore_warnings
195
+ Task#index
196
+ Task#indicators
197
+ Task#is_duration_valid
198
+ Task#is_finish_valid
199
+ Task#is_start_valid
200
+ Task#late_finish
201
+ Task#late_start
202
+ Task#level_assignments
203
+ Task#leveling_can_split
204
+ Task#leveling_delay
205
+ Task#leveling_delay_units
206
+ Task#linked_fields
207
+ Task#manual_duration
208
+ Task#manual_duration_units
209
+ Task#marked
210
+ Task#milestone
211
+ Task#name
212
+ Task#notes
213
+ Task#number1
214
+ ...
215
+ Task#number20
216
+ Task#outline_code1
217
+ ...
218
+ Task#outline_code10
219
+ Task#outline_code1_index
220
+ ...
221
+ Task#outline_code10_index
222
+ Task#outline_level
223
+ Task#outline_number
224
+ Task#overallocated
225
+ Task#overtime_cost
226
+ Task#overtime_work
227
+ Task#parent_task
228
+ Task#parent_task_unique_id
229
+ Task#path_driven_successor
230
+ Task#path_driving_predecessor
231
+ Task#path_predecessor
232
+ Task#path_successor
233
+ Task#peak
234
+ Task#percent_complete
235
+ Task#percent_work_complete
236
+ Task#physical_percent_complete
237
+ Task#placeholder
238
+ Task#predecessors
239
+ Task#preleveled_finish
240
+ Task#preleveled_start
241
+ Task#priority
242
+ Task#project
243
+ Task#publish
244
+ Task#recalc_outline_codes
245
+ Task#recurring
246
+ Task#recurring_data
247
+ Task#regular_work
248
+ Task#remaining_cost
249
+ Task#remaining_duration
250
+ Task#remaining_overtime_cost
251
+ Task#remaining_overtime_work
252
+ Task#remaining_work
253
+ Task#request_demand
254
+ Task#resource_enterprise_multi_value_code20
255
+ ...
256
+ Task#resource_enterprise_multi_value_code29
257
+ Task#resource_enterprise_outline_code1
258
+ ...
259
+ Task#resource_enterprise_outline_code29
260
+ Task#resource_enterprise_rbs
261
+ Task#resource_group
262
+ Task#resource_initials
263
+ Task#resource_names
264
+ Task#resource_phonetics
265
+ Task#resource_type
266
+ Task#response_pending
267
+ Task#resume
268
+ Task#resume_no_earlier_than
269
+ Task#rollup
270
+ Task#scheduled_duration
271
+ Task#scheduled_finish
272
+ Task#scheduled_start
273
+ Task#spi
274
+ Task#start
275
+ Task#start1
276
+ ...
277
+ Task#start10
278
+ Task#start_slack
279
+ Task#start_text
280
+ Task#start_variance
281
+ Task#status
282
+ Task#status_indicator
283
+ Task#status_manager
284
+ Task#stop
285
+ Task#subproject_file
286
+ Task#subproject_read_only
287
+ Task#subproject_task_id
288
+ Task#subproject_tasks_uniqueid_offset
289
+ Task#subproject_unique_task_id
290
+ Task#successors
291
+ Task#summary
292
+ Task#summary_progress
293
+ Task#sv
294
+ Task#svpercent
295
+ Task#task_calendar
296
+ Task#task_calendar_guid
297
+ Task#task_mode
298
+ Task#tcpi
299
+ Task#teamstatus_pending
300
+ Task#text1
301
+ ...
302
+ Task#text30
303
+ Task#total_slack
304
+ Task#type
305
+ Task#unavailable
306
+ Task#unique_id
307
+ Task#unique_id_predecessors
308
+ Task#unique_id_successors
309
+ Task#update_needed
310
+ Task#vac
311
+ Task#warning
312
+ Task#wbs
313
+ Task#wbs_predecessors
314
+ Task#wbs_successors
315
+ Task#work
316
+ Task#work_contour
317
+ Task#work_variance
318
+
@@ -1,9 +1,16 @@
1
1
  module MPXJ
2
+ # Represents a relationship between a task and a resource in a project plan
2
3
  class Assignment < Container
4
+ # Retrieve the task associated with this assignment
5
+ #
6
+ # @return [Task] the task associated with this assignment.
3
7
  def task
4
8
  parent_project.get_task_by_unique_id(task_unique_id)
5
9
  end
6
10
 
11
+ # Retrieve the resource associated with this assignment
12
+ #
13
+ # @return [Resource] the resource associated with this assignment.
7
14
  def resource
8
15
  parent_project.get_resource_by_unique_id(resource_unique_id)
9
16
  end
@@ -2,6 +2,7 @@ require 'duration'
2
2
  require 'time'
3
3
 
4
4
  module MPXJ
5
+ # Base class from which all project entities are derived
5
6
  class Container
6
7
  attr_reader :parent_project
7
8
  def initialize(parent_project, attribute_types, attribute_values)
@@ -10,6 +11,7 @@ module MPXJ
10
11
  @attribute_values = attribute_values
11
12
  end
12
13
 
14
+
13
15
  def method_missing(name, *args, &block)
14
16
  attribute_name = name.to_s
15
17
  attribute_type = @attribute_types[attribute_name]
data/lib/mpxj/project.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'json'
2
2
 
3
3
  module MPXJ
4
+ # Represents a project plan
4
5
  class Project
5
6
  attr_reader :all_resources
6
7
  attr_reader :all_tasks
@@ -25,18 +26,38 @@ module MPXJ
25
26
  process_assignments(json_data)
26
27
  end
27
28
 
29
+ # Retrieves the resource with the matching unique_id attribute
30
+ #
31
+ # @param unique_id [Integer] resource unique ID
32
+ # @return [Resource] if the requested resource is found
33
+ # @return [nil] if the requested resource is not found
28
34
  def get_resource_by_unique_id(unique_id)
29
35
  @resources_by_unique_id[unique_id]
30
36
  end
31
37
 
38
+ # Retrieves the task with the matching unique_id attribute
39
+ #
40
+ # @param unique_id [Integer] task unique ID
41
+ # @return [Task] if the requested task is found
42
+ # @return [nil] if the requested task is not found
32
43
  def get_task_by_unique_id(unique_id)
33
44
  @tasks_by_unique_id[unique_id]
34
45
  end
35
46
 
47
+ # Retrieves the resource with the matching id attribute
48
+ #
49
+ # @param id [Integer] resource ID
50
+ # @return [Resource] if the requested resource is found
51
+ # @return [nil] if the requested resource is not found
36
52
  def get_resource_by_id(id)
37
53
  @resources_by_id[id]
38
54
  end
39
55
 
56
+ # Retrieves the task with the matching id attribute
57
+ #
58
+ # @param id [Integer] task ID
59
+ # @return [Task] if the requested task is found
60
+ # @return [nil] if the requested task is not found
40
61
  def get_task_by_id(id)
41
62
  @tasks_by_unique_id[id]
42
63
  end
data/lib/mpxj/reader.rb CHANGED
@@ -1,7 +1,13 @@
1
1
  require 'tempfile'
2
2
 
3
3
  module MPXJ
4
+ # Used to read a project plan from a file
4
5
  class Reader
6
+ # Reads a project plan from a file, and returns a Project instance
7
+ # which provides access to the structure and attributes of the project data.
8
+ #
9
+ # @param file_name [String] the name of the file to read
10
+ # @return [Project] new Project instance
5
11
  def self.read(file_name)
6
12
  project = nil
7
13
  json_file = Tempfile.new([File.basename(file_name, ".*"), '.json'])
@@ -19,6 +25,7 @@ module MPXJ
19
25
  project
20
26
  end
21
27
 
28
+ # @private
22
29
  def self.path_separator
23
30
  if windows?
24
31
  ";"
@@ -27,6 +34,7 @@ module MPXJ
27
34
  end
28
35
  end
29
36
 
37
+ # @private
30
38
  def self.windows?
31
39
  (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
32
40
  end
data/lib/mpxj/relation.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  module MPXJ
2
+ # Represents a relationship between two tasks in a project plan
2
3
  class Relation < Container
3
4
  end
4
5
  end
data/lib/mpxj/resource.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  module MPXJ
2
+ # Represents a resource in a project plan
2
3
  class Resource < Container
3
4
  attr_reader :assignments
4
5
  def initialize(parent_project, attribute_types, attribute_values)
data/lib/mpxj/task.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  module MPXJ
2
- class Task < Container
3
- RELATION_ATTRIBUTE_TYPES = {"task_unique_id" => 17, "lag" => 6, "type" => 10}
4
-
2
+ # Represents a task in a project plan
3
+ class Task < Container
5
4
  attr_reader :assignments
6
5
  attr_reader :predecessors
7
6
  attr_reader :successors
@@ -15,12 +14,18 @@ module MPXJ
15
14
  process_hierarchy
16
15
  end
17
16
 
17
+ # Retrieve the parent task of this task
18
+ #
19
+ # @return [Task] if this task is the child of another task
20
+ # @return [nil] if this is the root task
18
21
  def parent_task
19
22
  parent_project.get_task_by_unique_id(parent_task_unique_id)
20
23
  end
21
24
 
22
25
  private
23
26
 
27
+ RELATION_ATTRIBUTE_TYPES = {"task_unique_id" => 17, "lag" => 6, "type" => 10}
28
+
24
29
  def process_relations
25
30
  @predecessors = process_relation_list(attribute_values["predecessors"])
26
31
  @successors = process_relation_list(attribute_values["successors"])
data/lib/mpxj/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # MPXJ gem module
1
2
  module MPXJ
2
- VERSION = "0.4.0"
3
+ # MPXJ gem version number
4
+ VERSION = "0.5.0"
3
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mpxj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Iles
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-03-17 00:00:00.000000000 Z
11
+ date: 2015-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -87,8 +87,13 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - README.md
90
91
  - bin/console
91
92
  - bin/setup
93
+ - docs/AssignmentAttributes.md
94
+ - docs/RelationAttributes.md
95
+ - docs/ResourceAttributes.md
96
+ - docs/TaskAttributes.md
92
97
  - lib/mpxj.rb
93
98
  - lib/mpxj/assignment.rb
94
99
  - lib/mpxj/container.rb