From: Tatsuki Sugiura Date: Mon, 1 May 2017 05:05:48 +0000 (+0900) Subject: Runnable on win32 environment. X-Git-Tag: v0.1.9~1 X-Git-Url: http://git.osdn.net/view?p=osdn-codes%2Fosdn-cli.git;a=commitdiff_plain;h=06fb6dcc777c54c72ced5945e26b6542c35c9296 Runnable on win32 environment. --- diff --git a/lib/osdn/cli.rb b/lib/osdn/cli.rb index 47962cd..5980973 100644 --- a/lib/osdn/cli.rb +++ b/lib/osdn/cli.rb @@ -70,7 +70,7 @@ module OSDN logger.error "Invalid ownership of credential file #{credential_path}, skip loading." return end - unless (stat.mode & 0777).to_s(8) == "600" + if RUBY_PLATFORM !~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/ && (stat.mode & 0777).to_s(8) != "600" logger.error "Invalid permission #{(stat.mode & 0777).to_s(8)} of credential file #{credential_path}, skip loading." return end diff --git a/lib/osdn/cli/command/login.rb b/lib/osdn/cli/command/login.rb index 0ea6cec..8721683 100644 --- a/lib/osdn/cli/command/login.rb +++ b/lib/osdn/cli/command/login.rb @@ -42,7 +42,7 @@ module OSDN; module CLI; module Command end case RUBY_PLATFORM when /mswin|msys|mingw|cygwin|bccwin|wince|emc/ - exec("start #{url}") if fork.nil? + spawn("start #{url.gsub(/&/, '^&')}") when /darwin|mac os/ exec("/usr/bin/open", url) if fork.nil? end