lib/danger/plugin_support/plugin_parser.rb in danger-2.0.1 vs lib/danger/plugin_support/plugin_parser.rb in danger-2.1.0

- old
+ new

@@ -1,6 +1,6 @@ -require 'json' +require "json" =begin 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: @@ -169,10 +169,10 @@ require klass.file real_klass = Danger.const_get klass.name 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 || m.name == :instance_name } + usable_methods = methods.select { |m| m.visibility == :public }.reject { |m| m.name == :initialize || m.name == :instance_name || m.name == :new } plugin_gem = klass.file.include?("gems") ? klass.file.split("gems/").last.split("-")[0..-2].join("-") : nil # Pull out the gem's path ( to make relative file paths ) # if no gem is found, index = 0, making gem_path = "" index_of_gem_in_path = plugin_gem ? klass.file.split("/").index { |component| component.include? plugin_gem } : 0