dory 0.3.7 → 0.3.9

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: 1a47351367a7364f212a527181aa547ca5759f72
4
- data.tar.gz: 5656fdb4e5c0f7db64f437ce16e42880059d5e0a
3
+ metadata.gz: f93c9a9d5c8d8c7ac6e84a18a946209d5da811cc
4
+ data.tar.gz: db80f007af9afc1de49f48dd9b0cc09aac4de9ab
5
5
  SHA512:
6
- metadata.gz: 9394a03254d6c8d50491fd3613d28afa023e99810149b74978e5418c1736af72fff3a893f36046c7c45fed5f218b3fe13545b7ac7f8feb1e012120fe9e0d952f
7
- data.tar.gz: adb6de18b3f69da8ffe172c4d4f2b188ff113d6609bb5eb2dc639b9630af6934332bc7bf9ac386c5ceeaaea992c36ccc4741b3bbc304713e7dcd49b9d7e2b6fe
6
+ metadata.gz: 38f44ffae7792e826d959c28d201637f65e95ecafdd9545c258a6dbea31528d8ed856e2ff0b53fd67a753998276df509864f936ec792d1248e5b53a302d292fa
7
+ data.tar.gz: d09cbf8d66a6db8c1dd7d9ca97d72a6731c5e8f0e5e140a3f90e3549839470addf55303b95917abafd59c2ea38cfea5a5095f465cd4f155ea0dc0c926180f987
data/bin/dory CHANGED
@@ -112,8 +112,47 @@ class DoryBin < Thor
112
112
  exec_attach(service, options)
113
113
  end
114
114
 
115
+ desc 'pull', 'Pull down the docker images that dory uses'
116
+ long_desc <<-LONGDESC
117
+ This will pull down the docker images that dory uses.
118
+ You don't need to run this command as dory will automatically
119
+ pull down the images when needed if they aren't there already.
120
+ However, you may wish to pull down in advance, and for that
121
+ purpose this command is here for you.
122
+
123
+ > $ dory pull [proxy] [dns]
124
+ LONGDESC
125
+ def pull(*services)
126
+ exec_pull(services, options)
127
+ end
128
+
115
129
  private
116
130
 
131
+ def exec_pull(services, _options)
132
+ servs = services.empty? ? %w[proxy dns] : services
133
+ servs = sanitize_services(servs)
134
+ return unless servs
135
+ servs.each do |service|
136
+ imgname = if service == 'proxy'
137
+ Dory::Proxy.dory_http_proxy_image_name
138
+ elsif service == 'dns'
139
+ Dory::Dnsmasq.dnsmasq_image_name
140
+ else
141
+ nil
142
+ end
143
+ if imgname
144
+ puts "Pulling image '#{imgname}'...".green
145
+ if Dory::Sh.run_command("docker pull #{imgname}").success?
146
+ puts "Successfully pulled image '#{imgname}'".green
147
+ else
148
+ puts "Error pulling docker image '#{imgname}'".red
149
+ end
150
+ else
151
+ puts "Can only pull 'proxy' or 'dns', you tried to pull '#{service}'".red
152
+ end
153
+ end
154
+ end
155
+
117
156
  def exec_attach(service, _options)
118
157
  s = sanitize_service(service)
119
158
  mod = if s == 'proxy'
@@ -398,7 +437,7 @@ class DoryBin < Thor
398
437
  if valid_service?(service)
399
438
  true
400
439
  else
401
- puts "'#{service}' is not valid. Must be one or more of these: #{valid_services.join(', ')}"
440
+ puts "'#{service}' is not valid. Must be one or more of these: #{valid_services.join(', ')}".red
402
441
  false
403
442
  end
404
443
  end
data/lib/dory/dnsmasq.rb CHANGED
@@ -113,7 +113,8 @@ module Dory
113
113
  pids = listener_list.uniq(&:pid).map(&:pid)
114
114
  pidstr = pids.join(' and ')
115
115
  print "This interferes with Dory's dnsmasq container. Would you like me to kill PID #{pidstr}? (Y/N): "
116
- conf = answer ? answer : STDIN.gets.chomp
116
+ conf = answer ? answer : ENV['DORY_KILL_DNSMASQ']
117
+ conf = STDIN.gets.chomp unless conf
117
118
  if conf =~ /y/i
118
119
  puts "Requesting sudo to kill PID #{pidstr}"
119
120
  return Sh.run_command("sudo kill #{pids.join(' ')}").success?
data/lib/dory/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Dory
2
- VERSION = '0.3.7'
3
- DATE = '2016-07-29'
2
+ VERSION = '0.3.9'
3
+ DATE = '2016-10-17'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-29 00:00:00.000000000 Z
11
+ date: 2016-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  version: '0'
167
167
  requirements: []
168
168
  rubyforge_project:
169
- rubygems_version: 2.4.8
169
+ rubygems_version: 2.2.5
170
170
  signing_key:
171
171
  specification_version: 4
172
172
  summary: Your development proxy for Docker