lib/licensed/reporters/reporter.rb
# Generate a report for a licensed dependency source enumerator
# Yields a report object which can be used to view or add
# data generated for this dependency source
#
# source - A dependency source enumerator
#
# Returns the result of the yielded method
# Note - must be called from inside the `report_app` scope
Generate a report for a licensed dependency source enumerator
Yields a report object which can be used to view or add
data generated for this dependency source

A dependency source enumerator

Returns the result of the yielded method
Note - must be called from inside the `report_app` scope
Generate a report for a licensed dependency source enumerator Yields a report object which can be used to view or add data generated for this dependency source A dependency source enumerator Returns the result of the yielded method Note - must be called from inside the ` report_app ` scope
def report_source(source)
        raise ReportingError.new("Cannot call report_source with active source context") unless @source_report.nil?
        raise ReportingError.new("Call report_app before report_source") if @app_report.nil?
        result = nil
        @source_report = Report.new(name: [@app_report.name, source.class.type].join("."), target: source)
        begin
          result = yield @source_report
        ensure
          @app_report.reports << @source_report
          @source_report = nil
        end
        result
      end
def report_source ( source ) raise ReportingError . new ( "Cannot call report_source with active source context" ) unless @source_report . nil? raise ReportingError . new ( "Call report_app before report_source" ) if @app_report . nil? result = nil @source_report = Report . new ( name : [ @app_report . name , source . class . type ] . join ( "." ) , target : source ) begin result = yield @source_report ensure @app_report . reports << @source_report @source_report = nil end result end
Generate a report for a licensed dependency source enumerator
Yields a report object which can be used to view or add
data generated for this dependency source
Generate a report for a licensed dependency source enumerator Yields a report object which can be used to view or add data generated for this dependency source
source
<not_specific>