shells 0.1.7 → 0.1.8

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: ff3218a25e2f8801926946df4d8f1d5c99cd4485
4
- data.tar.gz: c882cd4c588766c21dd819817c22d8a9dd2db154
3
+ metadata.gz: ea9f3b33a7f702b90a070a65ed2733dfff093b3e
4
+ data.tar.gz: 17c72a0e4d99b53d509aa5f0065768f552a89b0d
5
5
  SHA512:
6
- metadata.gz: 6fcb625d9d48f2096a858326e5430555527d9956bda1747fb7fafc2911b73c6cb8b5fc5de0d0e5c6989ca7457b9d239183b7793cc20c0ba1009fe1ecc50a00ed
7
- data.tar.gz: 5738c4d03f81e93b05806bd8ff76933afc37110ed53e4e826550771bb21c78b59be97d0e33aa4aa06d59f9a5686a779ec114b9a6fc7552f5c8f55c582fff6e4f
6
+ metadata.gz: f177e564d9b6af1ec3eb911faf4ae66895302aeaef5a8c42774cd8c878b920b9b30d5a468c23adddae2e3767b2e67c0c25ecb68e2732a3fc2ad4e7b097e997da
7
+ data.tar.gz: 19e5ea9eaedf5f8e86bc4e882e011c37e9aaddaa26cefdf0c83e8a6559ab0fa353f166f0edee8856b0fbc15ffc8b30f80ec272b411bb70c74cd2330506f8280f
@@ -39,8 +39,8 @@ module Shells
39
39
  # Executes an elevated command using the 'sudo' command.
40
40
  def sudo_exec(command, options = {}, &block)
41
41
  sudo_prompt = '[sp:'
42
- sudo_match = /[\r\n]\[sp:$/
43
- sudo_strip = /\[sp:[^\n]*\n/
42
+ sudo_match = /\n\[sp:$/m
43
+ sudo_strip = /\[sp:[^\n]*\n/m
44
44
  ret = exec("sudo -p \"#{sudo_prompt}\" bash -c \"#{command.gsub('"', '\\"')}\"", options) do |data,type|
45
45
  test_data = data.to_s
46
46
  desired_length = sudo_prompt.length + 1 # prefix a NL before the prompt.
@@ -51,7 +51,7 @@ module Shells
51
51
  end
52
52
 
53
53
  if test_data =~ sudo_match
54
- options[:password]
54
+ self.options[:password]
55
55
  else
56
56
  if block
57
57
  block.call(data, type)
@@ -1,5 +1,5 @@
1
1
  module Shells
2
2
  ##
3
3
  # The current version of the gem.
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shells
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Beau Barker