mpxj 9.5.1 → 9.8.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of mpxj might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/bin/console +14 -14
- data/bin/setup +7 -7
- data/lib/mpxj/assignment_methods.rb +4364 -3804
- data/lib/mpxj/commons-codec-1.15.jar +0 -0
- data/lib/mpxj/container.rb +2 -3
- data/lib/mpxj/jcl-over-slf4j-1.7.30.jar +0 -0
- data/lib/mpxj/jsoup-1.14.2.jar +0 -0
- data/lib/mpxj/mpxj.jar +0 -0
- data/lib/mpxj/{poi-4.1.2.jar → poi-5.0.0.jar} +0 -0
- data/lib/mpxj/project.rb +1 -1
- data/lib/mpxj/property_methods.rb +2724 -2334
- data/lib/mpxj/reader.rb +3 -2
- data/lib/mpxj/resource_methods.rb +4828 -4210
- data/lib/mpxj/slf4j-api-1.7.30.jar +0 -0
- data/lib/mpxj/task.rb +1 -1
- data/lib/mpxj/task_methods.rb +9356 -8137
- data/lib/mpxj/version.rb +1 -1
- metadata +7 -19
- data/lib/mpxj/commons-codec-1.13.jar +0 -0
- data/lib/mpxj/jsoup-1.13.1.jar +0 -0
data/lib/mpxj/reader.rb
CHANGED
@@ -13,15 +13,16 @@ module MPXJ
|
|
13
13
|
#
|
14
14
|
# @param file_name [String] the name of the file to read
|
15
15
|
# @param zone [ActiveSupport::TimeZone] an optional timezone
|
16
|
+
# @param time_units [Symbol] optional, specify the units for expressing durations. By default durations are in seconds, can pass :minutes, :hours, :days: weeks:, :months or :years
|
16
17
|
# @return [Project] new Project instance
|
17
|
-
def self.read(file_name, zone = nil)
|
18
|
+
def self.read(file_name, zone = nil, time_units = :seconds)
|
18
19
|
project = nil
|
19
20
|
json_file = Tempfile.new([File.basename(file_name, ".*"), '.json'])
|
20
21
|
tz = zone || Time.zone || ActiveSupport::TimeZone["UTC"]
|
21
22
|
|
22
23
|
begin
|
23
24
|
classpath = "#{File.dirname(__FILE__)}/*"
|
24
|
-
java_output = `java -cp \"#{classpath}\" #{jvm_args} net.sf.mpxj.
|
25
|
+
java_output = `java -cp \"#{classpath}\" #{jvm_args} net.sf.mpxj.ruby.GenerateJson \"#{file_name}\" \"#{json_file.path}\" \"#{time_units}\"`
|
25
26
|
if $?.exitstatus != 0
|
26
27
|
report_error(java_output)
|
27
28
|
end
|