Class: Hjc::FsShell

Inherits:
Object
  • Object
show all
Defined in:
lib/hjc/fs_shell.rb

Instance Method Summary collapse

Constructor Details

#initializeFsShell

Returns a new instance of FsShell.



3
4
5
# File 'lib/hjc/fs_shell.rb', line 3

def initialize
  @params = []
end

Instance Method Details

#build_argsObject



36
37
38
39
40
# File 'lib/hjc/fs_shell.rb', line 36

def build_args
  concated_args = ["-#{@cmd}"]
  concated_args.concat @params
  concated_args
end

#get(remote, local) ⇒ Object



13
14
15
16
17
# File 'lib/hjc/fs_shell.rb', line 13

def get(remote, local)
  @cmd = :get
  @params = [remote, local]
  run
end

#put(local, remote) ⇒ Object



7
8
9
10
11
# File 'lib/hjc/fs_shell.rb', line 7

def put(local, remote)
  @cmd = :put
  @params = [local, remote]
  run
end

#rm(remote) ⇒ Object



19
20
21
22
23
# File 'lib/hjc/fs_shell.rb', line 19

def rm(remote)
  @cmd = :rm
  @params = [remote]
  run
end

#rmr(remote) ⇒ Object



25
26
27
28
29
# File 'lib/hjc/fs_shell.rb', line 25

def rmr(remote)
  @cmd = :rmr
  @params = [remote]
  run
end

#runObject



31
32
33
34
# File 'lib/hjc/fs_shell.rb', line 31

def run
  java_shell = ::FsShell.new(Configuration.new)
  java_shell.run(build_args)
end