Skip to content

Commit

Permalink
move mounted? to file common. Thanks @arlimus
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock committed Dec 30, 2015
1 parent afef814 commit 7595d2d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 4 additions & 0 deletions lib/train/extras/file_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ def unix_mode_mask(owner, type)
t & o
end

def mounted?
!mounted.nil? && !mounted.stdout.nil? && !mounted.stdout.empty?
end

# helper methods provided to any implementing class

private
Expand Down
4 changes: 0 additions & 4 deletions lib/train/extras/linux_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ def mounted
)
end

def mounted?
!mounted.stdout.empty?
end

%w{
type mode owner group mtime size selinux_label
}.each do |field|
Expand Down
4 changes: 0 additions & 4 deletions lib/train/transports/mock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,5 @@ def mounted
@runtime.run_command("mount | grep -- ' on #{@path}'")
)
end

def mounted?
!mounted.stdout.empty?
end
end
end

0 comments on commit 7595d2d

Please sign in to comment.