Sha256: ea30d4336c8108d1170a179c375f0c67391c257cc6ff9aa35653fd8d5625968f

Contents?: true

Size: 1.32 KB

Versions: 39

Compression:

Stored size: 1.32 KB

Contents

require File.expand_path('../kernel', __FILE__)
require File.expand_path('../dependency_update', __FILE__)
require File.expand_path('../global/version_file', __FILE__)

module SocialStream
  module Release
    class Global
      include Thor::Actions

      DEPENDENCY_REGEXP = /dependency.*social_stream-(\w*)/

      attr_reader :name, :version

      def initialize(target = nil)
        @target = target
      end
      
      def bump
        bump_version

        update_dependencies
      end

      def publish
        release_cmd rake_release_command
      end

      def dependencies
        @dependencies ||=
          File.read(gemspec).scan(DEPENDENCY_REGEXP).flatten
      end

      def commit_files
        "#{ @version_file.filename } #{ gemspec }"
      end

      def last_tag
        `git describe`.split('-').first
      end

      protected

      def bump_version
        @version = version_file.bump!
      end

      def version_file
        @version_file ||= VersionFile.new(@target)
      end

      def update_dependencies
        dependencies.each do |d|
          DependencyUpdate.new.invoke(:update, [ gemspec, d, Component::VersionFile.new(d).old_number ])
        end
      end

      def gemspec
        "social_stream.gemspec"
      end

      def rake_release_command
        "rake release"
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
social_stream-2.2.2 lib/social_stream/release/global.rb
social_stream-2.2.1 lib/social_stream/release/global.rb
social_stream-2.2.0 lib/social_stream/release/global.rb
social_stream-2.1.1 lib/social_stream/release/global.rb
social_stream-1.1.12 lib/social_stream/release/global.rb
social_stream-2.1.0 lib/social_stream/release/global.rb
social_stream-2.0.4 lib/social_stream/release/global.rb
social_stream-2.0.3 lib/social_stream/release/global.rb
social_stream-1.1.11 lib/social_stream/release/global.rb
social_stream-1.1.10 lib/social_stream/release/global.rb
social_stream-1.1.9 lib/social_stream/release/global.rb
social_stream-1.1.8 lib/social_stream/release/global.rb
social_stream-2.0.2 lib/social_stream/release/global.rb
social_stream-2.0.1 lib/social_stream/release/global.rb
social_stream-2.0.0 lib/social_stream/release/global.rb
social_stream-2.0.0.beta3 lib/social_stream/release/global.rb
social_stream-2.0.0.beta2 lib/social_stream/release/global.rb
social_stream-2.0.0.beta1 lib/social_stream/release/global.rb
social_stream-1.1.7 lib/social_stream/release/global.rb
social_stream-1.1.6 lib/social_stream/release/global.rb