ruby_pins 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7e272be6fcee3162904989970bb34925ddd8d83
4
- data.tar.gz: eba0917f3a811475a6661c6b82480abdf24b9080
3
+ metadata.gz: ef60f888ce2805b35223666013bdccf0ba22b44e
4
+ data.tar.gz: aa5460be91212c26aa032b705b48e92dcd83abcf
5
5
  SHA512:
6
- metadata.gz: 76eba6e2779cf371d9aa1e5f49558071fac48ef61296a25e340455496611acf16bb0a6aae728b6a825c5912f45d460e68cdb020db7f12715e1e62d3c9cda426d
7
- data.tar.gz: 72e5cd4d2486f81d804c1f55feeca07071d945f61fd9a7575061b7e44cb92a52ca0283a6b64528a6198d8d0b83d2232a58e586a232f88a807f14be5e326d8c7b
6
+ metadata.gz: 6c200ac6db2ac903b57da2b81483162cdd7d78d573a29a26e7be5bee76a320a893f99143fe1da05064d42525285df06fcda448d5bcf04f9d78f15cce924133be
7
+ data.tar.gz: c299e3c2568d88df94911db9381b89aa6b74de192574e18cd83cb1ac7d76e67ed1aae72f099c054013642cd445e2a404883d10b07efa48df677142769e119aa5
data/lib/ruby_pins/pin.rb CHANGED
@@ -6,7 +6,6 @@ module RubyPins
6
6
  def initialize args
7
7
  args.each {|k, v| self.send "#{k}=", v}
8
8
  self.state= :off unless self.state
9
- self.host ||= :local
10
9
  end
11
10
 
12
11
  def state= state
@@ -30,14 +29,14 @@ module RubyPins
30
29
 
31
30
  def run *commands
32
31
  std_out = ''
33
- if host == :local
34
- commands.each {|cmd| std_out << %x(#{cmd})}
35
- else
32
+ if self.host
36
33
  commands.each do |cmd|
37
34
  Net::SSH.start(self.host.address, self.host.user, password: self.host.password) do |ssh|
38
35
  std_out << ssh.exec!(cmd)
39
36
  end
40
37
  end
38
+ else
39
+ commands.each {|cmd| std_out << %x(#{cmd})}
41
40
  end
42
41
  std_out
43
42
  end
@@ -1,3 +1,3 @@
1
1
  module RubyPins
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_pins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - MainShayne233