Sha256: 2d1143bd201c11dbae10a09d992776effab4fd8a578e164c9beb4276fcfaea0c

Contents?: true

Size: 974 Bytes

Versions: 1

Compression:

Stored size: 974 Bytes

Contents

#!/usr/bin/env ruby

require "bundler/setup"
require "elos"

def versions(version_string)
  vers = version_string.split('.').map(&:to_i)
  fail 'Invalid version format!' unless vers.length == 3
  vers
end

def later_version!(vers1, vers2)
  [vers1, vers2].transpose.each do |ver1, ver2|
    return if ver1 > ver2
    fail 'Not later version!' if ver1 < ver2
  end
  fail 'Not later version!'
end

specified_vers = versions(ARGV[0]) if ARGV.length > 0
vers = versions(Elos::VERSION)
specified_vers ||=
  begin
    r = vers.dup
    r[2] = r[2] + 1
    r
  end

later_version!(specified_vers, vers)

path = File.expand_path('../..', __FILE__)
new_ver = specified_vers.join('.')
`sed -i -e 's/#{Elos::VERSION}/#{new_ver}/g' #{path}/lib/elos/version.rb`
`git add --all`
`git commit -m 'version #{new_ver}'`
`git push origin master`
`git tag #{new_ver}`
`git push origin #{new_ver}`
`gem build elos.gemspec`
puts "gem push elos-#{new_ver}.gem"
`gem push elos-#{new_ver}.gem 2>&1`

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
elos-1.0.7 bin/push