tasks/github-gem.rake in wvanbergen-scoped_search-1.2.0 vs tasks/github-gem.rake in wvanbergen-scoped_search-2.0.0
- old
+ new
@@ -95,11 +95,11 @@
end
protected
def has_rdoc?
- @specification.has_rdoc
+ branch_exist?('gh-pages')
end
def has_specs?
Dir['spec/**/*_spec.rb'].any?
end
@@ -166,10 +166,15 @@
def verify_current_branch(branch)
run_command('git branch').detect { |line| /^\* (.+)/ =~ line }
raise "You are currently not working in the master branch!" unless branch == $1
end
+
+ def branch_exist?(branch)
+ run_command('git branch').any? { |line| line.split(' ').last == branch }
+ end
+
def verify_clean_status(on_branch = nil)
sh "git fetch"
lines = run_command('git status')
raise "You don't have the most recent version available. Run git pull first." if /^\# Your branch is behind/ =~ lines[1]
@@ -230,13 +235,13 @@
sh "gem uninstall #{name}"
end
def create_version_tag!
# commit the gemspec file
- git_commit_file(gemspec_file, "Released #{@name} version #{@specification.version}") if git_modified?(gemspec_file)
+ git_commit_file(gemspec_file, "Updated #{gemspec_file} for release of version #{@specification.version}") if git_modified?(gemspec_file)
# create tag and push changes
- git_create_tag("#{@name}-#{@specification.version}", "Tagged #{@name} version #{@specification.version}")
+ git_create_tag("#{@name}-#{@specification.version}", "Tagged version #{@specification.version}")
git_push('origin', 'master', [:tags])
end
def release_task
puts
\ No newline at end of file