Sha256: af011e739d7ce248f2bc130f91b39920f2b1c607e03532244797048886b5b0ca

Contents?: true

Size: 751 Bytes

Versions: 9

Compression:

Stored size: 751 Bytes

Contents

class Gem::Comparator
  class Report
    class Entry
      include Gem::UserInteraction

      attr_accessor :data, :indent

      def initialize(data = '', indent = '')
        @data = data
        @indent = indent
      end

      def set_indent!(indent)
        @indent = indent
        self
      end

      def empty?
        case @data
        when String, Array
          @data.empty?
        end
      end

      def print
        printed = case @data
                  when String
                    "#{@indent}#{@data}"
                  when Array
                    @indent + @data.join("\n#{@indent}")
                  else
                    "#{@indent}#{@data}"
                  end
        say printed
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gem-compare-1.2.1 lib/rubygems/comparator/report/entry.rb
gem-compare-1.2.0 lib/rubygems/comparator/report/entry.rb
gem-compare-1.1.0 lib/rubygems/comparator/report/entry.rb
gem-compare-1.0.0 lib/rubygems/comparator/report/entry.rb
gem-compare-0.0.7 lib/rubygems/comparator/report/entry.rb
gem-compare-0.0.6 lib/rubygems/comparator/report/entry.rb
gem-compare-0.0.5 lib/rubygems/comparator/report/entry.rb
gem-compare-0.0.4 lib/rubygems/comparator/report/entry.rb
gem-compare-0.0.3 lib/rubygems/comparator/report/entry.rb