Sha256: c3155711af600af9cfeae1b2c3f7f49b0233fb5fb34e6fa8de0c67a2295be515

Contents?: true

Size: 975 Bytes

Versions: 5

Compression:

Stored size: 975 Bytes

Contents

module Semmy
  module Tasks
    class Versioning < Base
      def define
        namespace 'versioning' do
          task 'remove_development_version_suffix' do
            new_version = VersionString
              .remove_suffix(Project.version, config.development_version_suffix)

            Shell.info("Removing #{config.development_version_suffix} suffix " \
                       'from version.')

            rewrite_gemspec_version(new_version)
          end

          task 'bump_minor' do
            new_version = VersionString
              .bump_minor(Project.version, config.development_version_suffix)

            Shell.info("Bumping version to #{new_version}.")

            rewrite_gemspec_version(new_version)
          end
        end
      end

      private

      def rewrite_gemspec_version(new_version)
        Files.rewrite(VersionFile.find(Gemspec.gem_name),
                      VersionFile::Update.new(new_version))
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
semmy-0.4.0 lib/semmy/tasks/versioning.rb
semmy-0.3.0 lib/semmy/tasks/versioning.rb
semmy-0.2.1 lib/semmy/tasks/versioning.rb
semmy-0.2.0 lib/semmy/tasks/versioning.rb
semmy-0.1.0 lib/semmy/tasks/versioning.rb