Class: Syncoku::Remote

Inherits:
Object
  • Object
show all
Includes:
Runnable
Defined in:
lib/syncoku/remote.rb

Overview

Responsible for syncing to a remote app

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Runnable

#run_command, #test_command

Constructor Details

#initialize(remote) ⇒ Remote

Returns a new instance of Remote.



9
10
11
# File 'lib/syncoku/remote.rb', line 9

def initialize(remote)
  @remote = remote
end

Instance Attribute Details

#remoteObject (readonly)

Returns the value of attribute remote.



7
8
9
# File 'lib/syncoku/remote.rb', line 7

def remote
  @remote
end

Instance Method Details

#app_nameObject



30
31
32
# File 'lib/syncoku/remote.rb', line 30

def app_name
  @app_name ||= run_command("git remote -v | grep #{remote} | grep push").match(/heroku\.com:(.*)\.git/)[1]
end

#both(args) ⇒ Object



13
14
15
16
# File 'lib/syncoku/remote.rb', line 13

def both(args)
  db(args)
  s3(args) if S3.config?
end

#db(args) ⇒ Object



18
19
20
# File 'lib/syncoku/remote.rb', line 18

def db(args)
  Syncoku::RemoteDb.new(app_name).sync
end

#rebuild(args) ⇒ Object



26
27
28
# File 'lib/syncoku/remote.rb', line 26

def rebuild(args)
  puts "Rebuild not implemented"
end

#s3(args) ⇒ Object



22
23
24
# File 'lib/syncoku/remote.rb', line 22

def s3(args)
  Syncoku::S3.new(remote).sync
end