git_repositories.rb revision afd1d888784385307c9c0544597a513c2008d342
require 'git_repository'
included do
end
end
end
# replace capistrano-style release with 'current'-symlink
end
end
end
end
message ||= "delete file #{filepath}"
end
end
end
end
end
# we expect that this method is only called, when the ontology is 'present'
if o
o.present = true
# update existing ontology
fast_parse: fast_parse },
{ without_protection: true })
end
else
# create new ontology
clazz = Ontology.file_extensions_distributed.include?(File.extname(filepath)) ? DistributedOntology : SingleOntology
o = clazz.new
o.iri = iri || "http://#{Settings.hostname}/#{path}/#{basepath}"
o.present = true
fast_parse: fast_parse },
{ without_protection: true })
end
end
path ||= '/'
end
end
# given a commit oid or a branch name, commit_id returns a hash of oid and branch name if existent
branch_names = git.branches.select { |b| b[:oid] == oid }
{ oid: oid, branch_name: nil }
else
{ oid: oid, branch_name: branch_names[0][:name] }
end
else
else
end
end
end
end
end
end
commits(limit: 3)
end
# recognized options: :start_oid (first commit to show)
# :stop_oid (first commit to hide)
# :path (file to show changes for)
# :limit (max number of commits)
# :offset (number of commits to skip)
# :walk_order (Rugged-Walkorder)
end
versions = []
versions << save_ontology(commit_oid, f.path, options.delete(:user), fast_parse: has_changed?(f.path, commit_oid), do_not_parse: true)
end
}
}
schedule_batch_parsing(versions)
end
def schedule_batch_parsing(versions)
grouped_versions = versions.compact.group_by { |v| v.ontology.path }
grouped_versions.each do |k,versions|
optioned_versions = versions.map do |version|
[version.id, { fast_parse: version.fast_parse }]
end
OntologyBatchParseWorker.perform_async(optioned_versions)
end
end
def user_info(user)
{email: user.email, name: user.name}
end
end