Sha256: 532fcacadf2282b0ee7ea09a1f82f6e08ded1bb7d19efcc1c92a43d3de430133

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

class Love
  class Gem

    attr_reader :name, :authors, :plain_authors, :spec

    def initialize(spec, fetch = true)
      @spec = spec
      @name = spec.name
      @plain_authors = spec.authors
      @authors = []
      fetch_authors if fetch
    end

    def fetch_authors
      plain_authors.each do |name|
        person = Person.new(name)
        person.add_gem self
        add_author person
      end
    end

    def add_author(author)
      @authors << author
    end

    def thanks
      who = \
        if authors.count > 1
          "these cool and creative people: #{authors.map(&:name).join(', ')}"
        else
          "this cool and creative person #{authors.first.name}"
        end
      what = "this awesome gem - #{name}"
    end

    class << self

      def create_file
        thanks = \
          if by_gemname
            thanks_by_gemname
          else
            thanks_by_author
          end
        b = binding
        File.open('./LOVE.md', 'w+') do |f|
          f.write ERB.new(TEMPLATE_MD).result(b)
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
share_some_love-0.0.5 tmp/lib/love/gem.rb