Module: PushmiPullyu

Defined in:
lib/pushmi_pullyu.rb,
lib/pushmi_pullyu/version.rb

Overview

PushmiPullyu main module

Defined Under Namespace

Modules: AIP, Logging Classes: CLI, PreservationQueue, SwiftDepositer

Constant Summary collapse

DEFAULTS =
{
  aip_version: 'lightaip-2.0',
  daemonize: false,
  debug: false,
  logdir: 'log',
  minimum_age: 0,
  monitor: false,
  piddir: 'tmp/pids',
  workdir: 'tmp/work',
  process_name: 'pushmi_pullyu',
  queue_name: 'dev:pmpy_queue',
  redis: {
    url: 'redis://localhost:6379'
  },
  fedora: {
    url: 'http://localhost:8080/fcrepo/rest',
    user: 'fedoraAdmin',
    password: 'fedoraAdmin',
    base_path: '/dev'
  },
  swift: {
    tenant: 'tester',
    username: 'test:tester',
    password: 'testing',
    auth_url: 'http://localhost:8080/auth/v1.0',
    project_name: 'demo',
    project_domain_name: 'default',
    container: 'ERA'
  },
  rollbar: {
  },
  database: {
    encoding: 'utf8',
    pool: ENV['RAILS_MAX_THREADS'] || 5,
    url: ENV['DATABASE_URL'] || ENV['JUPITER_DATABASE_URL'] || 'postgresql://jupiter:[email protected]',
    database: 'jupiter_development'
  }
}.freeze
VERSION =
'1.0.6'.freeze

Class Method Summary collapse

Class Method Details

.application_log_fileObject


76
77
78
# File 'lib/pushmi_pullyu.rb', line 76

def self.application_log_file
  "#{options[:logdir]}/#{options[:process_name]}.log"
end

.continue_polling?Boolean

Returns:

  • (Boolean)

100
101
102
# File 'lib/pushmi_pullyu.rb', line 100

def self.continue_polling?
  server_running? && !reset_logger?
end

.loggerObject


80
81
82
# File 'lib/pushmi_pullyu.rb', line 80

def self.logger
  PushmiPullyu::Logging.logger
end

.logger=(log) ⇒ Object


84
85
86
# File 'lib/pushmi_pullyu.rb', line 84

def self.logger=(log)
  PushmiPullyu::Logging.logger = log
end

.optionsObject


64
65
66
# File 'lib/pushmi_pullyu.rb', line 64

def self.options
  @options ||= DEFAULTS.dup
end

.options=(opts) ⇒ Object


68
69
70
# File 'lib/pushmi_pullyu.rb', line 68

def self.options=(opts)
  options.deep_merge!(opts)
end

.override_options(opts) ⇒ Object


72
73
74
# File 'lib/pushmi_pullyu.rb', line 72

def self.override_options(opts)
  @options = opts
end

.reset_logger=(status) ⇒ Object


92
93
94
# File 'lib/pushmi_pullyu.rb', line 92

def self.reset_logger=(status)
  @reset_logger = status
end

.reset_logger?Boolean

Returns:

  • (Boolean)

104
105
106
# File 'lib/pushmi_pullyu.rb', line 104

def self.reset_logger?
  @reset_logger
end

.server_running=(status) ⇒ Object


88
89
90
# File 'lib/pushmi_pullyu.rb', line 88

def self.server_running=(status)
  @server_running = status
end

.server_running?Boolean

Returns:

  • (Boolean)

96
97
98
# File 'lib/pushmi_pullyu.rb', line 96

def self.server_running?
  @server_running
end