Class: Sinew::Main

Inherits:
Scripto::Main
  • Object
show all
Defined in:
lib/sinew/main.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Main

Returns a new instance of Main.



12
13
14
15
16
17
# File 'lib/sinew/main.rb', line 12

def initialize(options)
  super(options)

  # init
  @runtime_options = RuntimeOptions.new
end

Instance Attribute Details

#runtime_optionsObject (readonly)

Returns the value of attribute runtime_options.



10
11
12
# File 'lib/sinew/main.rb', line 10

def runtime_options
  @runtime_options
end

Instance Method Details

#dslObject



28
29
30
# File 'lib/sinew/main.rb', line 28

def dsl
  @dsl ||= DSL.new(self)
end

#http(method, url, options = {}) ⇒ Object

http requests



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/sinew/main.rb', line 36

def http(method, url, options = {})
  request = Request.new(self, method, url, options)
  response = request.perform(connection)

  # always log error messages
  if response.error?
    puts "xxx http request failed with #{response.code}"
  end

  response
end

#outputObject

output



57
58
59
# File 'lib/sinew/main.rb', line 57

def output
  @output ||= Output.new(self)
end

#quiet?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/sinew/main.rb', line 24

def quiet?
  options[:quiet]
end

#runObject



19
20
21
22
# File 'lib/sinew/main.rb', line 19

def run
  dsl.run
  footer if !quiet?
end