Module: Infinite::Loop::Helpers

Defined in:
lib/infinite/loop/helpers.rb

Instance Method Summary collapse

Instance Method Details

#agentObject



8
9
10
11
# File 'lib/infinite/loop/helpers.rb', line 8

def agent
  @agent = Infinite::Loop::Agent.new unless @agent
  @agent
end

#pluralize(n, singular, plural = nil) ⇒ Object



13
14
15
# File 'lib/infinite/loop/helpers.rb', line 13

def pluralize(n, singular, plural = nil)
  n.to_i == 1 ? "1 #{singular}" : "#{n} #{plural || singular + 's'}"
end

#tryObject



17
18
19
20
21
22
23
24
25
# File 'lib/infinite/loop/helpers.rb', line 17

def try
  return unless block_given?

  begin
    yield
  #rescue UnsuccessfulAuthenticationError
  #  say_error "Could not authenticate with HockeyApp." and abort
  end
end