shiprails 0.1.18 → 0.1.19

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: 3a24cbe59501f02ce1177daad4400093997b3acd
4
- data.tar.gz: 23ff9d829b9205196b746ff89e10d7d0bb3bacac
3
+ metadata.gz: e2c44e85dd37e1863dd6fdb778b295992981d00f
4
+ data.tar.gz: 9de493625b39caec31f4268fc26cb14fb0d73a55
5
5
  SHA512:
6
- metadata.gz: f5608078535b5c5af45622e052690b73fe25b6aab9fe518060e499b1d5a57f2c7c911704c672c9025b80b39763cf9eba0e851f9e7896f2802d0b08cc380dc9be
7
- data.tar.gz: 137894c44aa41c42063f1e1d0dd7354021ad79eb6d4255fe9c7439f60f051361da6e644fe7603a935a4a6610d1c4b625c9ff9ea604fe0a4e5bf46550471d2ba4
6
+ metadata.gz: 36c0dceec99fa01f31b82e3c06a65154f4ab22ea384f6a24e0de8bbbdabeb1536c693332ab90f6c233186ac28e096dd91f27eedd5fc57c9ad0cdcdcd7c6e2199
7
+ data.tar.gz: 15ec2cf7aaf9f6f6646504afbea812a2d74ce347a92a8fb26c49af2e3104aa44a3bfef01d2239a159bdf1f933ef0d1899044cc4ceaa1f9527df8615f45cfca3d
@@ -21,6 +21,7 @@ module Shiprails
21
21
  default: false,
22
22
  desc: "Remove container changes after use",
23
23
  type: :boolean
24
+
24
25
  def exec(*command_args)
25
26
  build_command_args = ["docker-compose", "run"]
26
27
  build_command_args << "--rm" unless options['no-rm']
@@ -41,18 +42,31 @@ module Shiprails
41
42
 
42
43
  if commands = configuration[:exec]
43
44
  commands.each do |name, command|
44
- desc name, "port exec #{command}"
45
- method_option "no-rm",
46
- default: false,
47
- desc: "Remove container changes after use",
48
- type: :boolean
49
- define_method name.to_sym do |*command_args|
50
- build_command_args = ["docker-compose", "run"]
51
- build_command_args << "--rm" unless options['no-rm']
52
- build_command_args << "app"
53
- build_command_args += command.split(' ') + command_args
54
- command_string = build_command_args.join(' ')
55
- run command_string
45
+ unless command.is_a? String
46
+ desc name, "port exec #{command}"
47
+ define_method name.to_sym do |*command_args|
48
+ build_command_args = ["docker-compose", "run"]
49
+ build_command_args << "--rm" if command[:rm]
50
+ build_command_args << command[:service] || "app"
51
+ build_command_args += command[:command].split(' ') unless command[:command].nil?
52
+ build_command_args += command_args
53
+ command_string = build_command_args.join(' ')
54
+ run command_string
55
+ end
56
+ else
57
+ desc name, "port exec #{command}"
58
+ method_option "no-rm",
59
+ default: false,
60
+ desc: "Remove container changes after use",
61
+ type: :boolean
62
+ define_method name.to_sym do |*command_args|
63
+ build_command_args = ["docker-compose", "run"]
64
+ build_command_args << "--rm" unless options['no-rm']
65
+ build_command_args << "app"
66
+ build_command_args += command.split(' ') + command_args
67
+ command_string = build_command_args.join(' ')
68
+ run command_string
69
+ end
56
70
  end
57
71
  end
58
72
  end
@@ -1,3 +1,3 @@
1
1
  module Shiprails
2
- VERSION = "0.1.18"
2
+ VERSION = "0.1.19"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shiprails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zane Shannon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-14 00:00:00.000000000 Z
11
+ date: 2017-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport