Skip to content

Commit

Permalink
Resolved conflicts after rebasing master and updated qnx file support…
Browse files Browse the repository at this point in the history
… changes as per new structure

Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
  • Loading branch information
Vasu1105 committed Oct 17, 2017
1 parent 357b401 commit a622ce0
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 37 deletions.
34 changes: 0 additions & 34 deletions lib/train/extras/file_qnx.rb

This file was deleted.

3 changes: 3 additions & 0 deletions lib/train/file.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# encoding: utf-8
#
# author: Christoph Hartmann
# author: Dominik Richter

require 'train/file/local'
require 'train/file/local/unix'
Expand Down
40 changes: 40 additions & 0 deletions lib/train/file/remote/qnx.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# encoding: utf-8
#
# author: Christoph Hartmann
# author: Dominik Richter

require 'train/file/remote/unix'

module Train
class File
class Remote
class Aix < Train::File::Remote::Unix
def content
cat = 'cat'
cat = '/proc/boot/cat' if @backend.os[:release].to_i >= 7
@content ||= if !exist?
nil
else
@backend.run_command("#{cat} #{@spath}").stdout || ''
end
end

def type
if @backend.run_command("file #{@spath}").stdout.include?('directory')
return :directory
else
return :file
end
end

%w{
mode owner group uid gid mtime size selinux_label link_path mounted stat
}.each do |field|
define_method field.to_sym do
fail NotImplementedError, "QNX does not implement the #{m}() method yet."
end
end
end
end
end
end
4 changes: 1 addition & 3 deletions lib/train/transports/ssh_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ def file(path)
elsif os.solaris?
Train::File::Remote::Unix.new(self, path)
elsif os[:name] == 'qnx'
Train::File::Remote::Qnx.new(self, path)
elsif os.windows?
Train::File::Remote::Windows.new(self, path)
Train::File::Remote::Qnx.new(self, path)
else
Train::File::Remote::Linux.new(self, path)
end
Expand Down

0 comments on commit a622ce0

Please sign in to comment.