Class: Spectator::ERunner
- Defined in:
- lib/spectator/emacs.rb
Overview
This is the class that implements the main loop of spectator-emacs. To run spectator-emacs, just create a new ERunner object.
Constant Summary
Constants included from Emacs
Instance Method Summary collapse
-
#initialize(options = {}) {|ERunner| ... } ⇒ ERunner
constructor
Creates a new instance of ERunner.
Methods included from Emacs
#blank_string?, #enotify_connect, #enotify_notify, #enotify_register, #enotify_send, #format_tooltip, #rescue_sock_error
Methods included from Specs
#check_if_bundle_needed, #extract_rspec_stats, #extract_rspec_summary, #rspec, #rspec_send_results, #rspec_status, #run, #send_error
Constructor Details
#initialize(options = {}) {|ERunner| ... } ⇒ ERunner
Creates a new instance of ERunner. This implements the main loop of spectator-emacs
.
See the README for examples on how to customize the default behavior.
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/spectator/emacs.rb', line 447 def initialize(={}, &block) @default_options = { :enotify_port => 5000, :enotify_host => 'localhost', :notification_messages => {:failure => "F", :success => "S", :pending => "P", :error => "E"}, :notification_face => { :failure => :failure.keyword, :success => :success.keyword, :pending => :warning.keyword, :error => :error } } = @default_options.merge @cli_args = ARGV.to_a puts "======= OPTIONS =======" .each {|k, v| puts "#{k} => #{v}"} @enotify_host = [:enotify_host] @report_buffer_mode = [:report_buffer_mode] @enotify_port = [:enotify_port] @notification_messages = [:notification_messages] @notification_face = [:notification_face] @enotify_slot_id = [:slot_id] || ((File.basename Dir.pwd).split('_').map {|s| s.capitalize}).join.gsub('-','/') check_if_bundle_needed enotify_connect yield self if block_given? # TODO: load .spectator-emacs # contents = File::read('.spectator-emacs') # eval(contents) super() end |