{"action":"created","comment":{"url":"https://api.github.com/repos/SUSE/pennyworth/pulls/comments/31129480","id":31129480,"diff_hunk":"@@ -0,0 +1,101 @@\n+# encoding:utf-8\n+\n+# Copyright (c) 2013-2015 SUSE LLC\n+#\n+# This program is free software; you can redistribute it and/or\n+# modify it under the terms of version 3 of the GNU General Public License as\n+# published by the Free Software Foundation.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program; if not, contact SUSE LLC.\n+#\n+# To contact SUSE about this file by physical or electronic mail,\n+# you may find current contact information at www.suse.com\n+\n+require_relative \"release_checks\"\n+\n+class Release\n+  include ReleaseChecks\n+\n+  def initialize(opts = {})\n+    @options = {\n+      version:      generate_development_version\n+    }.merge(opts)\n+    @release_version = @options[:version]\n+    @tag             = \"v#{@release_version}\"\n+    @release_time    = Time.now.strftime('%a %b %d %H:%M:%S %Z %Y')\n+    @mail            = Cheetah.run([\"git\", \"config\", \"user.email\"], :stdout => :capture).chomp\n+    @gemspec         = Gem::Specification.load(\"pennyworth.gemspec\")\n+  end\n+\n+  # Commit version changes, tag release and push changes upstream.\n+  def publish\n+    set_version\n+    finalize_news_file\n+\n+    commit\n+  end\n+\n+  # Calculates the next version number according to the release type (:major, :minor or :patch)\n+  def self.generate_release_version(release_type)\n+    current_version = Pennyworth::VERSION\n+    major, minor, patch = current_version.scan(/(\\d+)\\.(\\d+)\\.(\\d+)/).first.map(&:to_i)\n+\n+    case release_type\n+    when \"patch\"\n+      patch += 1\n+    when \"minor\"\n+      patch = 0\n+      minor += 1\n+    when \"major\"\n+      patch = 0\n+      minor = 0\n+      major += 1\n+    end\n+\n+    \"#{major}.#{minor}.#{patch}\"\n+  end\n+\n+  private\n+\n+  def set_version\n+    Dir.chdir(Pennyworth::ROOT) do\n+      Cheetah.run \"sed\", \"-i\", \"s/VERSION.*=.*/VERSION = \\\"#{@release_version}\\\"/\", \"lib/pennyworth/version.rb\"\n+    end\n+  end\n+\n+  def finalize_news_file\n+    file = File.join(Pennyworth::ROOT, \"NEWS\")\n+    content = File.read(file)\n+    # All changes for the next release are directly added below the headline\n+    # by the developers without adding a version line.\n+    # Since the version line is automatically added during release by this\n+    # method we can check for new bullet points since the last release.\n+    if content.scan(/# Pennyworth .*$\\n+## Version /).empty?\n+      content = content.sub(/\\n+/, \"\\n\\n\\n## Version #{@release_version} - #{@release_time} - #{@mail}\\n\\n\")","path":"tools/release.rb","position":80,"original_position":80,"commit_id":"5af444aac5fae4360bdf614c4df1b8a20ed467f0","original_commit_id":"5af444aac5fae4360bdf614c4df1b8a20ed467f0","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [108/100]","created_at":"2015-05-27T12:52:22Z","updated_at":"2015-05-27T12:52:22Z","html_url":"https://github.com/SUSE/pennyworth/pull/73#discussion_r31129480","pull_request_url":"https://api.github.com/repos/SUSE/pennyworth/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/SUSE/pennyworth/pulls/comments/31129480"},"html":{"href":"https://github.com/SUSE/pennyworth/pull/73#discussion_r31129480"},"pull_request":{"href":"https://api.github.com/repos/SUSE/pennyworth/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/SUSE/pennyworth/pulls/73","id":36294275,"html_url":"https://github.com/SUSE/pennyworth/pull/73","diff_url":"https://github.com/SUSE/pennyworth/pull/73.diff","patch_url":"https://github.com/SUSE/pennyworth/pull/73.patch","issue_url":"https://api.github.com/repos/SUSE/pennyworth/issues/73","number":73,"state":"open","locked":false,"title":"Add missing info to gemspec","user":{"login":"mauromorales","id":433958,"avatar_url":"https://avatars.githubusercontent.com/u/433958?v=3","gravatar_id":"","url":"https://api.github.com/users/mauromorales","html_url":"https://github.com/mauromorales","followers_url":"https://api.github.com/users/mauromorales/followers","following_url":"https://api.github.com/users/mauromorales/following{/other_user}","gists_url":"https://api.github.com/users/mauromorales/gists{/gist_id}","starred_url":"https://api.github.com/users/mauromorales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mauromorales/subscriptions","organizations_url":"https://api.github.com/users/mauromorales/orgs","repos_url":"https://api.github.com/users/mauromorales/repos","events_url":"https://api.github.com/users/mauromorales/events{/privacy}","received_events_url":"https://api.github.com/users/mauromorales/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-27T11:37:01Z","updated_at":"2015-05-27T12:52:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"998b37589c2246f3e06a53c7936a0386b428128d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SUSE/pennyworth/pulls/73/commits","review_comments_url":"https://api.github.com/repos/SUSE/pennyworth/pulls/73/comments","review_comment_url":"https://api.github.com/repos/SUSE/pennyworth/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SUSE/pennyworth/issues/73/comments","statuses_url":"https://api.github.com/repos/SUSE/pennyworth/statuses/5af444aac5fae4360bdf614c4df1b8a20ed467f0","head":{"label":"SUSE:add_missing_info_to_gemspec","ref":"add_missing_info_to_gemspec","sha":"5af444aac5fae4360bdf614c4df1b8a20ed467f0","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":21424379,"name":"pennyworth","full_name":"SUSE/pennyworth","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/pennyworth","description":"Test framework for running integration tests using virtual machines","fork":false,"url":"https://api.github.com/repos/SUSE/pennyworth","forks_url":"https://api.github.com/repos/SUSE/pennyworth/forks","keys_url":"https://api.github.com/repos/SUSE/pennyworth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/pennyworth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/pennyworth/teams","hooks_url":"https://api.github.com/repos/SUSE/pennyworth/hooks","issue_events_url":"https://api.github.com/repos/SUSE/pennyworth/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/pennyworth/events","assignees_url":"https://api.github.com/repos/SUSE/pennyworth/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/pennyworth/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/pennyworth/tags","blobs_url":"https://api.github.com/repos/SUSE/pennyworth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/pennyworth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/pennyworth/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/pennyworth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/pennyworth/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/pennyworth/languages","stargazers_url":"https://api.github.com/repos/SUSE/pennyworth/stargazers","contributors_url":"https://api.github.com/repos/SUSE/pennyworth/contributors","subscribers_url":"https://api.github.com/repos/SUSE/pennyworth/subscribers","subscription_url":"https://api.github.com/repos/SUSE/pennyworth/subscription","commits_url":"https://api.github.com/repos/SUSE/pennyworth/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/pennyworth/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/pennyworth/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/pennyworth/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/pennyworth/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/pennyworth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/pennyworth/merges","archive_url":"https://api.github.com/repos/SUSE/pennyworth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/pennyworth/downloads","issues_url":"https://api.github.com/repos/SUSE/pennyworth/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/pennyworth/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/pennyworth/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/pennyworth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/pennyworth/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/pennyworth/releases{/id}","created_at":"2014-07-02T13:05:53Z","updated_at":"2015-05-04T07:21:28Z","pushed_at":"2015-05-27T12:52:17Z","git_url":"git://github.com/SUSE/pennyworth.git","ssh_url":"git@github.com:SUSE/pennyworth.git","clone_url":"https://github.com/SUSE/pennyworth.git","svn_url":"https://github.com/SUSE/pennyworth","homepage":null,"size":1881,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":9,"forks":2,"open_issues":9,"watchers":4,"default_branch":"master"}},"base":{"label":"SUSE:master","ref":"master","sha":"a417b173588169609dea76bfbdbbd74644bc6254","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":21424379,"name":"pennyworth","full_name":"SUSE/pennyworth","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/pennyworth","description":"Test framework for running integration tests using virtual machines","fork":false,"url":"https://api.github.com/repos/SUSE/pennyworth","forks_url":"https://api.github.com/repos/SUSE/pennyworth/forks","keys_url":"https://api.github.com/repos/SUSE/pennyworth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/pennyworth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/pennyworth/teams","hooks_url":"https://api.github.com/repos/SUSE/pennyworth/hooks","issue_events_url":"https://api.github.com/repos/SUSE/pennyworth/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/pennyworth/events","assignees_url":"https://api.github.com/repos/SUSE/pennyworth/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/pennyworth/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/pennyworth/tags","blobs_url":"https://api.github.com/repos/SUSE/pennyworth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/pennyworth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/pennyworth/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/pennyworth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/pennyworth/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/pennyworth/languages","stargazers_url":"https://api.github.com/repos/SUSE/pennyworth/stargazers","contributors_url":"https://api.github.com/repos/SUSE/pennyworth/contributors","subscribers_url":"https://api.github.com/repos/SUSE/pennyworth/subscribers","subscription_url":"https://api.github.com/repos/SUSE/pennyworth/subscription","commits_url":"https://api.github.com/repos/SUSE/pennyworth/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/pennyworth/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/pennyworth/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/pennyworth/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/pennyworth/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/pennyworth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/pennyworth/merges","archive_url":"https://api.github.com/repos/SUSE/pennyworth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/pennyworth/downloads","issues_url":"https://api.github.com/repos/SUSE/pennyworth/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/pennyworth/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/pennyworth/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/pennyworth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/pennyworth/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/pennyworth/releases{/id}","created_at":"2014-07-02T13:05:53Z","updated_at":"2015-05-04T07:21:28Z","pushed_at":"2015-05-27T12:52:17Z","git_url":"git://github.com/SUSE/pennyworth.git","ssh_url":"git@github.com:SUSE/pennyworth.git","clone_url":"https://github.com/SUSE/pennyworth.git","svn_url":"https://github.com/SUSE/pennyworth","homepage":null,"size":1881,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":9,"forks":2,"open_issues":9,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SUSE/pennyworth/pulls/73"},"html":{"href":"https://github.com/SUSE/pennyworth/pull/73"},"issue":{"href":"https://api.github.com/repos/SUSE/pennyworth/issues/73"},"comments":{"href":"https://api.github.com/repos/SUSE/pennyworth/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/SUSE/pennyworth/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/SUSE/pennyworth/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SUSE/pennyworth/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/SUSE/pennyworth/statuses/5af444aac5fae4360bdf614c4df1b8a20ed467f0"}}}}