Class: Skipper::File

Inherits:
Object
  • Object
show all
Defined in:
lib/skipper/file.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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(options, cli)
  @options = options
  @cli = cli

  if options.servers?
    servers = Skipper::Servers::Basic.new(options)
  else
    servers = Skipper::Servers::EC2.new(options)
  end

  @runner = Skipper::Runner.new(servers, options, cli)
end

Instance Attribute Details

#cliObject (readonly)

Returns the value of attribute cli.



5
6
7
# File 'lib/skipper/file.rb', line 5

def cli
  @cli
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/skipper/file.rb', line 5

def options
  @options
end

Class Method Details

.stdin_has_data?Boolean

Returns:

  • (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