learn-doctor 1.0.1 → 1.0.2

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: 0a44b52989d20ba751dc13783eb3805f5b3f7dbf
4
- data.tar.gz: 251b540943bd65180212df92bbd82d6146fc2aa1
3
+ metadata.gz: 294feb9a419ec1b8f97bc59eda5f04a4eb94b82a
4
+ data.tar.gz: 47d4028a657c099e701b43e2560934771209eede
5
5
  SHA512:
6
- metadata.gz: 9440bc758dd917def52af97682273ebb675feee401a6bb4c535413dfabb697b661ec22b491d1cd4a6081f3a02d32a606211b32f2541683adeb05dd8145114ef8
7
- data.tar.gz: 102e10447c2473916e1746e21cc85c6e6bd07a94c4979cc908e0b952c0d5b8ff37fb6223e4cd0de12caa17aace06d9a2261ca98f6b1b20ae5701c12e71c00408
6
+ metadata.gz: 288fe943870622c0f221ff5bb6b560bb79cca17c4b91082eccc7ca245af4e528800a88730186a76574d2fb52ed84ca098ef7d4b8234886212345c2d0dd8324a2
7
+ data.tar.gz: 54326b585fcebddaa7958586ae36e0ca008f99822820bec4fad37346d8d35ba881dc65f53291050580463dc729f40d58a2775bb3fe2e53d6c0a9573e5280c253
@@ -26,7 +26,7 @@ module LearnDoctor
26
26
  end
27
27
 
28
28
  def run_check_for_step
29
- self.result = Open3.popen2e(file.path)[1].read.strip.to_i
29
+ self.result = `#{file.path}`.strip.to_i
30
30
  end
31
31
 
32
32
  def print_result
@@ -1,12 +1,14 @@
1
1
  module LearnDoctor
2
2
  class HealthCheck
3
3
  class StepInstaller
4
- attr_reader :step, :title
4
+ attr_reader :step, :title, :sudo, :password_required
5
5
  attr_accessor :file, :result
6
6
 
7
7
  def initialize(step)
8
8
  @step = step
9
9
  @title = step[:title]
10
+ @sudo = step[:sudo]
11
+ @password_required = step[:password]
10
12
  end
11
13
 
12
14
  def execute
@@ -21,12 +23,20 @@ module LearnDoctor
21
23
  private
22
24
 
23
25
  def set_file
26
+ print "Installing #{title}..."
24
27
  self.file = LearnDoctor::HealthCheck::File.new(step, :install)
25
28
  end
26
29
 
27
30
  def run_install_for_step
28
- print "Installing #{title}..."
29
- self.result = Open3.popen3('bash', file.path)[1].read.strip
31
+ if password_required
32
+ puts "Your password is required to install #{title}."
33
+ print 'Password: '
34
+ password = gets.chomp
35
+
36
+ self.result = `#{file.path} #{password}`
37
+ else
38
+ self.result = `#{sudo ? 'sudo ' : ''}#{file.path}`.strip
39
+ end
30
40
  end
31
41
 
32
42
  def print_result
@@ -1,3 +1,3 @@
1
1
  module LearnDoctor
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
data/lib/learn_doctor.rb CHANGED
@@ -3,7 +3,6 @@ require 'faraday'
3
3
  require 'colorize'
4
4
  require 'fileutils'
5
5
  require 'tempfile'
6
- require 'open3'
7
6
  require 'learn_web'
8
7
 
9
8
  require 'learn_doctor/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: learn-doctor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flatiron School
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-11 00:00:00.000000000 Z
11
+ date: 2015-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler