Class: Mys3ql::Config

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

Instance Method Summary collapse

Constructor Details

#initialize(config_file = nil) ⇒ Config

Returns a new instance of Config.



6
7
8
9
10
11
12
# File 'lib/mys3ql/config.rb', line 6

def initialize(config_file = nil)
  config_file = config_file || default_config_file
  @config = YAML.load_file File.expand_path(config_file)
rescue Errno::ENOENT
  $stderr.puts "missing config file #{config_file}"
  exit 1
end

Instance Method Details

#access_key_idObject

S3



58
59
60
# File 'lib/mys3ql/config.rb', line 58

def access_key_id
  s3['access_key_id']
end

#bin_logObject



50
51
52
# File 'lib/mys3ql/config.rb', line 50

def bin_log
  mysql['bin_log']
end

#bin_pathObject



46
47
48
# File 'lib/mys3ql/config.rb', line 46

def bin_path
 mysql['bin_path']
end

#bucketObject



66
67
68
# File 'lib/mys3ql/config.rb', line 66

def bucket
  s3['bucket']
end

#databaseObject



42
43
44
# File 'lib/mys3ql/config.rb', line 42

def database
  mysql['database']
end

#debug=(val) ⇒ Object

General



18
19
20
# File 'lib/mys3ql/config.rb', line 18

def debug=(val)
  @debug = val
end

#debugging?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/mys3ql/config.rb', line 22

def debugging?
  @debug
end

#hostObject



34
35
36
# File 'lib/mys3ql/config.rb', line 34

def host
  mysql['host']
end

#passwordObject



38
39
40
# File 'lib/mys3ql/config.rb', line 38

def password
  mysql['password']
end

#regionObject



70
71
72
# File 'lib/mys3ql/config.rb', line 70

def region
  s3['region']
end

#secret_access_keyObject



62
63
64
# File 'lib/mys3ql/config.rb', line 62

def secret_access_key
  s3['secret_access_key']
end

#userObject

MySQL



30
31
32
# File 'lib/mys3ql/config.rb', line 30

def user
  mysql['user']
end