Skip to content

Commit 3df4a20

Browse files
committed
improve determining path to .testingbot file
1 parent 1fe0b83 commit 3df4a20

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

bin/testingbot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ else
1414
api_secret = gets.chomp
1515
end
1616

17-
File.open(File.expand_path("~/.testingbot"), 'w') {|f| f.write("#{api_key}:#{api_secret}") }
17+
File.open(File.join(Dir.home, ".testingbot"), 'w') {|f| f.write("#{api_key}:#{api_secret}") }
1818

1919
p "Your system is now ready to use TestingBot's grid infrastructure."

lib/testingbot/api.rb

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -185,20 +185,7 @@ def delete_uploaded_file(app_url)
185185
private
186186

187187
def load_config_file
188-
is_windows = false
189-
190-
begin
191-
require 'rbconfig'
192-
is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
193-
rescue
194-
is_windows = (RUBY_PLATFORM =~ /w.*32/) || (ENV["OS"] && ENV["OS"] == "Windows_NT")
195-
end
196-
197-
if is_windows
198-
config_file = "#{ENV['HOMEDRIVE']}\\.testingbot"
199-
else
200-
config_file = File.expand_path("#{Dir.home}/.testingbot")
201-
end
188+
config_file = File.join(Dir.home, ".testingbot")
202189

203190
if File.exist?(config_file)
204191
str = File.open(config_file) { |f| f.readline }.chomp

0 commit comments

Comments
 (0)