lib/semvergen/shell.rb in semvergen-1.1.0 vs lib/semvergen/shell.rb in semvergen-1.2.0

- old
+ new

@@ -8,19 +8,36 @@ def git_index_dirty? execute("git status --porcelain") =~ /^\s*(D|M|A|R|C)\s/ end + def current_branch + execute("git symbolic-ref --short HEAD").strip + end + + def git_fetch + `git fetch -q` + end + + def git_branch_is_tracking? + `git rev-list HEAD..@{u} --count` and return $?.exitstatus == 0 + end + + def git_up_to_date? + `git rev-list HEAD..@{u} --count`.strip.to_i == 0 + end + def commit(version_path, new_version, commit_subject, features) commit_body = COMMIT_MESSAGE % [new_version, commit_subject, features.join("\n")] execute "git add CHANGELOG.md" execute "git add #{version_path}" execute %Q[git commit -m "#{commit_body}"] + execute %Q[git tag #{new_version} -m "Version: #{new_version} - #{commit_subject}"] end - def push(remote_name="origin", branch_name="master") - execute "git push #{remote_name} #{branch_name}" + def push(new_version, remote_name="origin", branch_name="master") + execute "git push -q #{remote_name} #{branch_name} #{new_version}" end def build_gem(gem_name) execute "gem build #{gem_name}.gemspec --force" end \ No newline at end of file