Skip to content

Commit

Permalink
Release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bootstraponline committed Apr 29, 2014
1 parent 0500ca0 commit 7342d45
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
28 changes: 24 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,28 @@ def version
@version = @version || File.read(version_file).match(version_rgx)[1]
end

def bump
def bump value
data = File.read version_file

v_line = data.match version_rgx
d_line = data.match /DATE = '([^']+)'/m
d_line = data.match /\s*DATE\s*=\s*'([^']+)'/m

old_v = v_line[0]
old_d = d_line[0]

old_num = v_line[1]
new_num = old_num.split('.')
new_num[-1] = new_num[-1].to_i + 1

if value == :y
new_num[-1] = 0 # x.y.Z -> x.y.0
new_num[-2] = new_num[-2].to_i + 1 # x.Y -> x.Y+1
elsif value == :x
new_num[-1] = 0 # x.y.Z -> x.y.0
new_num[-2] = 0 # x.Y.z -> x.0.z
new_num[-3]= new_num[-3].to_i + 1
end

new_num = new_num.join '.'

new_v = old_v.sub old_num, new_num
Expand All @@ -43,9 +53,19 @@ def bump
File.write version_file, data
end

desc 'Bump the version number and update the date.'
desc 'Bump the z version number and update the date.'
task :bump do
bump
bump :z
end

desc 'Bump the y version number, set z to zero, update the date.'
task :bumpy do
bump :y
end

desc 'Bump the x version number, set y & z to zero, update the date.'
task :bumpx do
bump :x
end

def tag_exists tag_name
Expand Down
2 changes: 1 addition & 1 deletion appium_console.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |s|
s.require_paths = [ 'lib' ]

# appium_lib version must match ruby console version.
s.add_runtime_dependency 'appium_lib', '>= 0.6.3'
s.add_runtime_dependency 'appium_lib', '>= 1.0.0'
s.add_runtime_dependency 'pry', '~> 0.9.12.5'
s.add_runtime_dependency 'bond', '~> 0.5.0'
s.add_runtime_dependency 'spec', '>= 5.3.3'
Expand Down
4 changes: 2 additions & 2 deletions lib/appium_console/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Define Appium module so version can be required directly.
module Appium; end unless defined? Appium
module Appium::Console
VERSION = '0.6.0' unless defined? ::Appium::Console::VERSION
DATE = '2014-04-22' unless defined? ::Appium::Console::DATE
VERSION = '1.0.0' unless defined? ::Appium::Console::VERSION
DATE = '2014-04-29' unless defined? ::Appium::Console::DATE
end

0 comments on commit 7342d45

Please sign in to comment.