Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Be more resilient if no tmux session is running. #1

Merged
merged 1 commit into from

2 participants

Martin Mauch Juan Ibiapina
Martin Mauch

This also requires that you use the patch from here
nightscape/tmux-ruby@e02dd79
on tmux-ruby

Martin Mauch nightscape Be more resilient if no tmux session is running.
This also requires that you use the patch from here
nightscape/tmux-ruby@e02dd79
on tmux-ruby
5a15917
Juan Ibiapina juanibiapina merged commit 7d39153 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 9, 2012
  1. Martin Mauch

    Be more resilient if no tmux session is running.

    nightscape authored
    This also requires that you use the patch from here
    nightscape/tmux-ruby@e02dd79
    on tmux-ruby
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 6 deletions.
  1. +7 −6 lib/tmuxbar.rb
13 lib/tmuxbar.rb
View
@@ -10,7 +10,7 @@ def start(example_count)
def stop
super
- @session.status_bar.right.pop_widget(@bar)
+ @session.status_bar.right.pop_widget(@bar) if @session
end
def example_passed(example)
@@ -43,15 +43,16 @@ def message(message)
private
def increment_bar
- @bar.value += 1
+ @bar.value += 1 if @bar
end
def init_bar(size)
server = Tmux::Server.new
- @session = server.sessions(attached: true).first
+ if (@session = server.sessions(attached: true).first)
- @bar = Tmux::Widgets::ProgressBar.new("RSpec")
- @bar.total = size
- @session.status_bar.right.add_widget(@bar)
+ @bar = Tmux::Widgets::ProgressBar.new("RSpec")
+ @bar.total = size
+ @session.status_bar.right.add_widget(@bar)
+ end
end
end
Something went wrong with that request. Please try again.