fig-newton 0.0.1 → 0.1.0

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: 0149f90fb2855e3060d519a5efd81185415e5903
4
- data.tar.gz: 4f80142b52ec00b8c9c5c2b066bfdbe3680064bd
3
+ metadata.gz: ba0039fab7f8e7d3e05e8d75f573e94fd62d305c
4
+ data.tar.gz: 5daf640730b3f87ed823423e6c9e93c3fdb4a97b
5
5
  SHA512:
6
- metadata.gz: f1f33d19d3c97d96e0a50d69dd0ef6b22e219e807b2c93827e7d6a0bab61769aff8ff299489bfe71a791081eef29db9bdc8089e8973a54c13de478a049c41ac7
7
- data.tar.gz: b8f73c5a25fab085bde862dbec15ac3b526b713a6f0fe0e8babad3b13e01877d0316d70e6ecb57fc60177f7c722848fb23116bd19709a383ba9c5bc5e28b619f
6
+ metadata.gz: fa2eaa670b103495e3244e14c8eb6c24e59b7034a809884a168ffa4a28584758b6dce9bda6c3b9fcbd357f35304c5b9d6a013fba4eef81623a5efd9894aeb011
7
+ data.tar.gz: 1c56d50071f76cee2b1597a3ed2422549549c8d8115365e612379160c89b419e0469026f813ae6ae5ba03d7eaf7d78c3af3c29a21120f2e4e31347aa6113dddc
@@ -2,43 +2,52 @@ require "thor"
2
2
 
3
3
  module FigNewton
4
4
  class CLI < Thor
5
+ class_option :conf, type: :string,
6
+ default: ".",
7
+ desc: "The directory where fig-newton should look for stack configuration files",
8
+ aliases: ["c"]
9
+
5
10
  desc "init STACK_NAME", "Generate a skeleton description file for the STACK_NAME application stack"
6
11
  option :force, type: :boolean,
7
12
  default: false,
8
- desc: "Overwrite file if it already exists"
13
+ desc: "Overwrite file if it already exists",
14
+ aliaes: ["f"]
9
15
  def init(stack_name)
10
16
  require "fig-newton/commands/init"
11
- command = FigNewton::Commands::Init.new(stack_name)
17
+ command = FigNewton::Commands::Init.new(stack_name, options[:conf])
12
18
  command.run(options[:force])
13
19
  end
14
20
 
15
21
  desc "clone STACK_NAME", "Use git to pull down the repositories for the given stack"
16
22
  option :parent_directory, type: :string,
17
23
  default: ".",
18
- desc: "The parent directory of the cloned repositories"
24
+ desc: "The parent directory of the cloned repositories",
25
+ aliases: ["p"]
19
26
  def clone(stack_name)
20
27
  require "fig-newton/commands/clone"
21
- command = FigNewton::Commands::Clone.new(stack_name)
28
+ command = FigNewton::Commands::Clone.new(stack_name, options[:conf])
22
29
  command.run(options[:parent_directory])
23
30
  end
24
31
 
25
32
  desc "up STACK_NAME", "Bring up all the applications defined for the given stack. Equivalent to running fig up in each application directory."
26
33
  option :parent_directory, type: :string,
27
34
  default: ".",
28
- desc: "The parent directory of the cloned repositories"
35
+ desc: "The parent directory of the cloned repositories",
36
+ aliases: ["p"]
29
37
  def up(stack_name)
30
38
  require "fig-newton/commands/up"
31
- command = FigNewton::Commands::Up.new(stack_name)
39
+ command = FigNewton::Commands::Up.new(stack_name, options[:conf])
32
40
  command.run(options[:parent_directory])
33
41
  end
34
42
 
35
- desc "down STACK_NAME", "Bring down all the applications defined for the given stack. Equivalent to running fig down in each application directory."
43
+ desc "down STACK_NAME", "Bring down all the applications defined for the given stack. Equivalent to running fig kill in each application directory."
36
44
  option :parent_directory, type: :string,
37
45
  default: ".",
38
- desc: "The parent directory of the cloned repositories"
46
+ desc: "The parent directory of the cloned repositories",
47
+ aliases: ["p"]
39
48
  def down(stack_name)
40
49
  require "fig-newton/commands/down"
41
- command = FigNewton::Commands::Down.new(stack_name)
50
+ command = FigNewton::Commands::Down.new(stack_name, options[:conf])
42
51
  command.run(options[:parent_directory])
43
52
  end
44
53
  end
@@ -4,9 +4,9 @@ require "fig-newton/config"
4
4
  module FigNewton
5
5
  module Commands
6
6
  class Clone
7
- def initialize(stack_name)
7
+ def initialize(stack_name, config_dir)
8
8
  @stack_name = stack_name
9
- @config = FigNewton::Config.from_file(@stack_name)
9
+ @config = FigNewton::Config.from_file(File.join(config_dir, @stack_name))
10
10
  end
11
11
 
12
12
  def run(parent_directory)
@@ -3,9 +3,9 @@ require "fig-newton/config"
3
3
  module FigNewton
4
4
  module Commands
5
5
  class Down
6
- def initialize(stack_name)
6
+ def initialize(stack_name, config_dir)
7
7
  @stack_name = stack_name
8
- @config = FigNewton::Config.from_file(@stack_name)
8
+ @config = FigNewton::Config.from_file(File.join(config_dir, @stack_name))
9
9
  end
10
10
 
11
11
  def run(parent_directory)
@@ -3,8 +3,9 @@ require "fig-newton/config"
3
3
  module FigNewton
4
4
  module Commands
5
5
  class Init
6
- def initialize(stack_name)
6
+ def initialize(stack_name, config_dir)
7
7
  @stack_name = stack_name
8
+ @config_dir = config_dir
8
9
  @yaml = nil
9
10
  end
10
11
 
@@ -37,7 +38,7 @@ module FigNewton
37
38
  end
38
39
 
39
40
  def stack_filename
40
- @filename ||= FigNewton::Config.filepath_from_stack(@stack_name)
41
+ @filename ||= FigNewton::Config.filepath_from_stack(File.join(@config_dir, @stack_name))
41
42
  end
42
43
 
43
44
  def unindent(s)
@@ -3,9 +3,9 @@ require "fig-newton/config"
3
3
  module FigNewton
4
4
  module Commands
5
5
  class Up
6
- def initialize(stack_name)
6
+ def initialize(stack_name, config_dir)
7
7
  @stack_name = stack_name
8
- @config = FigNewton::Config.from_file(@stack_name)
8
+ @config = FigNewton::Config.from_file(File.join(config_dir, @stack_name))
9
9
  end
10
10
 
11
11
  def run(parent_directory)
@@ -1,3 +1,3 @@
1
1
  module FigNewton
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fig-newton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Dunn