Module: PartyFoul

Defined in:
lib/party_foul.rb,
lib/party_foul/version.rb,
lib/party_foul/middleware.rb,
lib/generators/party_foul/install_generator.rb

Defined Under Namespace

Modules: IssueRenderers, Processors Classes: ExceptionHandler, InstallGenerator, Middleware, RacklessExceptionHandler

Constant Summary collapse

VERSION =
'1.5.6'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.additional_labelsObject

Returns the value of attribute additional_labels.



5
6
7
# File 'lib/party_foul.rb', line 5

def additional_labels
  @additional_labels
end

.api_endpointString

The api endpoint for GitHub. This is only interesting for Enterprise users

Returns:



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

def self.api_endpoint
  @api_endpoint ||= 'https://api.github.com'
end

.blacklisted_exceptionsArray

The collection of exceptions that should not be captured. Members of the collection must be string representations of the exception. For example:

# This is good
['ActiveRecord::RecordNotFound']

# This is not
[ActiveRecord::RecordNotFound]

Returns:

  • (Array)


51
52
53
# File 'lib/party_foul.rb', line 51

def self.blacklisted_exceptions
  @blacklisted_exceptions || []
end

.branchString

The git branch that is used for linking in the stack trace

Returns:

  • (String)

    Defaults to ‘master’ if not set



12
13
14
# File 'lib/party_foul.rb', line 12

def self.branch
  @branch ||= 'master'
end

.comment_limitObject

Returns the value of attribute comment_limit.



5
6
7
# File 'lib/party_foul.rb', line 5

def comment_limit
  @comment_limit
end

.githubObject

Returns the value of attribute github.



5
6
7
# File 'lib/party_foul.rb', line 5

def github
  @github
end

.oauth_tokenObject

Returns the value of attribute oauth_token.



5
6
7
# File 'lib/party_foul.rb', line 5

def oauth_token
  @oauth_token
end

.ownerObject

Returns the value of attribute owner.



5
6
7
# File 'lib/party_foul.rb', line 5

def owner
  @owner
end

.processorClass

The processor to be used when handling the exception. Defaults to a synchrons processor

Returns:

  • (Class)

    Defaults to ‘PartyFoul::Processors:Sync



36
37
38
# File 'lib/party_foul.rb', line 36

def self.processor
  @processor ||= PartyFoul::Processors::Sync
end

.repoObject

Returns the value of attribute repo.



5
6
7
# File 'lib/party_foul.rb', line 5

def repo
  @repo
end

.title_prefixObject

Returns the value of attribute title_prefix.



5
6
7
# File 'lib/party_foul.rb', line 5

def title_prefix
  @title_prefix
end

.web_urlString

The web url for GitHub. This is only interesting for Enterprise users

Returns:

  • (String)

    Defaults to ‘github.com’ if not set



20
21
22
# File 'lib/party_foul.rb', line 20

def self.web_url
  @web_url ||= 'https://github.com'
end

Class Method Details

.configure {|_self| ... } ⇒ Object

The configure block for PartyFoul. Use to initialize settings

PartyFoul.configure do |config|
  config.owner 'dockyard'
  config.repo  'test_app'
  config.oauth_token = ENV['oauth_token']
end

Will also setup for GitHub api connections

Parameters:

  • (Block)

Yields:

  • (_self)

Yield Parameters:

  • _self (PartyFoul)

    the object that the method was called on



82
83
84
85
# File 'lib/party_foul.rb', line 82

def self.configure
  yield self
  self.github = Octokit::Client.new access_token: oauth_token, api_endpoint: api_endpoint
end

.repo_pathString

The GitHub path to the repo Built using owner and repo

Returns:

  • (String)


59
60
61
# File 'lib/party_foul.rb', line 59

def self.repo_path
  "#{owner}/#{repo}"
end

.repo_urlString

The url of the repository. Built using the web_url and repo_path values

Returns:

  • (String)


67
68
69
# File 'lib/party_foul.rb', line 67

def self.repo_url
  "#{web_url}/#{repo_path}"
end