Sha256: a1a43860f26424d3ae3e8edaa2c859c1108cc4d4cec6198521b838cdc714aa1a

Contents?: true

Size: 986 Bytes

Versions: 7

Compression:

Stored size: 986 Bytes

Contents

class Jeweler
  module Commands
    class WriteGemspec
      attr_accessor :base_dir, :gemspec, :version, :output, :gemspec_helper, :version_helper

      def initialize
        self.output = $stdout
      end

      def run
        gemspec_helper.spec.version ||= begin
          version_helper.refresh
          version_helper.to_s
        end

        gemspec_helper.spec.date    = Time.now
        gemspec_helper.write

        output.puts "Generated: #{gemspec_helper.path}"  
      end

      def gemspec_helper
        @gemspec_helper ||= GemSpecHelper.new(self.gemspec, self.base_dir)
      end

      def self.build_for(jeweler)
        command = new

        command.base_dir = jeweler.base_dir
        command.gemspec = jeweler.gemspec
        command.version = jeweler.version
        command.output = jeweler.output
        command.gemspec_helper = jeweler.gemspec_helper
        command.version_helper = jeweler.version_helper

        command
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
jeweler-1.5.1 lib/jeweler/commands/write_gemspec.rb
jeweler-1.5.0 lib/jeweler/commands/write_gemspec.rb
jeweler-1.5.0.pre6 lib/jeweler/commands/write_gemspec.rb
jeweler-1.5.0.pre5 lib/jeweler/commands/write_gemspec.rb
jeweler-1.5.0.pre4 lib/jeweler/commands/write_gemspec.rb
jeweler-1.5.0.pre3 lib/jeweler/commands/write_gemspec.rb
jeweler-1.5.0.pre2 lib/jeweler/commands/write_gemspec.rb