Module: Spitball::ClientCommon

Included in:
Spitball, Remote
Defined in:
lib/spitball/client_common.rb

Instance Method Summary collapse

Instance Method Details

#cache!Object

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/spitball/client_common.rb', line 21

def cache!
  raise NotImplementedError
end

#cached?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/spitball/client_common.rb', line 17

def cached?
  raise NotImplementedError
end

#copy_to(path) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/spitball/client_common.rb', line 2

def copy_to(path)
  case path
  when /\.tar\.gz$/, /\.tgz$/
    copy_tarball_data(path)
  else
    tmp_tgz = File.join(path, 'spitball.tgz')
    FileUtils.mkdir_p path

    copy_tarball_data(tmp_tgz)
    `tar xzf #{tmp_tgz} -C #{path}`

    FileUtils.rm_rf(tmp_tgz)
  end
end