Class: Skipper::File
- Inherits:
-
Object
- Object
- Skipper::File
- Defined in:
- lib/skipper/file.rb
Instance Attribute Summary collapse
-
#cli ⇒ Object
readonly
Returns the value of attribute cli.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options, cli) ⇒ File
constructor
A new instance of File.
- #run(file) ⇒ Object
Constructor Details
#initialize(options, cli) ⇒ File
Returns a new instance of File.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/skipper/file.rb', line 7 def initialize(, cli) @options = @cli = cli if .servers? servers = Skipper::Servers::Basic.new() else servers = Skipper::Servers::EC2.new() end @runner = Skipper::Runner.new(servers, , cli) end |
Instance Attribute Details
#cli ⇒ Object (readonly)
Returns the value of attribute cli.
5 6 7 |
# File 'lib/skipper/file.rb', line 5 def cli @cli end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/skipper/file.rb', line 5 def @options end |
Class Method Details
.stdin_has_data? ⇒ Boolean
20 21 22 |
# File 'lib/skipper/file.rb', line 20 def self.stdin_has_data? $stdin.fcntl(Fcntl::F_GETFL, 0) == 0 end |
Instance Method Details
#run(file) ⇒ Object
24 25 26 |
# File 'lib/skipper/file.rb', line 24 def run(file) @runner.run(file.read) end |