appd 0.2.3 → 0.3.0

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: 4574121098a29cbc711020f462624179225fafc5
4
- data.tar.gz: 2beb38f83db0d6456368a5ed35113aaf09e2cacf
3
+ metadata.gz: df84a9eb13ce4d5d509322d6fc8f002a912294bd
4
+ data.tar.gz: cb406b47a4463c1edfbeaa1d26e3d2f376e6d34a
5
5
  SHA512:
6
- metadata.gz: b7b14a66aa3aa79ed48584db92ad20e8be0112cc7a93416e7f9eaa6fc564e3db72e995b506c13cc9088b08d20afb15c2d873fa63e635499bfdc805e01595aa63
7
- data.tar.gz: dffcde3982bed9e98f4aa8d21951bc5920681ce142370adc552310c739cd496641fd84b098da22836cb3107a64fd3e49f64e0612f15e84065e4594bccd3b07ba
6
+ metadata.gz: ab2f125e1a4391dcbbe3ddb157b2ee8d7df7dc926a0b852252073e8709d483d15e3d3c2e2a2cb271301150c8e1c723afa53e128126aefed240293d0934cfb701
7
+ data.tar.gz: c31b348262f5b2f5c2e8823304ca7e1cdd7238f8a434321e9590e733f017717aa0a8908065b378f9378e0a2168833c628b77b74b6504d1bdfc2d6e6ce56fc5dc
data/README.md CHANGED
@@ -44,6 +44,7 @@ Commands:
44
44
  exec SERVICE COMMAND # Execute a command in a running container
45
45
 
46
46
  Note: appd looks for apps in the $APP_PATH directory.
47
+ APPNAME can be . for current app.
47
48
  ```
48
49
 
49
50
  ## Development
data/exe/appd CHANGED
@@ -6,9 +6,14 @@ Signal.trap("INT") { exit 1 }
6
6
  require "appd"
7
7
  require "appd/cli"
8
8
 
9
- if ARGV[0] != "help" && app_name = ARGV.shift
10
- ARGV << "--app"
11
- ARGV << app_name
9
+ if ARGV[0] != "help" && ARGV[0] != "select" && app = ARGV.shift
10
+ if app == "."
11
+ ARGV << "--app-path"
12
+ ARGV << Dir.pwd
13
+ else
14
+ ARGV << "--app"
15
+ ARGV << app
16
+ end
12
17
  end
13
18
 
14
19
  Appd::CLI.start(ARGV, debug: true)
data/lib/appd/app.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  module Appd
2
2
  class App
3
- attr_reader :name
3
+ attr_reader :options
4
4
 
5
- def initialize(name)
6
- @name = name
5
+ def initialize(options)
6
+ @options = options
7
7
  end
8
8
 
9
9
  def ps
@@ -32,8 +32,12 @@ module Appd
32
32
 
33
33
  private
34
34
 
35
+ def app_path
36
+ options.app_path || "#{ENV["APP_PATH"]}/#{options.app}"
37
+ end
38
+
35
39
  def docker_compose(command)
36
- Appd.exec "direnv exec $APP_PATH/#{name} docker-compose -f $APP_PATH/#{name}/docker-compose.yml #{command}"
40
+ Appd.exec "direnv exec #{app_path} docker-compose -f #{app_path}/docker-compose.yml #{command}"
37
41
  end
38
42
  end
39
43
  end
data/lib/appd/cli.rb CHANGED
@@ -2,7 +2,11 @@ require "thor"
2
2
 
3
3
  module Appd
4
4
  class CLI < Thor
5
- class_option :app, type: :string, hide: true, required: ARGV.count > 0 && ARGV[0] != 'help'
5
+ class_option :app_path, type: :string, hide: true
6
+ class_option :app, type: :string, hide: true, required: ARGV.count > 0 &&
7
+ ARGV[0] != 'help' &&
8
+ ARGV[0] != "select" &&
9
+ ARGV[0] != "."
6
10
 
7
11
  default_task :help
8
12
 
@@ -13,6 +17,7 @@ module Appd
13
17
  puts "Commands:"
14
18
  self.class.commands.each { |_, command| printf "%-30s %s\n", " #{command.usage} ", "# #{command.description}" }
15
19
  puts "\nNote: appd looks for apps in the $APP_PATH directory."
20
+ puts " APPNAME can be . for current app."
16
21
  end
17
22
 
18
23
  desc "ps", "List containers"
@@ -49,7 +54,7 @@ module Appd
49
54
 
50
55
  no_tasks do
51
56
  def app
52
- Appd::App.new(options.app)
57
+ Appd::App.new(options)
53
58
  end
54
59
  end
55
60
  end
data/lib/appd/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Appd
2
- VERSION = "0.2.3"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morgan Showman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-10 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.4.5.1
113
+ rubygems_version: 2.5.1
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Docker compose wrapper for managing containers.