fig-newton 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b5a41dc06f75c9fb6399e765b55bb0f10112bac
4
- data.tar.gz: ab72bec5b02e6d0dc0572a7e3056b8c721136c64
3
+ metadata.gz: 43aa9927899ad0d71697d27fbf8d74b34d3bc88d
4
+ data.tar.gz: e95a85f9238a2bc73ed7f34fe77c9395021a3089
5
5
  SHA512:
6
- metadata.gz: b7b265e993ddbff08f1ef6b710e0319d630b9111fa3f0f7302592dd9911cfc7353c0110d077f190523a124a07e7c3897d885d23ba63e65628344d681e6012da7
7
- data.tar.gz: 529837261c693b3edddf5daed09189cce65868d1eaa0ec4fc5336f5a6dbd6d29f31fab7b3fbdb270f82e7a2510b038162759fd0803c1cea1d8aa541e33c16a45
6
+ metadata.gz: 3513c28c205dc059f02698f996d40f56129b1178d47e87d05814defd99b8c85801b9d07bc60fde088c76632a9d04ab395c2c1ff589661bbba082d08be98ee608
7
+ data.tar.gz: 9dbd6774c7d035d1b78b723a2be3d4488478ca85847ee23dc6fbf3f0c65a20c9c48691074c2e5885aa6426c07a7ba3285e66fea97e9848edd31bc08c9a3f90a0
@@ -6,7 +6,7 @@ module FigNewton
6
6
  def initialize(stack_name, app, config_dir)
7
7
  @stack_name = stack_name
8
8
  @app = app
9
- @config = FigNewton::Config.from_file(File.join(config_dir, @stack_name))
9
+ @config = FigNewton::Config.from_file(config_dir, @stack_name)
10
10
  end
11
11
 
12
12
  def run(parent_directory)
@@ -5,7 +5,7 @@ module FigNewton
5
5
  class Clone
6
6
  def initialize(stack_name, config_dir)
7
7
  @stack_name = stack_name
8
- @config = FigNewton::Config.from_file(File.join(config_dir, @stack_name))
8
+ @config = FigNewton::Config.from_file(config_dir, @stack_name)
9
9
  end
10
10
 
11
11
  def run(parent_directory)
@@ -5,7 +5,7 @@ module FigNewton
5
5
  class Down
6
6
  def initialize(stack_name, config_dir)
7
7
  @stack_name = stack_name
8
- @config = FigNewton::Config.from_file(File.join(config_dir, @stack_name))
8
+ @config = FigNewton::Config.from_file(config_dir, @stack_name)
9
9
  end
10
10
 
11
11
  def run(parent_directory)
@@ -38,7 +38,7 @@ module FigNewton
38
38
  end
39
39
 
40
40
  def stack_filename
41
- @filename ||= FigNewton::Config.filepath_from_stack(File.join(@config_dir, @stack_name))
41
+ @filename ||= FigNewton::Config.filepath_from_stack(@config_dir, @stack_name)
42
42
  end
43
43
 
44
44
  def unindent(s)
@@ -6,7 +6,7 @@ module FigNewton
6
6
  def initialize(stack_name, app, config_dir)
7
7
  @stack_name = stack_name
8
8
  @app = app
9
- @config = FigNewton::Config.from_file(File.join(config_dir, @stack_name))
9
+ @config = FigNewton::Config.from_file(config_dir, @stack_name)
10
10
  end
11
11
 
12
12
  def run(parent_directory)
@@ -5,7 +5,7 @@ module FigNewton
5
5
  class Up
6
6
  def initialize(stack_name, config_dir)
7
7
  @stack_name = stack_name
8
- @config = FigNewton::Config.from_file(File.join(config_dir, @stack_name))
8
+ @config = FigNewton::Config.from_file(config_dir, @stack_name)
9
9
  end
10
10
 
11
11
  def run(parent_directory)
@@ -3,12 +3,12 @@ require "fig-newton/app"
3
3
 
4
4
  module FigNewton
5
5
  class Config
6
- def self.filepath_from_stack(stack_name)
7
- File.join(".", "#{stack_name}.yml")
6
+ def self.filepath_from_stack(config_dir, stack_name)
7
+ File.join(config_dir, "#{stack_name}.yml")
8
8
  end
9
9
 
10
- def self.from_file(stack_name)
11
- filename = filepath_from_stack(stack_name)
10
+ def self.from_file(config_dir, stack_name)
11
+ filename = absolute_path(config_dir, stack_name)
12
12
  data = YAML::load_file(filename)
13
13
 
14
14
  new(data, filename)
@@ -34,5 +34,15 @@ module FigNewton
34
34
  private
35
35
 
36
36
  attr_accessor :data, :filename
37
+
38
+ def self.absolute_path(config_path, stack_name)
39
+ dir = if config_path[0] =~ /\//
40
+ config_path
41
+ else
42
+ File.absolute_path(File.join(".", config_path))
43
+ end
44
+
45
+ filepath_from_stack(dir, stack_name)
46
+ end
37
47
  end
38
48
  end
@@ -1,3 +1,3 @@
1
1
  module FigNewton
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fig-newton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Dunn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-03-18 00:00:00.000000000 Z
11
+ date: 2015-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor