GitHub PullRequestReviewCommentEvent at 2014-09-19 09:04:33
Repository: ontohub
Actor: houndci
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/ontohub/ontohub/pulls/comments/17775329","id":17775329,"diff_hunk":"@@ -0,0 +1,364 @@\n+#!/usr/bin/env ruby\n+\n+require 'active_support'\n+require 'fileutils'\n+require 'pathname'\n+\n+module RenameRefactor\n+\n+  AFFECTED_FILETYPES = %w[\n+    rb\n+    js\n+    coffee\n+    html\n+    haml\n+    erb\n+    css\n+    sass\n+    scss\n+    yml\n+  ]\n+\n+  DIRECTORIES = %w[\n+    app\n+    config\n+    git\n+    lib\n+    spec\n+    test\n+  ]\n+\n+  REPLACE_WORDS = {\n+    'entity' => 'symbol',\n+    'link' => 'mapping',\n+  }\n+\n+  class RenameRefactorProvider\n+    include ActiveSupport::Inflector\n+\n+    attr_accessor :verbose, :dry_run\n+\n+    def initialize(verbose: false, dry_run: true)\n+      self.verbose = verbose\n+      self.dry_run = dry_run\n+    end\n+\n+    def run\n+      REPLACE_WORDS.each { |old_word, new_word| replace old_word, new_word }\n+    end\n+\n+    def replace(old_word, new_word)\n+      affected_files.each do |file|\n+        replace_in_file(file, old_word, new_word)\n+        rename_file(file, old_word, new_word)\n+      end\n+    end\n+\n+    def replace_in_file(file, old_word, new_word)\n+      commands = [\n+        \"gsub(\\\"#{old_word}\\\",\\\"#{new_word}\\\")\",\n+        \"gsub(\\\"#{pluralize(old_word)}\\\",\\\"#{pluralize(new_word)}\\\")\",\n+        \"gsub(\\\"#{camelize(old_word)}\\\",\\\"#{camelize(new_word)}\\\")\",\n+        \"gsub(\\\"#{camelize(pluralize(old_word))}\\\",\\\"#{camelize(pluralize(new_word))}\\\")\",\n+      ]\n+      tmp_file = \"> /tmp/awk_tmp_file && mv /tmp/awk_tmp_file #{file}\"\n+      command = \"#{awk} '{#{commands.join(';')};print}' #{file} #{tmp_file}\"\n+      puts command if verbose\n+      system(command) unless dry_run\n+    end\n+\n+    def rename_file(old_filename, old_word, new_word)\n+      new_filename = old_filename.gsub(/(?<=_|\\b)(#{old_word}|#{pluralize(old_word)})/) do |match|\n+        match == old_word ? new_word : pluralize(new_word)\n+      end\n+      if new_filename != old_filename\n+        puts \"#{old_filename} --> #{new_filename}\" if verbose\n+        if !dry_run\n+          FileUtils.mkdir_p(File.dirname(new_filename))\n+          FileUtils.mv(old_filename, new_filename)\n+        end\n+      end\n+    end\n+\n+    def affected_files\n+      filetype = AFFECTED_FILETYPES.first\n+      out = %x[find #{DIRECTORIES.join(' ')} -iname \"*.#{filetype}\" #{other_filetype_options}]\n+      files = out.lines.map { |l| l.delete(\"\\n\") }\n+    end\n+\n+    def other_filetype_options\n+      AFFECTED_FILETYPES[1..-1].reduce('') do |options, filetype|\n+        options << \"-o -iname \\\"*.#{filetype}\\\" \"\n+      end\n+    end\n+\n+    def awk\n+      'awk'\n+    end\n+\n+  end\n+\n+  class MigrationProvider\n+    include ActiveSupport::Inflector\n+\n+    STRUCTURE_SQL_PATH = Pathname.new('db/structure.sql')\n+    MIGRATION_DIRPATH  = Pathname.new('db/migrate')\n+\n+    attr_accessor :verbose, :dry_run, :migration_commands\n+\n+    def initialize(verbose: false, dry_run: true)\n+      self.verbose = verbose\n+      self.dry_run = dry_run\n+      self.migration_commands = []\n+    end\n+\n+    def run\n+      clean_slate unless dry_run\n+      sql_statements = read_structure_sql\n+\n+      sql_statements.each do |sql_statement|\n+        rename_columns(sql_statement)\n+        rename_table(sql_statement)\n+        rebuild_index(sql_statement)\n+        rename_in_function(sql_statement)\n+        rename_primary_keys(sql_statement)\n+        rebuild_foreign_keys(sql_statement)\n+      end\n+\n+      puts migration_commands.map(&:inspect).join(\"\\n\") if dry_run && verbose\n+      write_migration\n+    end\n+\n+    def clean_slate\n+      puts \"Running rake db:migrate:clean\" if verbose\n+      system('bundle exec rake db:migrate:clean')\n+    end\n+\n+    def read_structure_sql\n+      STRUCTURE_SQL_PATH.readlines(\"\\n\\n\\n\").map do |command|\n+        command.lines.select do |line|\n+          !line.start_with?('--') && line != \"\\n\"\n+        end.join(\"\\n\")\n+      end\n+    end\n+\n+    def commands(sql_statements)\n+      sql_statements.map do |statement|\n+        statement.split(' ')[0..1].join(' ')\n+      end.uniq\n+    end\n+\n+    def rename_in_function(sql_statement)\n+      if m = sql_statement.match(/^\\s*CREATE FUNCTION (?<signature>.+?\\))(?<header>.+?)(\\s*LANGUAGE (?<language>.+?))\\s*AS\\s+(?<name>.+?)\\s*BEGIN\\s+(?<body>.+?)\\s*END;/m)\n+\n+        translated = [m[:signature],m[:header], m[:name], m[:body]].map { |t| translate t }\n+        if translated.any?\n+          new_signature = translate(m[:signature]) || m[:signature]\n+          new_header = translate(m[:header]) || m[:header]\n+          new_name = translate(m[:name]) || m[:name]\n+          new_body = translate(m[:body]) || m[:body]\n+\n+          drop_old_function = <<-DROP_FUNCTION\n+      DROP FUNCTION #{m[:signature]};\n+    DROP_FUNCTION\n+\n+          drop_new_function = <<-DROP_FUNCTION\n+      DROP FUNCTION #{new_signature};\n+    DROP_FUNCTION\n+\n+          create_old_function = <<-CREATE_FUNCTION\n+      CREATE OR REPLACE FUNCTION #{m[:signature]}\n+      #{m[:header]} AS #{m[:name]}\n+      BEGIN\n+      #{m[:body]}\n+      END;\n+      #{m[:name]} language #{m[:language]};\n+    CREATE_FUNCTION\n+\n+          create_new_function = <<-CREATE_FUNCTION\n+      CREATE OR REPLACE FUNCTION #{new_signature}\n+      #{new_header} AS #{m[:name]}\n+      BEGIN\n+      #{new_body}\n+      END;\n+      #{new_name} language #{m[:language]};\n+    CREATE_FUNCTION\n+\n+          push(:up, \"execute <<-SQL\\n#{drop_old_function}    SQL\\n\")\n+          push(:up, \"execute <<-SQL\\n#{create_new_function}    SQL\\n\")\n+\n+          push(:down, \"execute <<-SQL\\n#{drop_new_function}    SQL\\n\")\n+          push(:down, \"execute <<-SQL\\n#{create_old_function}    SQL\\n\")\n+        end\n+      end\n+    end\n+\n+    def rename_table(sql_statement)\n+      if sql_statement =~ /^\\s*CREATE TABLE (\\S+)/\n+        old_name = $1\n+        if new_name = translate(old_name)\n+          push(:up, \"rename_table '#{old_name}', '#{new_name}'\")\n+          push(:down, \"rename_table '#{new_name}', '#{old_name}'\")\n+        end\n+      end\n+    end\n+\n+    def rename_columns(sql_statement)\n+      if sql_statement =~ /^\\s*CREATE TABLE (\\S+)/\n+        table_name = $1\n+        sql_statement.lines[1..-2].each do |column_line|\n+          if column_line =~ /^\\s+(\\S+)\\s+/\n+            column_name = $1\n+            if new_column_name = translate(column_name)\n+              push(:up, \"rename_column '#{table_name}', '#{column_name}', '#{new_column_name}'\")\n+              push(:down, \"rename_column '#{table_name}', '#{new_column_name}', '#{column_name}'\")\n+            end\n+          end\n+        end\n+      end\n+    end\n+\n+    def rebuild_index(sql_statement)\n+      if m = sql_statement.match(/^\\s*CREATE (?<unique>UNIQUE )?INDEX (?<index_name>\\S+) ON (?<table_name>\\S+) USING btree \\((?<columns_list>([^,\\s]+, )*(\\S+))\\)/)\n+        unique = !! m['unique']\n+\n+        old_index_name = m['index_name']\n+        new_index_name = translate(old_index_name)\n+        index_name = new_index_name || old_index_name\n+\n+        old_table_name = m['table_name']\n+        new_table_name = translate(old_table_name)\n+        table_name = new_table_name || old_table_name\n+\n+        old_columns = m['columns_list'].split(', ')\n+        new_columns = old_columns.map{ |c| translate(c) }\n+\n+        old_column_names = old_columns.map{ |c| \"'#{c}'\"}.join(', ')\n+        column_names = old_columns.map{ |c| \"'#{translate(c) || c}'\" }.join(', ')\n+\n+        if [new_index_name, new_table_name, *new_columns].any?\n+          # At this point, the index is already on the new table, but with the old name\n+          push(:up, \"remove_index '#{table_name}', name: '#{old_index_name}'\")\n+          push(:down, \"add_index '#{old_table_name}', [#{old_column_names}], unique: #{unique}, name: '#{old_index_name}'\")\n+\n+          push(:up, \"add_index '#{table_name}', [#{column_names}], unique: #{unique}, name: '#{index_name}'\")\n+          push(:down, \"remove_index '#{old_table_name}', name: '#{index_name}'\")\n+        end\n+      end\n+    end\n+\n+    def rename_primary_keys(sql_statement)\n+      if m = sql_statement.match(/ALTER TABLE ONLY (?<table>\\S+)\\s*ADD CONSTRAINT (?<name>\\S+)\\s+PRIMARY KEY/)\n+\n+        table = translate(m[:table]) || m[:table]\n+        new_name = translate(m[:name])\n+\n+        if new_name\n+          push(:up,   \"execute \\\"ALTER TABLE ONLY #{table} RENAME CONSTRAINT #{m[:name]} TO #{new_name};\\\"\")\n+          push(:down, \"execute \\\"ALTER TABLE ONLY #{table} RENAME CONSTRAINT #{new_name} TO #{m[:name]};\\\"\")\n+        end\n+      end\n+    end\n+\n+    def rebuild_foreign_keys(sql_statement)\n+      if m = sql_statement.match(/ALTER TABLE ONLY (?<table>\\S+)\\s*ADD CONSTRAINT (?<name>\\S+)\\s+FOREIGN KEY \\((?<key>\\S+)\\)\\s+REFERENCES (?<ref>\\S+\\(\\S+\\))(?<ondelete>[^\\n]*)/)\n+\n+        table = translate(m[:table]) || m[:table]\n+        new_name = translate(m[:name]) || m[:name]\n+        new_key = translate(m[:key]) || m[:key]\n+        new_ref = translate(m[:ref]) || m[:ref]\n+\n+        translated = [m[:name], m[:key], m[:ref]].map { |t| translate(t) }\n+\n+        if translated.any?\n+          push(:up,   \"execute \\\"ALTER TABLE ONLY #{table} DROP CONSTRAINT #{m[:name]};\\\"\")\n+          push(:up,   \"execute \\\"ALTER TABLE ONLY #{table} ADD CONSTRAINT #{new_name} FOREIGN KEY (#{new_key}) REFERENCES #{new_ref}#{m[:ondelete]}\\\"\")\n+\n+          push(:down, \"execute \\\"ALTER TABLE ONLY #{table} DROP CONSTRAINT #{new_name};\\\"\")\n+          push(:down, \"execute \\\"ALTER TABLE ONLY #{table} ADD CONSTRAINT #{m[:name]} FOREIGN KEY (#{m[:key]}) REFERENCES #{m[:ref]}#{m[:ondelete]}\\\"\")\n+        end\n+      end\n+    end\n+\n+    def write_migration\n+      migration_filepath.open('w') do |f|\n+        f << \"class RenameViaScript < ActiveRecord::Migration\\n\"\n+        migration_commands.group_by{ |c| c.first }.each do |method_name, commands|\n+          f << \"  def #{method_name}\\n\"\n+          commands.each do |(_, command)|\n+            f << \"    #{command}\\n\"\n+          end\n+          f << \"  end\\n\"\n+        end\n+        f << \"end\\n\\n\"\n+      end\n+    end\n+\n+    def translate(name)\n+      REPLACE_WORDS.each do |old_name, new_name|\n+        result = name.dup\n+        if result.match /#{old_name}/\n+          result.gsub!($&, new_name)\n+        end\n+        if result.match /#{pluralize(old_name)}/\n+          result.gsub!($&, pluralize(new_name))\n+        end\n+        if result.match /#{camelize(old_name)}/\n+          result.gsub!($&, camelize(new_name))\n+        end\n+        if result.match /#{camelize(pluralize(old_name))}/\n+          result.gsub!($&, camelize(pluralize(new_name)))\n+        end\n+        return result if result != name\n+      end\n+      nil\n+    end\n+\n+    def push(*args)\n+      migration_commands << args\n+    end\n+\n+    def migration_filepath\n+      MIGRATION_DIRPATH.join(\"#{Time.now.utc.strftime(\"%Y%m%d%H%M%S\")}_rename_via_script.rb\")\n+    end\n+  end\n+\n+  class FactoryFilesRenameProvider\n+    attr_accessor :verbose, :dry_run\n+\n+    DIR = Pathname.new(File.join('test', 'factories'))\n+\n+    def initialize(verbose: false, dry_run: true)\n+      self.verbose = verbose\n+      self.dry_run = dry_run\n+    end\n+\n+    def run\n+      files_list.each do |filename|\n+        rename_file(filename)\n+      end\n+    end\n+\n+    def files_list\n+      Dir.entries(DIR).select { |e| !%w(. ..).include?(e) }\n+    end\n+\n+    def rename_file(filename)\n+      puts \"#{DIR.join(filename)} --> #{DIR.join(new_name(filename))}\" if verbose\n+      FileUtils.mv(DIR.join(filename), DIR.join(new_name(filename))) unless dry_run\n+    end\n+\n+    def new_name(filename)\n+      parts = filename.split('.')\n+      basename = \"#{parts.first}_factory\"\n+      [basename, *parts[1..-1]].join('.')","path":"script/rename_refactor.rb","position":354,"original_position":354,"commit_id":"7ac5b084aab0ce02d8febb57927abad9365f775c","original_commit_id":"7ac5b084aab0ce02d8febb57927abad9365f775c","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=2","gravatar_id":"38d9cefd9971a05bf447f07c6cd332cc","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":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2014-09-19T09:04:33Z","updated_at":"2014-09-19T09:04:33Z","html_url":"https://github.com/ontohub/ontohub/pull/1046#discussion_r17775329","pull_request_url":"https://api.github.com/repos/ontohub/ontohub/pulls/1046","_links":{"self":{"href":"https://api.github.com/repos/ontohub/ontohub/pulls/comments/17775329"},"html":{"href":"https://github.com/ontohub/ontohub/pull/1046#discussion_r17775329"},"pull_request":{"href":"https://api.github.com/repos/ontohub/ontohub/pulls/1046"}}},"pull_request":{"url":"https://api.github.com/repos/ontohub/ontohub/pulls/1046","id":21485606,"html_url":"https://github.com/ontohub/ontohub/pull/1046","diff_url":"https://github.com/ontohub/ontohub/pull/1046.diff","patch_url":"https://github.com/ontohub/ontohub/pull/1046.patch","issue_url":"https://api.github.com/repos/ontohub/ontohub/issues/1046","number":1046,"state":"open","locked":false,"title":"455 script for model name changing","user":{"login":"eugenk","id":339751,"avatar_url":"https://avatars.githubusercontent.com/u/339751?v=2","gravatar_id":"1b777dd0f315bb88d60e3a62fc7348f1","url":"https://api.github.com/users/eugenk","html_url":"https://github.com/eugenk","followers_url":"https://api.github.com/users/eugenk/followers","following_url":"https://api.github.com/users/eugenk/following{/other_user}","gists_url":"https://api.github.com/users/eugenk/gists{/gist_id}","starred_url":"https://api.github.com/users/eugenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugenk/subscriptions","organizations_url":"https://api.github.com/users/eugenk/orgs","repos_url":"https://api.github.com/users/eugenk/repos","events_url":"https://api.github.com/users/eugenk/events{/privacy}","received_events_url":"https://api.github.com/users/eugenk/received_events","type":"User","site_admin":false},"body":"This script renames\r\n* words in the code\r\n* code files\r\n* everything in the database by creating a new migration file\r\n * tables\r\n * columns\r\n * indexes\r\n * functions\r\n * words in function bodies\r\n* factory files (appends _factory) to the filename\r\n\r\nI only tested if the migrations can be executed. After running this script, we need to check the renames manually. It will rename more than it is supposed to. I *think* that it won't refrain renaming what needs to be renamed, but we should have an eye on that, too.","created_at":"2014-09-19T09:04:23Z","updated_at":"2014-09-19T09:04:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41af73606a9c76858c59808400a2cd094f9de7b6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ontohub/ontohub/pulls/1046/commits","review_comments_url":"https://api.github.com/repos/ontohub/ontohub/pulls/1046/comments","review_comment_url":"https://api.github.com/repos/ontohub/ontohub/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ontohub/ontohub/issues/1046/comments","statuses_url":"https://api.github.com/repos/ontohub/ontohub/statuses/7ac5b084aab0ce02d8febb57927abad9365f775c","head":{"label":"ontohub:455-script_for_model_name_changing","ref":"455-script_for_model_name_changing","sha":"7ac5b084aab0ce02d8febb57927abad9365f775c","user":{"login":"ontohub","id":1575984,"avatar_url":"https://avatars.githubusercontent.com/u/1575984?v=2","gravatar_id":"a7f409f3674b52f44a0c6aa8dbef61d1","url":"https://api.github.com/users/ontohub","html_url":"https://github.com/ontohub","followers_url":"https://api.github.com/users/ontohub/followers","following_url":"https://api.github.com/users/ontohub/following{/other_user}","gists_url":"https://api.github.com/users/ontohub/gists{/gist_id}","starred_url":"https://api.github.com/users/ontohub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ontohub/subscriptions","organizations_url":"https://api.github.com/users/ontohub/orgs","repos_url":"https://api.github.com/users/ontohub/repos","events_url":"https://api.github.com/users/ontohub/events{/privacy}","received_events_url":"https://api.github.com/users/ontohub/received_events","type":"Organization","site_admin":false},"repo":{"id":3643206,"name":"ontohub","full_name":"ontohub/ontohub","owner":{"login":"ontohub","id":1575984,"avatar_url":"https://avatars.githubusercontent.com/u/1575984?v=2","gravatar_id":"a7f409f3674b52f44a0c6aa8dbef61d1","url":"https://api.github.com/users/ontohub","html_url":"https://github.com/ontohub","followers_url":"https://api.github.com/users/ontohub/followers","following_url":"https://api.github.com/users/ontohub/following{/other_user}","gists_url":"https://api.github.com/users/ontohub/gists{/gist_id}","starred_url":"https://api.github.com/users/ontohub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ontohub/subscriptions","organizations_url":"https://api.github.com/users/ontohub/orgs","repos_url":"https://api.github.com/users/ontohub/repos","events_url":"https://api.github.com/users/ontohub/events{/privacy}","received_events_url":"https://api.github.com/users/ontohub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ontohub/ontohub","description":"A web-based repository for distributed ontologies.","fork":false,"url":"https://api.github.com/repos/ontohub/ontohub","forks_url":"https://api.github.com/repos/ontohub/ontohub/forks","keys_url":"https://api.github.com/repos/ontohub/ontohub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ontohub/ontohub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ontohub/ontohub/teams","hooks_url":"https://api.github.com/repos/ontohub/ontohub/hooks","issue_events_url":"https://api.github.com/repos/ontohub/ontohub/issues/events{/number}","events_url":"https://api.github.com/repos/ontohub/ontohub/events","assignees_url":"https://api.github.com/repos/ontohub/ontohub/assignees{/user}","branches_url":"https://api.github.com/repos/ontohub/ontohub/branches{/branch}","tags_url":"https://api.github.com/repos/ontohub/ontohub/tags","blobs_url":"https://api.github.com/repos/ontohub/ontohub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ontohub/ontohub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ontohub/ontohub/git/refs{/sha}","trees_url":"https://api.github.com/repos/ontohub/ontohub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ontohub/ontohub/statuses/{sha}","languages_url":"https://api.github.com/repos/ontohub/ontohub/languages","stargazers_url":"https://api.github.com/repos/ontohub/ontohub/stargazers","contributors_url":"https://api.github.com/repos/ontohub/ontohub/contributors","subscribers_url":"https://api.github.com/repos/ontohub/ontohub/subscribers","subscription_url":"https://api.github.com/repos/ontohub/ontohub/subscription","commits_url":"https://api.github.com/repos/ontohub/ontohub/commits{/sha}","git_commits_url":"https://api.github.com/repos/ontohub/ontohub/git/commits{/sha}","comments_url":"https://api.github.com/repos/ontohub/ontohub/comments{/number}","issue_comment_url":"https://api.github.com/repos/ontohub/ontohub/issues/comments/{number}","contents_url":"https://api.github.com/repos/ontohub/ontohub/contents/{+path}","compare_url":"https://api.github.com/repos/ontohub/ontohub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ontohub/ontohub/merges","archive_url":"https://api.github.com/repos/ontohub/ontohub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ontohub/ontohub/downloads","issues_url":"https://api.github.com/repos/ontohub/ontohub/issues{/number}","pulls_url":"https://api.github.com/repos/ontohub/ontohub/pulls{/number}","milestones_url":"https://api.github.com/repos/ontohub/ontohub/milestones{/number}","notifications_url":"https://api.github.com/repos/ontohub/ontohub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ontohub/ontohub/labels{/name}","releases_url":"https://api.github.com/repos/ontohub/ontohub/releases{/id}","created_at":"2012-03-06T22:05:27Z","updated_at":"2014-09-02T10:07:12Z","pushed_at":"2014-09-18T18:33:18Z","git_url":"git://github.com/ontohub/ontohub.git","ssh_url":"git@github.com:ontohub/ontohub.git","clone_url":"https://github.com/ontohub/ontohub.git","svn_url":"https://github.com/ontohub/ontohub","homepage":"","size":38611,"stargazers_count":17,"watchers_count":17,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":288,"forks":4,"open_issues":288,"watchers":17,"default_branch":"staging"}},"base":{"label":"ontohub:staging","ref":"staging","sha":"63c0df8296fa33ccdfb1c5f57fd1a2309e3c4c45","user":{"login":"ontohub","id":1575984,"avatar_url":"https://avatars.githubusercontent.com/u/1575984?v=2","gravatar_id":"a7f409f3674b52f44a0c6aa8dbef61d1","url":"https://api.github.com/users/ontohub","html_url":"https://github.com/ontohub","followers_url":"https://api.github.com/users/ontohub/followers","following_url":"https://api.github.com/users/ontohub/following{/other_user}","gists_url":"https://api.github.com/users/ontohub/gists{/gist_id}","starred_url":"https://api.github.com/users/ontohub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ontohub/subscriptions","organizations_url":"https://api.github.com/users/ontohub/orgs","repos_url":"https://api.github.com/users/ontohub/repos","events_url":"https://api.github.com/users/ontohub/events{/privacy}","received_events_url":"https://api.github.com/users/ontohub/received_events","type":"Organization","site_admin":false},"repo":{"id":3643206,"name":"ontohub","full_name":"ontohub/ontohub","owner":{"login":"ontohub","id":1575984,"avatar_url":"https://avatars.githubusercontent.com/u/1575984?v=2","gravatar_id":"a7f409f3674b52f44a0c6aa8dbef61d1","url":"https://api.github.com/users/ontohub","html_url":"https://github.com/ontohub","followers_url":"https://api.github.com/users/ontohub/followers","following_url":"https://api.github.com/users/ontohub/following{/other_user}","gists_url":"https://api.github.com/users/ontohub/gists{/gist_id}","starred_url":"https://api.github.com/users/ontohub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ontohub/subscriptions","organizations_url":"https://api.github.com/users/ontohub/orgs","repos_url":"https://api.github.com/users/ontohub/repos","events_url":"https://api.github.com/users/ontohub/events{/privacy}","received_events_url":"https://api.github.com/users/ontohub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ontohub/ontohub","description":"A web-based repository for distributed ontologies.","fork":false,"url":"https://api.github.com/repos/ontohub/ontohub","forks_url":"https://api.github.com/repos/ontohub/ontohub/forks","keys_url":"https://api.github.com/repos/ontohub/ontohub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ontohub/ontohub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ontohub/ontohub/teams","hooks_url":"https://api.github.com/repos/ontohub/ontohub/hooks","issue_events_url":"https://api.github.com/repos/ontohub/ontohub/issues/events{/number}","events_url":"https://api.github.com/repos/ontohub/ontohub/events","assignees_url":"https://api.github.com/repos/ontohub/ontohub/assignees{/user}","branches_url":"https://api.github.com/repos/ontohub/ontohub/branches{/branch}","tags_url":"https://api.github.com/repos/ontohub/ontohub/tags","blobs_url":"https://api.github.com/repos/ontohub/ontohub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ontohub/ontohub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ontohub/ontohub/git/refs{/sha}","trees_url":"https://api.github.com/repos/ontohub/ontohub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ontohub/ontohub/statuses/{sha}","languages_url":"https://api.github.com/repos/ontohub/ontohub/languages","stargazers_url":"https://api.github.com/repos/ontohub/ontohub/stargazers","contributors_url":"https://api.github.com/repos/ontohub/ontohub/contributors","subscribers_url":"https://api.github.com/repos/ontohub/ontohub/subscribers","subscription_url":"https://api.github.com/repos/ontohub/ontohub/subscription","commits_url":"https://api.github.com/repos/ontohub/ontohub/commits{/sha}","git_commits_url":"https://api.github.com/repos/ontohub/ontohub/git/commits{/sha}","comments_url":"https://api.github.com/repos/ontohub/ontohub/comments{/number}","issue_comment_url":"https://api.github.com/repos/ontohub/ontohub/issues/comments/{number}","contents_url":"https://api.github.com/repos/ontohub/ontohub/contents/{+path}","compare_url":"https://api.github.com/repos/ontohub/ontohub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ontohub/ontohub/merges","archive_url":"https://api.github.com/repos/ontohub/ontohub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ontohub/ontohub/downloads","issues_url":"https://api.github.com/repos/ontohub/ontohub/issues{/number}","pulls_url":"https://api.github.com/repos/ontohub/ontohub/pulls{/number}","milestones_url":"https://api.github.com/repos/ontohub/ontohub/milestones{/number}","notifications_url":"https://api.github.com/repos/ontohub/ontohub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ontohub/ontohub/labels{/name}","releases_url":"https://api.github.com/repos/ontohub/ontohub/releases{/id}","created_at":"2012-03-06T22:05:27Z","updated_at":"2014-09-02T10:07:12Z","pushed_at":"2014-09-18T18:33:18Z","git_url":"git://github.com/ontohub/ontohub.git","ssh_url":"git@github.com:ontohub/ontohub.git","clone_url":"https://github.com/ontohub/ontohub.git","svn_url":"https://github.com/ontohub/ontohub","homepage":"","size":38611,"stargazers_count":17,"watchers_count":17,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":288,"forks":4,"open_issues":288,"watchers":17,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/ontohub/ontohub/pulls/1046"},"html":{"href":"https://github.com/ontohub/ontohub/pull/1046"},"issue":{"href":"https://api.github.com/repos/ontohub/ontohub/issues/1046"},"comments":{"href":"https://api.github.com/repos/ontohub/ontohub/issues/1046/comments"},"review_comments":{"href":"https://api.github.com/repos/ontohub/ontohub/pulls/1046/comments"},"review_comment":{"href":"https://api.github.com/repos/ontohub/ontohub/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ontohub/ontohub/pulls/1046/commits"},"statuses":{"href":"https://api.github.com/repos/ontohub/ontohub/statuses/7ac5b084aab0ce02d8febb57927abad9365f775c"}}}}