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.

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.sample.MpxjConvert \"#{file_name}\" \"#{json_file.path}\"`
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