Class: BPL::Derivatives::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/bpl/derivatives/config.rb

Constant Summary collapse

CONFIG_METHODS =
%i[ffmpeg_path libreoffice_path temp_file_base fits_path kdu_compress_path
kdu_compress_recipes enable_ffmpeg source_file_service output_file_service active_encode_poll_time output_object_class].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/bpl/derivatives/config.rb', line 15

def initialize
  @ffmpeg_path ||= 'ffmpeg'
  @libreoffice_path ||= 'soffice'
  @temp_file_base ||= Dir.tmpdir
  @source_file_service ||= BPL::Derivatives::RetrieveSourceFileService
  @output_file_service ||= BPL::Derivatives::PersistBasicContainedOutputFileService
  @fits_path ||= 'fits.sh'
  @enable_ffmpeg = nil
  @kdu_compress_path ||= 'kdu_compress'
  @kdu_compress_recipes ||= {
    default_color: %(-rate 2.4,1.48331273,.91673033,.56657224,.35016049,.21641118,.13374944,.08266171
      -jp2_space sRGB
      -double_buffering 10
      -num_threads 4
      -no_weights
      Clevels=6
      Clayers=8
      "Cblk={64,64}"
      Cuse_sop=yes
      Cuse_eph=yes
      Corder=RPCL
      ORGgen_plt=yes
      ORGtparts=R
      "Stiles={1024,1024}" ).gsub(/\s+/, " ").strip,
    default_grey: %(-rate 2.4,1.48331273,.91673033,.56657224,.35016049,.21641118,.13374944,.08266171
      -jp2_space sLUM
      -double_buffering 10
      -num_threads 4
      -no_weights
      Clevels=6
      Clayers=8
      "Cblk={64,64}"
      Cuse_sop=yes
      Cuse_eph=yes
      Corder=RPCL
      ORGgen_plt=yes
      ORGtparts=R
      "Stiles={1024,1024}" ).gsub(/\s+/, " ").strip
  }
  @active_encode_poll_time ||= 10
  @base_logger ||= ::Logger.new(STDOUT)
  @output_object_class ||= "ActiveFedora::File"
end

Instance Attribute Details

#active_encode_poll_timeObject

Returns the value of attribute active_encode_poll_time.



8
9
10
# File 'lib/bpl/derivatives/config.rb', line 8

def active_encode_poll_time
  @active_encode_poll_time
end

#base_loggerObject

Returns the value of attribute base_logger.



8
9
10
# File 'lib/bpl/derivatives/config.rb', line 8

def base_logger
  @base_logger
end

#enable_ffmpegObject

Returns the value of attribute enable_ffmpeg.



8
9
10
# File 'lib/bpl/derivatives/config.rb', line 8

def enable_ffmpeg
  @enable_ffmpeg
end

#ffmpeg_pathObject

Returns the value of attribute ffmpeg_path.



8
9
10
# File 'lib/bpl/derivatives/config.rb', line 8

def ffmpeg_path
  @ffmpeg_path
end

#fits_pathObject

Returns the value of attribute fits_path.



8
9
10
# File 'lib/bpl/derivatives/config.rb', line 8

def fits_path
  @fits_path
end

#kdu_compress_pathObject

Returns the value of attribute kdu_compress_path.



8
9
10
# File 'lib/bpl/derivatives/config.rb', line 8

def kdu_compress_path
  @kdu_compress_path
end

#kdu_compress_recipesObject

Returns the value of attribute kdu_compress_recipes.



8
9
10
# File 'lib/bpl/derivatives/config.rb', line 8

def kdu_compress_recipes
  @kdu_compress_recipes
end

#libreoffice_pathObject

Returns the value of attribute libreoffice_path.



8
9
10
# File 'lib/bpl/derivatives/config.rb', line 8

def libreoffice_path
  @libreoffice_path
end

#output_file_serviceObject

Returns the value of attribute output_file_service.



8
9
10
# File 'lib/bpl/derivatives/config.rb', line 8

def output_file_service
  @output_file_service
end

#output_object_classObject

Returns the value of attribute output_object_class.



8
9
10
# File 'lib/bpl/derivatives/config.rb', line 8

def output_object_class
  @output_object_class
end

#source_file_serviceObject

Returns the value of attribute source_file_service.



8
9
10
# File 'lib/bpl/derivatives/config.rb', line 8

def source_file_service
  @source_file_service
end

#temp_file_baseObject

Returns the value of attribute temp_file_base.



8
9
10
# File 'lib/bpl/derivatives/config.rb', line 8

def temp_file_base
  @temp_file_base
end