apocalypse-client 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.
@@ -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; "/etc/apocalypse.yml"; end
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
 
@@ -1,5 +1,5 @@
1
1
  module Apocalypse
2
2
  class Client
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ariejan de Vroom