Skip to content

Commit

Permalink
Inserted the 'sys' method into more places
Browse files Browse the repository at this point in the history
Used the 'sys' method in several places where shell commands
are run.

Signed-off-by: Lawrence John Maynard <enjoyyourcopepods@gmx.com>
  • Loading branch information
enjoyyourcopepods committed Jan 6, 2017
1 parent fe6cb4e commit e82e76e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
5 changes: 2 additions & 3 deletions bin/sequenceserver
Expand Up @@ -2,6 +2,7 @@
require 'readline'
require 'English'
require 'slop'
require 'sequenceserver'

ENV['RACK_ENV'] ||= 'production'

Expand All @@ -17,7 +18,7 @@ def download_from_url(url)
cmd = "curl -ip4 -C - #{url} -o #{archive} && " \
'mkdir -p ~/.sequenceserver && ' \
"tar xvf #{archive} -C ~/.sequenceserver"
system cmd
sys(cmd)
end

begin
Expand Down Expand Up @@ -153,8 +154,6 @@ BANNER
exit
end

require 'sequenceserver'

begin
SequenceServer.init clean_opts[to_h]

Expand Down
6 changes: 3 additions & 3 deletions lib/sequenceserver.rb
Expand Up @@ -273,9 +273,9 @@ def server_url
def open_in_browser(server_url)
return if using_ssh? || verbose?
if RUBY_PLATFORM =~ /linux/ && xdg?
system "xdg-open #{server_url}"
sys("xdg-open #{server_url}")
elsif RUBY_PLATFORM =~ /darwin/
system "open #{server_url}"
sys("open #{server_url}")
end
end

Expand All @@ -289,7 +289,7 @@ def xdg?

# Return `true` if the given command exists and is executable.
def command?(command)
system("which #{command} > /dev/null 2>&1")
sys("which #{command}")
end
end
end
5 changes: 2 additions & 3 deletions lib/sequenceserver/database.rb
Expand Up @@ -168,12 +168,11 @@ def make_blast_database(file, type)
_make_blast_database(file, type, title, taxid)
end

def _make_blast_database(file, type, title, taxid, quiet = false)
def _make_blast_database(file, type, title, taxid)
cmd = 'makeblastdb -parse_seqids -hash_index ' \
"-in #{file} -dbtype #{type.to_s.slice(0, 4)} -title '#{title}'" \
" -taxid #{taxid}"
cmd << ' &> /dev/null' if quiet
system cmd
sys(cmd)
end

# Show file path and guessed sequence type to the user and obtain a y/n
Expand Down

0 comments on commit e82e76e

Please sign in to comment.