apocalypse-client 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/apocalypse-client.rb +10 -1
- data/lib/apocalypse-client/version.rb +1 -1
- metadata +3 -3
data/lib/apocalypse-client.rb
CHANGED
@@ -2,6 +2,7 @@ require "yaml"
|
|
2
2
|
require 'rubygems'
|
3
3
|
require 'net/http'
|
4
4
|
require 'json'
|
5
|
+
require 'fileutils'
|
5
6
|
require 'apocalypse-client/version'
|
6
7
|
require 'apocalypse-client/response'
|
7
8
|
require 'apocalypse-client/install'
|
@@ -19,7 +20,15 @@ end
|
|
19
20
|
module Apocalypse
|
20
21
|
class Client
|
21
22
|
# Was "#{File.dirname(__FILE__)}/../host.yml"
|
22
|
-
def self.host_file
|
23
|
+
def self.host_file
|
24
|
+
# Try to move the old configuration file to the new location
|
25
|
+
old_file = "#{File.dirname(__FILE__)}/../host.yml"
|
26
|
+
if !File.exists?("/etc/apocalypse.yml") && File.exists?(old_file)
|
27
|
+
FileUtils.mv old_file, "/etc/apocalypse.yml", :force => true
|
28
|
+
end
|
29
|
+
|
30
|
+
return "/etc/apocalypse.yml"
|
31
|
+
end
|
23
32
|
def self.cron_job_file; "/etc/cron.d/apocalypse"; end
|
24
33
|
def self.rvm?; !`which rvm`.chomp.empty? end
|
25
34
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apocalypse-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ariejan de Vroom
|