{"action":"created","comment":{"url":"https://api.github.com/repos/projecthydra-labs/hybox/pulls/comments/63950475","id":63950475,"diff_hunk":"@@ -0,0 +1,60 @@\n+#!/usr/bin/env ruby\n+\n+def validate_hostname!(hostname)\n+  return if hostname\n+  usage\n+  $stderr.puts 'Please provide the hostname to import to.'\n+  exit(1)\n+end\n+\n+def validate_mods_directory!(mods_directory)\n+  if mods_directory\n+    unless File.exist?(mods_directory)\n+      $stderr.puts \"Directory doesn't exist #{mods_directory}\"\n+      exit(1)\n+    end\n+\n+    unless File.directory?(mods_directory)\n+      $stderr.puts \"#{mods_directory} is not a directory\"\n+      exit(1)\n+    end\n+  else\n+    usage\n+    $stderr.puts 'Please provide the a file path you want to import.'\n+    exit(1)\n+  end\n+end\n+\n+def validate_imagepath!(imagepath)\n+  return if imagepath\n+  usage\n+  $stderr.puts 'Image directory was left blank. No images will be ingested'\n+  exit(1)\n+end\n+\n+def load_rails\n+  puts 'Loading environment...'\n+  require File.expand_path('../../config/environment', __FILE__)\n+  require 'importer'\n+  puts 'Starting import...'\n+end\n+\n+\n+def main(hostname, mods_directory, imagepath)\n+  validate_hostname!(hostname)\n+  validate_mods_directory!(mods_directory)\n+  validate_imagepath!(imagepath)\n+  load_rails\n+\n+  Account.use_account!(hostname)\n+  size = Importer::ModsImporter.new(imagepath, mods_directory).import_all","path":"bin/import_mods_files","position":50,"original_position":50,"commit_id":"642df79122ff188cfdbe22c8a375665214c69500","original_commit_id":"642df79122ff188cfdbe22c8a375665214c69500","user":{"login":"jcoyne","id":92044,"avatar_url":"https://avatars.githubusercontent.com/u/92044?v=3","gravatar_id":"","url":"https://api.github.com/users/jcoyne","html_url":"https://github.com/jcoyne","followers_url":"https://api.github.com/users/jcoyne/followers","following_url":"https://api.github.com/users/jcoyne/following{/other_user}","gists_url":"https://api.github.com/users/jcoyne/gists{/gist_id}","starred_url":"https://api.github.com/users/jcoyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcoyne/subscriptions","organizations_url":"https://api.github.com/users/jcoyne/orgs","repos_url":"https://api.github.com/users/jcoyne/repos","events_url":"https://api.github.com/users/jcoyne/events{/privacy}","received_events_url":"https://api.github.com/users/jcoyne/received_events","type":"User","site_admin":false},"body":"There is a Stanford::ModsParser that is the default parser used by the ModsImporter.  You can also use the vanilla parser if you want.","created_at":"2016-05-19T20:39:34Z","updated_at":"2016-05-19T20:39:34Z","html_url":"https://github.com/projecthydra-labs/hybox/pull/161#discussion_r63950475","pull_request_url":"https://api.github.com/repos/projecthydra-labs/hybox/pulls/161","_links":{"self":{"href":"https://api.github.com/repos/projecthydra-labs/hybox/pulls/comments/63950475"},"html":{"href":"https://github.com/projecthydra-labs/hybox/pull/161#discussion_r63950475"},"pull_request":{"href":"https://api.github.com/repos/projecthydra-labs/hybox/pulls/161"}}},"pull_request":{"url":"https://api.github.com/repos/projecthydra-labs/hybox/pulls/161","id":70419458,"html_url":"https://github.com/projecthydra-labs/hybox/pull/161","diff_url":"https://github.com/projecthydra-labs/hybox/pull/161.diff","patch_url":"https://github.com/projecthydra-labs/hybox/pull/161.patch","issue_url":"https://api.github.com/repos/projecthydra-labs/hybox/issues/161","number":161,"state":"open","locked":false,"title":"MODS importer","user":{"login":"jcoyne","id":92044,"avatar_url":"https://avatars.githubusercontent.com/u/92044?v=3","gravatar_id":"","url":"https://api.github.com/users/jcoyne","html_url":"https://github.com/jcoyne","followers_url":"https://api.github.com/users/jcoyne/followers","following_url":"https://api.github.com/users/jcoyne/following{/other_user}","gists_url":"https://api.github.com/users/jcoyne/gists{/gist_id}","starred_url":"https://api.github.com/users/jcoyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcoyne/subscriptions","organizations_url":"https://api.github.com/users/jcoyne/orgs","repos_url":"https://api.github.com/users/jcoyne/repos","events_url":"https://api.github.com/users/jcoyne/events{/privacy}","received_events_url":"https://api.github.com/users/jcoyne/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-17T19:54:40Z","updated_at":"2016-05-19T20:39:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e59069876e75c74dc5d24d698d31b6460a7d903d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/projecthydra-labs/hybox/pulls/161/commits","review_comments_url":"https://api.github.com/repos/projecthydra-labs/hybox/pulls/161/comments","review_comment_url":"https://api.github.com/repos/projecthydra-labs/hybox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projecthydra-labs/hybox/issues/161/comments","statuses_url":"https://api.github.com/repos/projecthydra-labs/hybox/statuses/642df79122ff188cfdbe22c8a375665214c69500","head":{"label":"projecthydra-labs:import_mods","ref":"import_mods","sha":"642df79122ff188cfdbe22c8a375665214c69500","user":{"login":"projecthydra-labs","id":7377013,"avatar_url":"https://avatars.githubusercontent.com/u/7377013?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra-labs","html_url":"https://github.com/projecthydra-labs","followers_url":"https://api.github.com/users/projecthydra-labs/followers","following_url":"https://api.github.com/users/projecthydra-labs/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra-labs/subscriptions","organizations_url":"https://api.github.com/users/projecthydra-labs/orgs","repos_url":"https://api.github.com/users/projecthydra-labs/repos","events_url":"https://api.github.com/users/projecthydra-labs/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra-labs/received_events","type":"Organization","site_admin":false},"repo":{"id":53448835,"name":"hybox","full_name":"projecthydra-labs/hybox","owner":{"login":"projecthydra-labs","id":7377013,"avatar_url":"https://avatars.githubusercontent.com/u/7377013?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra-labs","html_url":"https://github.com/projecthydra-labs","followers_url":"https://api.github.com/users/projecthydra-labs/followers","following_url":"https://api.github.com/users/projecthydra-labs/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra-labs/subscriptions","organizations_url":"https://api.github.com/users/projecthydra-labs/orgs","repos_url":"https://api.github.com/users/projecthydra-labs/repos","events_url":"https://api.github.com/users/projecthydra-labs/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra-labs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projecthydra-labs/hybox","description":"The Hydra-in-a-Box repository application","fork":false,"url":"https://api.github.com/repos/projecthydra-labs/hybox","forks_url":"https://api.github.com/repos/projecthydra-labs/hybox/forks","keys_url":"https://api.github.com/repos/projecthydra-labs/hybox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projecthydra-labs/hybox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projecthydra-labs/hybox/teams","hooks_url":"https://api.github.com/repos/projecthydra-labs/hybox/hooks","issue_events_url":"https://api.github.com/repos/projecthydra-labs/hybox/issues/events{/number}","events_url":"https://api.github.com/repos/projecthydra-labs/hybox/events","assignees_url":"https://api.github.com/repos/projecthydra-labs/hybox/assignees{/user}","branches_url":"https://api.github.com/repos/projecthydra-labs/hybox/branches{/branch}","tags_url":"https://api.github.com/repos/projecthydra-labs/hybox/tags","blobs_url":"https://api.github.com/repos/projecthydra-labs/hybox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projecthydra-labs/hybox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projecthydra-labs/hybox/git/refs{/sha}","trees_url":"https://api.github.com/repos/projecthydra-labs/hybox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projecthydra-labs/hybox/statuses/{sha}","languages_url":"https://api.github.com/repos/projecthydra-labs/hybox/languages","stargazers_url":"https://api.github.com/repos/projecthydra-labs/hybox/stargazers","contributors_url":"https://api.github.com/repos/projecthydra-labs/hybox/contributors","subscribers_url":"https://api.github.com/repos/projecthydra-labs/hybox/subscribers","subscription_url":"https://api.github.com/repos/projecthydra-labs/hybox/subscription","commits_url":"https://api.github.com/repos/projecthydra-labs/hybox/commits{/sha}","git_commits_url":"https://api.github.com/repos/projecthydra-labs/hybox/git/commits{/sha}","comments_url":"https://api.github.com/repos/projecthydra-labs/hybox/comments{/number}","issue_comment_url":"https://api.github.com/repos/projecthydra-labs/hybox/issues/comments{/number}","contents_url":"https://api.github.com/repos/projecthydra-labs/hybox/contents/{+path}","compare_url":"https://api.github.com/repos/projecthydra-labs/hybox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projecthydra-labs/hybox/merges","archive_url":"https://api.github.com/repos/projecthydra-labs/hybox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projecthydra-labs/hybox/downloads","issues_url":"https://api.github.com/repos/projecthydra-labs/hybox/issues{/number}","pulls_url":"https://api.github.com/repos/projecthydra-labs/hybox/pulls{/number}","milestones_url":"https://api.github.com/repos/projecthydra-labs/hybox/milestones{/number}","notifications_url":"https://api.github.com/repos/projecthydra-labs/hybox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projecthydra-labs/hybox/labels{/name}","releases_url":"https://api.github.com/repos/projecthydra-labs/hybox/releases{/id}","deployments_url":"https://api.github.com/repos/projecthydra-labs/hybox/deployments","created_at":"2016-03-08T22:08:25Z","updated_at":"2016-05-02T13:50:04Z","pushed_at":"2016-05-19T20:33:55Z","git_url":"git://github.com/projecthydra-labs/hybox.git","ssh_url":"git@github.com:projecthydra-labs/hybox.git","clone_url":"https://github.com/projecthydra-labs/hybox.git","svn_url":"https://github.com/projecthydra-labs/hybox","homepage":"http://hydrainabox.projecthydra.org/","size":365,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":34,"forks":0,"open_issues":34,"watchers":2,"default_branch":"master"}},"base":{"label":"projecthydra-labs:master","ref":"master","sha":"bdd86b02081a19064237faef06ff1a2436bae64a","user":{"login":"projecthydra-labs","id":7377013,"avatar_url":"https://avatars.githubusercontent.com/u/7377013?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra-labs","html_url":"https://github.com/projecthydra-labs","followers_url":"https://api.github.com/users/projecthydra-labs/followers","following_url":"https://api.github.com/users/projecthydra-labs/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra-labs/subscriptions","organizations_url":"https://api.github.com/users/projecthydra-labs/orgs","repos_url":"https://api.github.com/users/projecthydra-labs/repos","events_url":"https://api.github.com/users/projecthydra-labs/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra-labs/received_events","type":"Organization","site_admin":false},"repo":{"id":53448835,"name":"hybox","full_name":"projecthydra-labs/hybox","owner":{"login":"projecthydra-labs","id":7377013,"avatar_url":"https://avatars.githubusercontent.com/u/7377013?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra-labs","html_url":"https://github.com/projecthydra-labs","followers_url":"https://api.github.com/users/projecthydra-labs/followers","following_url":"https://api.github.com/users/projecthydra-labs/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra-labs/subscriptions","organizations_url":"https://api.github.com/users/projecthydra-labs/orgs","repos_url":"https://api.github.com/users/projecthydra-labs/repos","events_url":"https://api.github.com/users/projecthydra-labs/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra-labs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projecthydra-labs/hybox","description":"The Hydra-in-a-Box repository application","fork":false,"url":"https://api.github.com/repos/projecthydra-labs/hybox","forks_url":"https://api.github.com/repos/projecthydra-labs/hybox/forks","keys_url":"https://api.github.com/repos/projecthydra-labs/hybox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projecthydra-labs/hybox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projecthydra-labs/hybox/teams","hooks_url":"https://api.github.com/repos/projecthydra-labs/hybox/hooks","issue_events_url":"https://api.github.com/repos/projecthydra-labs/hybox/issues/events{/number}","events_url":"https://api.github.com/repos/projecthydra-labs/hybox/events","assignees_url":"https://api.github.com/repos/projecthydra-labs/hybox/assignees{/user}","branches_url":"https://api.github.com/repos/projecthydra-labs/hybox/branches{/branch}","tags_url":"https://api.github.com/repos/projecthydra-labs/hybox/tags","blobs_url":"https://api.github.com/repos/projecthydra-labs/hybox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projecthydra-labs/hybox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projecthydra-labs/hybox/git/refs{/sha}","trees_url":"https://api.github.com/repos/projecthydra-labs/hybox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projecthydra-labs/hybox/statuses/{sha}","languages_url":"https://api.github.com/repos/projecthydra-labs/hybox/languages","stargazers_url":"https://api.github.com/repos/projecthydra-labs/hybox/stargazers","contributors_url":"https://api.github.com/repos/projecthydra-labs/hybox/contributors","subscribers_url":"https://api.github.com/repos/projecthydra-labs/hybox/subscribers","subscription_url":"https://api.github.com/repos/projecthydra-labs/hybox/subscription","commits_url":"https://api.github.com/repos/projecthydra-labs/hybox/commits{/sha}","git_commits_url":"https://api.github.com/repos/projecthydra-labs/hybox/git/commits{/sha}","comments_url":"https://api.github.com/repos/projecthydra-labs/hybox/comments{/number}","issue_comment_url":"https://api.github.com/repos/projecthydra-labs/hybox/issues/comments{/number}","contents_url":"https://api.github.com/repos/projecthydra-labs/hybox/contents/{+path}","compare_url":"https://api.github.com/repos/projecthydra-labs/hybox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projecthydra-labs/hybox/merges","archive_url":"https://api.github.com/repos/projecthydra-labs/hybox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projecthydra-labs/hybox/downloads","issues_url":"https://api.github.com/repos/projecthydra-labs/hybox/issues{/number}","pulls_url":"https://api.github.com/repos/projecthydra-labs/hybox/pulls{/number}","milestones_url":"https://api.github.com/repos/projecthydra-labs/hybox/milestones{/number}","notifications_url":"https://api.github.com/repos/projecthydra-labs/hybox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projecthydra-labs/hybox/labels{/name}","releases_url":"https://api.github.com/repos/projecthydra-labs/hybox/releases{/id}","deployments_url":"https://api.github.com/repos/projecthydra-labs/hybox/deployments","created_at":"2016-03-08T22:08:25Z","updated_at":"2016-05-02T13:50:04Z","pushed_at":"2016-05-19T20:33:55Z","git_url":"git://github.com/projecthydra-labs/hybox.git","ssh_url":"git@github.com:projecthydra-labs/hybox.git","clone_url":"https://github.com/projecthydra-labs/hybox.git","svn_url":"https://github.com/projecthydra-labs/hybox","homepage":"http://hydrainabox.projecthydra.org/","size":365,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":34,"forks":0,"open_issues":34,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projecthydra-labs/hybox/pulls/161"},"html":{"href":"https://github.com/projecthydra-labs/hybox/pull/161"},"issue":{"href":"https://api.github.com/repos/projecthydra-labs/hybox/issues/161"},"comments":{"href":"https://api.github.com/repos/projecthydra-labs/hybox/issues/161/comments"},"review_comments":{"href":"https://api.github.com/repos/projecthydra-labs/hybox/pulls/161/comments"},"review_comment":{"href":"https://api.github.com/repos/projecthydra-labs/hybox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projecthydra-labs/hybox/pulls/161/commits"},"statuses":{"href":"https://api.github.com/repos/projecthydra-labs/hybox/statuses/642df79122ff188cfdbe22c8a375665214c69500"}}}}