Class: PgSync::Client
- Inherits:
-
Object
- Object
- PgSync::Client
- Defined in:
- lib/pgsync/client.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Client
constructor
A new instance of Client.
-
#perform ⇒ Object
TODO clean up this mess.
Constructor Details
#initialize(args) ⇒ Client
Returns a new instance of Client.
3 4 5 6 7 8 9 |
# File 'lib/pgsync/client.rb', line 3 def initialize(args) $stdout.sync = true $stderr.sync = true @exit = false @arguments, = parse_args(args) @mutex = windows? ? Mutex.new : MultiProcessing::Mutex.new end |
Instance Method Details
#perform ⇒ Object
TODO clean up this mess
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/pgsync/client.rb', line 12 def perform return if @exit args, opts = @arguments, [:to, :from, :to_safe, :exclude, :schemas].each do |opt| opts[opt] ||= config[opt.to_s] end map_deprecations(args, opts) if opts[:init] setup(db_config_file(args[0]) || config_file || ".pgsync.yml") else sync(args, opts) end true end |