module Danger
www.appveyor.com/docs/build-configuration/
docs.codemagic.io/building/environment-variables/
Mainly so we can have a nice structure for commands
Just a less verbose way of doing the Dangerfile
from ‘danger init`.
So you want to improve this? Great. Hard thing is getting yourself into a position where you have access to all the tokens, so here’s something you should run in ‘bundle exec pry` to dig in:
require 'danger' require 'yard' parser = Danger::PluginParser.new "spec/fixtures/plugins/example_fully_documented.rb" parser.parse plugins = parser.plugins_from_classes(parser.classes_in_file) git = plugins.first klass = git parser.to_dict(plugins)
Then some helpers
attribute_meths = klass.attributes[:instance].values.map(&:values).flatten methods = klass.meths - klass.inherited_meths - attribute_meths usable_methods = methods.select { |m| m.visibility == :public }.reject { |m| m.name == :initialize }
the alternative, is to add
require 'pry' binding.pry
anywhere inside the source code below.
Constants
- DESCRIPTION
- GEM_NAME
- VERSION
Public Class Methods
Source
# 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
@return [String] Latest version of Danger
on rubygems.org
Source
# 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
@return [String] The path to the local gem directory