Module: Danger

Defined in:
lib/danger/ci_source/appveyor.rb,
lib/danger.rb,
lib/danger/version.rb,
lib/danger/commands/pr.rb,
lib/danger/commands/init.rb,
lib/danger/ci_source/surf.rb,
lib/danger/commands/local.rb,
lib/danger/ci_source/dotci.rb,
lib/danger/ci_source/drone.rb,
lib/danger/commands/runner.rb,
lib/danger/helpers/comment.rb,
lib/danger/ci_source/bamboo.rb,
lib/danger/ci_source/circle.rb,
lib/danger/ci_source/cirrus.rb,
lib/danger/ci_source/travis.rb,
lib/danger/commands/dry_run.rb,
lib/danger/commands/staging.rb,
lib/danger/commands/systems.rb,
lib/danger/ci_source/bitrise.rb,
lib/danger/ci_source/jenkins.rb,
lib/danger/ci_source/codeship.rb,
lib/danger/ci_source/teamcity.rb,
lib/danger/core_ext/file_list.rb,
lib/danger/ci_source/appcenter.rb,
lib/danger/ci_source/appcircle.rb,
lib/danger/ci_source/buildkite.rb,
lib/danger/ci_source/ci_source.rb,
lib/danger/ci_source/codefresh.rb,
lib/danger/ci_source/codemagic.rb,
lib/danger/ci_source/concourse.rb,
lib/danger/ci_source/gitlab_ci.rb,
lib/danger/ci_source/semaphore.rb,
lib/danger/scm_source/git_repo.rb,
lib/danger/ci_source/buddybuild.rb,
lib/danger/ci_source/circle_api.rb,
lib/danger/ci_source/code_build.rb,
lib/danger/danger_core/executor.rb,
lib/danger/helpers/emoji_mapper.rb,
lib/danger/request_sources/vsts.rb,
lib/danger/ci_source/screwdriver.rb,
lib/danger/ci_source/xcode_cloud.rb,
lib/danger/plugin_support/plugin.rb,
lib/danger/ci_source/xcode_server.rb,
lib/danger/danger_core/dangerfile.rb,
lib/danger/helpers/array_subclass.rb,
lib/danger/request_sources/gitlab.rb,
lib/danger/clients/rubygems_client.rb,
lib/danger/commands/dangerfile/gem.rb,
lib/danger/helpers/comments_helper.rb,
lib/danger/ci_source/github_actions.rb,
lib/danger/ci_source/local_git_repo.rb,
lib/danger/commands/dangerfile/init.rb,
lib/danger/commands/dangerfile/init.rb,
lib/danger/request_sources/vsts_api.rb,
lib/danger/ci_source/azure_pipelines.rb,
lib/danger/ci_source/support/commits.rb,
lib/danger/danger_core/message_group.rb,
lib/danger/danger_core/messages/base.rb,
lib/danger/danger_core/dangerfile_dsl.rb,
lib/danger/danger_core/standard_error.rb,
lib/danger/request_sources/local_only.rb,
lib/danger/ci_source/support/repo_info.rb,
lib/danger/commands/plugins/plugin_json.rb,
lib/danger/commands/plugins/plugin_lint.rb,
lib/danger/plugin_support/gems_resolver.rb,
lib/danger/plugin_support/plugin_linter.rb,
lib/danger/plugin_support/plugin_parser.rb,
lib/danger/ci_source/bitbucket_pipelines.rb,
lib/danger/ci_source/local_only_git_repo.rb,
lib/danger/danger_core/messages/markdown.rb,
lib/danger/request_sources/github/github.rb,
lib/danger/ci_source/support/no_repo_info.rb,
lib/danger/commands/plugins/plugin_readme.rb,
lib/danger/danger_core/message_aggregator.rb,
lib/danger/danger_core/messages/violation.rb,
lib/danger/request_sources/request_source.rb,
lib/danger/ci_source/custom_ci_with_github.rb,
lib/danger/danger_core/environment_manager.rb,
lib/danger/helpers/comments_parsing_helper.rb,
lib/danger/request_sources/bitbucket_cloud.rb,
lib/danger/commands/local_helpers/pry_setup.rb,
lib/danger/danger_core/dangerfile_generator.rb,
lib/danger/request_sources/bitbucket_server.rb,
lib/danger/ci_source/support/no_pull_request.rb,
lib/danger/commands/init_helpers/interviewer.rb,
lib/danger/commands/local_helpers/http_cache.rb,
lib/danger/request_sources/code_insights_api.rb,
lib/danger/commands/local_helpers/local_setup.rb,
lib/danger/helpers/message_groups_array_helper.rb,
lib/danger/plugin_support/plugin_file_resolver.rb,
lib/danger/request_sources/bitbucket_cloud_api.rb,
lib/danger/ci_source/support/local_pull_request.rb,
lib/danger/request_sources/bitbucket_server_api.rb,
lib/danger/request_sources/github/github_review.rb,
lib/danger/ci_source/support/pull_request_finder.rb,
lib/danger/ci_source/support/remote_pull_request.rb,
lib/danger/ci_source/support/find_repo_info_from_url.rb,
lib/danger/danger_core/plugins/dangerfile_git_plugin.rb,
lib/danger/ci_source/support/find_repo_info_from_logs.rb,
lib/danger/danger_core/plugins/dangerfile_vsts_plugin.rb,
lib/danger/danger_core/plugins/dangerfile_danger_plugin.rb,
lib/danger/danger_core/plugins/dangerfile_github_plugin.rb,
lib/danger/danger_core/plugins/dangerfile_gitlab_plugin.rb,
lib/danger/request_sources/github/github_review_resolver.rb,
lib/danger/danger_core/plugins/dangerfile_messaging_plugin.rb,
lib/danger/danger_core/plugins/dangerfile_local_only_plugin.rb,
lib/danger/request_sources/github/github_review_unsupported.rb,
lib/danger/danger_core/plugins/dangerfile_bitbucket_cloud_plugin.rb,
lib/danger/danger_core/plugins/dangerfile_bitbucket_server_plugin.rb

Overview

Danger

Defined Under Namespace

Modules: Helpers, RequestSources Classes: AppVeyor, Appcenter, Appcircle, AzurePipelines, Bamboo, BaseMessage, BitbucketPipelines, Bitrise, Buddybuild, Buildkite, CI, CIDocs, CircleAPI, CircleCI, Cirrus, CodeBuild, Codefresh, Codemagic, Codeship, Comment, Commits, Concourse, CustomCIWithGithub, DSLError, Dangerfile, DangerfileBitbucketCloudPlugin, DangerfileBitbucketServerPlugin, DangerfileCommand, DangerfileDangerPlugin, DangerfileGem, DangerfileGenerator, DangerfileGitHubPlugin, DangerfileGitLabPlugin, DangerfileGitPlugin, DangerfileInit, DangerfileLocalOnlyPlugin, DangerfileMessagingPlugin, DangerfileVSTSPlugin, DotCi, Drone, DryRun, EmojiMapper, EnvironmentManager, Executor, FileList, FindRepoInfoFromLogs, FindRepoInfoFromURL, GemsResolver, GitHubActions, GitLabCI, GitRepo, HTTPCache, Init, Interviewer, Jenkins, Local, LocalGitRepo, LocalOnlyGitRepo, LocalPullRequest, LocalSetup, Markdown, MessageAggregator, MessageGroup, NoPullRequest, NoRepoInfo, PR, Plugin, PluginFileResolver, PluginJSON, PluginLint, PluginLinter, PluginParser, PluginReadme, PrySetup, PullRequestFinder, RemotePullRequest, RepoInfo, RubyGemsClient, Runner, Screwdriver, Semaphore, Staging, Surf, Systems, TeamCity, Travis, Violation, XcodeCloud, XcodeServer

Constant Summary collapse

GEM_NAME =
"danger".freeze
VERSION =
"9.5.1".freeze
DESCRIPTION =
"Like Unit Tests, but for your Team Culture.".freeze

Class Method Summary collapse

Class Method Details

.danger_outdated?String

Returns Latest version of Danger on rubygems.org.

Returns:



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/danger.rb', line 33

def self.danger_outdated?
  require "danger/clients/rubygems_client"
  latest_version = RubyGemsClient.latest_danger_version

  if Gem::Version.new(latest_version) > Gem::Version.new(Danger::VERSION)
    latest_version
  else
    false
  end
rescue StandardError => _e
  false
end

.gem_pathString

Returns The path to the local gem directory.

Returns:

  • (String)

    The path to the local gem directory



24
25
26
27
28
29
30
# File 'lib/danger.rb', line 24

def self.gem_path
  if Gem::Specification.find_all_by_name(GEM_NAME).empty?
    raise "Couldn't find gem directory for 'danger'"
  end

  return Gem::Specification.find_by_name(GEM_NAME).gem_dir
end