Class: Devcenter::Previewer::Runner
- Inherits:
-
Object
- Object
- Devcenter::Previewer::Runner
- Defined in:
- lib/devcenter/previewer.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#md_path ⇒ Object
readonly
Returns the value of attribute md_path.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(slug, md_path, host, port) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(slug, md_path, host, port) ⇒ Runner
Returns a new instance of Runner.
16 17 18 19 20 21 22 23 24 |
# File 'lib/devcenter/previewer.rb', line 16 def initialize(slug, md_path, host, port) @slug = slug @md_path = md_path @host = host @port = port @url = "http://#{@host}:#{@port}/#{@slug}" @listener = init_listener @server = init_server end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
14 15 16 |
# File 'lib/devcenter/previewer.rb', line 14 def host @host end |
#md_path ⇒ Object (readonly)
Returns the value of attribute md_path.
14 15 16 |
# File 'lib/devcenter/previewer.rb', line 14 def md_path @md_path end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
14 15 16 |
# File 'lib/devcenter/previewer.rb', line 14 def port @port end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
14 15 16 |
# File 'lib/devcenter/previewer.rb', line 14 def slug @slug end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
14 15 16 |
# File 'lib/devcenter/previewer.rb', line 14 def url @url end |
Instance Method Details
#run ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/devcenter/previewer.rb', line 26 def run start @running = true [:INT, :TERM].each do |signal| trap(signal) do stop exit end end sleep 1 while running? end |