spaarti 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60f66d0c8df26290e5fd5b9db40167d6e757f25b
4
- data.tar.gz: 0f0cd166dc2e6b01a04bb6ad080a5dec07f0e392
3
+ metadata.gz: 9501ed9a2cb2142fbc89cc429c135e5a0dbf218d
4
+ data.tar.gz: da13d0c46525dcad7c81f0138a58b6440cc9ab90
5
5
  SHA512:
6
- metadata.gz: 9daab0358cfc4e3daab536e1b7c90f2b7d633c29df5b470ded1bf158960c1a5258728a628dfe45e745376767355e889dd43e50cb1ebd85829230dac2b531e8a3
7
- data.tar.gz: 519a19ddb18f4347f2513fb73fe020c38684c7bb86f20dac5dd7aa26064687da3b734e443b5d9202dfa44483f9d1da6f5572811fdda35e9382e3a976a9dc26b9
6
+ metadata.gz: 7ee8ca0b26a6225daa53564d9343dabe76a2e9d650068c8e46ce7b14ad26eb489b3479371708252eb5e32ee214af2567172f8b44f3ea16d48d2f36ad95d6e6f9
7
+ data.tar.gz: 7e1b2dacd94a671a469365bbbc0067eaa91839969c29a3b9727dd98cd0600959ed463d5f78b3a5c546b02067935344c88782ce3eeefed23a42fead6ebed0af9c
@@ -21,16 +21,12 @@ module Spaarti
21
21
  # Site object, represents a group of repos
22
22
  class Site
23
23
  def initialize(params = {})
24
- if params[:config_file]
25
- params[:config_file] = File.expand_path params[:config_file]
26
- fail 'Conf file does not exist' unless File.exist? params[:config_file]
27
- end
28
24
  @options = DEFAULT_OPTIONS.dup.merge params
29
- load_config
25
+ load_config(params.include? :config_file)
30
26
  end
31
27
 
32
28
  def sync!
33
- Dir.chdir(@options[:base_path]) do
29
+ Dir.chdir(File.expand_path @options[:base_path]) do
34
30
  repos.each(&:sync!)
35
31
  purge! if @options[:purge]
36
32
  end
@@ -46,8 +42,12 @@ module Spaarti
46
42
 
47
43
  private
48
44
 
49
- def load_config
50
- return unless File.exist?(@options[:config_file])
45
+ def load_config(required = false)
46
+ @options[:config_file] = File.expand_path @options[:config_file]
47
+ unless File.exist?(@options[:config_file])
48
+ fail 'Conf file does not exist' if required
49
+ return
50
+ end
51
51
  config = File.open(@options[:config_file]) { |fh| YAML.load fh.read }
52
52
  @options.merge! Cymbal.symbolize(config)
53
53
  end
@@ -1,5 +1,5 @@
1
1
  ##
2
2
  # Set the version (needed for Mercenary -v)
3
3
  module Spaarti
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spaarti
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker