Class: Guard::Jobs::TerminalSettings
- Inherits:
-
Object
- Object
- Guard::Jobs::TerminalSettings
- Defined in:
- lib/guard/jobs/pry_wrapper.rb
Instance Method Summary collapse
- #configurable? ⇒ Boolean
- #echo ⇒ Object
-
#initialize ⇒ TerminalSettings
constructor
A new instance of TerminalSettings.
- #restore ⇒ Object
- #save ⇒ Object
Constructor Details
#initialize ⇒ TerminalSettings
Returns a new instance of TerminalSettings.
15 16 17 18 |
# File 'lib/guard/jobs/pry_wrapper.rb', line 15 def initialize @settings = nil @works = Shellany::Sheller.run("hash", "stty") || false end |
Instance Method Details
#configurable? ⇒ Boolean
35 36 37 |
# File 'lib/guard/jobs/pry_wrapper.rb', line 35 def configurable? @works end |
#echo ⇒ Object
30 31 32 33 |
# File 'lib/guard/jobs/pry_wrapper.rb', line 30 def echo return unless configurable? Shellany::Sheller.run("stty echo 2>#{IO::NULL}") end |
#restore ⇒ Object
20 21 22 23 |
# File 'lib/guard/jobs/pry_wrapper.rb', line 20 def restore return unless configurable? && @settings Shellany::Sheller.run("stty #{ @setting } 2>#{IO::NULL}") end |
#save ⇒ Object
25 26 27 28 |
# File 'lib/guard/jobs/pry_wrapper.rb', line 25 def save return unless configurable? @settings = Shellany::Sheller.stdout("stty -g 2>#{IO::NULL}").chomp end |