bitex_bot 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/bitex_bot/settings.rb +16 -14
- data/lib/bitex_bot/version.rb +1 -1
- metadata +1 -1
data/lib/bitex_bot/settings.rb
CHANGED
@@ -1,19 +1,21 @@
|
|
1
1
|
require 'settingslogic'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
"
|
11
|
-
|
3
|
+
module BitexBot
|
4
|
+
class Settings < Settingslogic
|
5
|
+
def self.load_default
|
6
|
+
path = ARGV[0] || File.expand_path('bitex_bot_settings.yml', Dir.pwd)
|
7
|
+
unless FileTest.exists?(path)
|
8
|
+
sample_path = File.expand_path('../../../settings.yml.sample', __FILE__)
|
9
|
+
FileUtils.cp(sample_path, path)
|
10
|
+
puts "No settings found, I've created a new one with sample "\
|
11
|
+
"values at #{path}. Please go ahead and edit it before running this again."
|
12
|
+
exit 1
|
13
|
+
end
|
14
|
+
source path
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.load_test
|
18
|
+
source File.expand_path('../../../settings.yml.sample', __FILE__)
|
12
19
|
end
|
13
|
-
source path
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.load_test
|
17
|
-
source File.expand_path('../../../settings.yml.sample', __FILE__)
|
18
20
|
end
|
19
21
|
end
|
data/lib/bitex_bot/version.rb
CHANGED