/ontohub/spec/models/repository/ |
H A D | jobcount_spec.rb | 16 %w(inroot1.clif).each do |path| 17 tmpfile = Tempfile.new(path) 18 tmpfile.write(files[path]) 21 repository.save_file(tmpfile.path, path, message, user) 27 %w(inroot1.clif inroot1.clf).each do |path| 28 tmpfile = Tempfile.new(path) 29 tmpfile.write(files[path]) 32 repository.save_file(tmpfile.path, path, messag [all...] |
H A D | browsing_spec.rb | 19 files.each do | path, content | 20 tmpfile = Tempfile.new(File.basename(path)) 24 repository.save_file(tmpfile.path, path, message, user)
|
/ontohub/app/helpers/ |
H A D | breadcrumbs_helper.rb | 3 def repository_breadcrumbs(repository, path, oid) 4 path ||= '' 5 crumbs = path.split('/') 9 path: fancy_repository_path(repository, path: nil, ref: oid) 17 path: fancy_repository_path(repository, path: segment, ref: oid)
|
H A D | history_helper.rb | 7 @ontology ||= repository.primary_ontology(path) 22 def path method in class:HistoryHelper 23 params[:path]
|
H A D | modal_helper.rb | 10 def modal_body(header_text, body_text, path, button_text, modal_id: 'modal', 15 path: path,
|
/ontohub/lib/git_repository/ |
H A D | get_folder_contents.rb | 6 def folder_contents(commit_oid=nil, path='') 7 path ||= '/' 9 if !rugged_commit && path.empty? 12 folder_contents_rugged(rugged_commit, path) 28 files_recursive(entry.path, rugged_commit, &block) 30 block.call GitRepository::Files::GitFile.new(self, rugged_commit, entry.path) 35 def folder_contents_rugged(rugged_commit, path='') 36 path = '' if path == '/' || path [all...] |
H A D | get_info_list.rb | 20 def entry_info(path, commit_oid=nil) 22 entry_info_rugged(rugged_commit, path) 26 def entry_info_list(path, commit_oid=nil) 31 entry_info_list_rugged(rugged_commit, path) 42 def entry_info_rugged(rugged_commit, path) 43 changing_rugged_commit = get_commit_of_last_change(path, rugged_commit) 44 build_entry_info(changing_rugged_commit, path) 47 def build_entry_info(changing_rugged_commit, path) 54 filename: path.split('/')[-1] 58 def entry_info_list_rugged(rugged_commit, path) [all...] |
H A D | files.rb | 6 attr_reader :path, :oid, :mime_type, :mime_category 9 def initialize(repository, rugged_commit, path) 10 @path = path 13 @path = '/' 19 if !repository.path_exists?(path, rugged_commit.oid) 20 raise GitRepository::PathNotFoundError, "Path doesn't exist: #{path}" 22 self.rugged_object = repository.get_object(rugged_commit, path) 47 repository.folder_contents(oid, path) 70 @name ||= path [all...] |
H A D | history.rb | 8 attr_reader :rugged_commit, :path, :commits_to_diff 12 def initialize(commit, commits_to_diff: nil, path: nil) 16 @path = path 34 !@path || 35 [d.old_file[:path], d.new_file[:path]].any?{ |p| p.start_with?(@path) } 40 %w(oid message committer author rugged_commit path commits_to_diff).all? do |method| 53 # :path (fil [all...] |
/ontohub/lib/ |
H A D | git_repository.rb | 19 delegate :path, :empty?, to: :repo 21 def initialize(path) 22 if File.exists?(path) 23 @repo = Rugged::Repository.new(path) 26 @repo = Rugged::Repository.init_at(path, true) 32 FileUtils.chmod_R('g+ws', path) 36 FileUtils.rmtree(self.path) 39 def dir?(path, commit_oid = nil) 40 path ||= '/' 46 object = get_object(rugged_commit, path) [all...] |
H A D | iri_url_builder.rb | 19 path: path, 25 # return path unless the basepath only consists of the filename 26 def path method in class:IRIUrlBuilder.Builder 27 path = File.dirname(ontology_version.basepath) 28 path if path != '.'
|
/ontohub/lib/extend/ |
H A D | file.rb | 9 def self.relative_path(dir, path) 10 if path.starts_with? dir 11 path.gsub(/^#{dir}\//, '')
|
/ontohub/spec/lib/repository/ |
H A D | directories_spec.rb | 7 let(:path) { '/tmp/ontohub/test/unit/git/repository' } 8 let(:repository) { GitRepository.new(path) } 12 let(:subfolder) { 'path' } 31 FileUtils.rmtree(path) if File.exists?(path) 41 { type: git_file.type, path: git_file.path } 44 path: subfolder 54 { type: git_file.type, path: git_file.path } [all...] |
H A D | git_repository_spec.rb | 8 let(:path) { Rails.root.join('tmp', 'test', 'unit', 'git_repository').to_s } 11 FileUtils.rmtree(path) if File.exists?(path) 17 expect(File.exists?(path)).to be(false) 21 let(:repository_new) { GitRepository.new(path) } 25 it { expect(File.exists?(path)).to be(true) } 30 it { expect(File.exists?(path)).to be(false) } 40 path = repository.local_path 41 FileUtils.rm_r(path) 42 FileUtils.mv(bare_git.path, pat [all...] |
/ontohub/app/controllers/ |
H A D | path_helpers.rb | 16 repository_tree_path repository, path: args[:path] 18 repository_ref_path repository_id: repository, ref: args[:ref], action: action, path: args[:path]
|
H A D | files_controller.rb | 5 helper_method :repository, :ref, :oid, :path, :branch_name 11 send_download(path, oid) 19 send_download(path, oid) 24 send_download(path, oid) 28 render json: repository.entries_info(oid, path) 42 redirect_to fancy_repository_path(repository, path: resource.target_path) 52 flash[:success] = "Successfully changed the file #{params[:path]}." 53 redirect_to fancy_repository_path(repository, path: resource.target_path) 60 repository.delete_file(params[:path], current_user) 61 flash[:success] = "Successfully deleted the file #{params[:path]} 105 def path method in class:FilesController [all...] |
/ontohub/app/fake_records/ |
H A D | history_entries_page.rb | 7 attr_reader :repository, :oid, :path, :current_file, :commits 24 @path = opts[:path] 25 @current_file = repository.get_file(path, oid) if path && !repository.dir?(path) 30 @commits = repository.walk_commits(start_oid: oid, path: path,
|
/ontohub/config/initializers/ |
H A D | paths.rb | 7 def expand(path) 8 Dir.chdir(Rails.root) { Pathname.new(path).expand_path } 11 def cleanup_release(path) 12 path.sub(%r(/releases/\d+/), "/current/") 15 def prepare(path, fallback = nil) 16 path = File.join(Settings.paths.data, fallback) if fallback && path.nil? 17 cleanup_release(expand(path))
|
/ontohub/spec/factories/ |
H A D | git_repository_factory.rb | 15 path = generate :git_repository_path 18 FileUtils.mkdir_p(path) 19 Dir.chdir(path) do 37 new(path) 47 path = generate :git_repository_path 50 FileUtils.mkdir_p(path) 51 Dir.chdir(path) do 78 new(path) 86 path = generate :git_repository_path 89 FileUtils.mkdir_p(path) [all...] |
/ontohub/app/models/ontology/ |
H A D | class_methods_and_scopes.rb | 9 scope :basepath, ->(path) do 10 joins(:ontology_version).where('ontology_versions.basepath' => path) 18 scope :with_path, ->(path) do 25 with_basepath(File.basepath(path)). 26 where(condition, extname: File.extname(path)). 30 scope :with_basepath, ->(path) do 37 ("ontology_versions"."basepath" = :path) 39 AND ("ontologies"."basepath" = :path)) 42 joins(join).where(condition, path: path) [all...] |
/ontohub/spec/support/ |
H A D | common_helper_methods.rb | 11 def fixture_file(path) 13 fixture_path.join(path) 28 def ontology_file(path, ext=nil) 31 "#{path}.#{ext}" 32 elsif path.include?('.') 33 path 35 "#{path}.#{path.to_s.split('/').first}" 41 path = ontology_file(relative_file) 42 version_for_file(repository, path) [all...] |
/ontohub/app/models/repository/ |
H A D | ontologies.rb | 14 def primary_ontology(path) 15 path ||= '' 16 onto = ontologies.where(basepath: File.basepath(path)).first
|
/ontohub/db/ |
H A D | seeds.rb | 26 Dir["#{Rails.root}/db/seeds/*.rb"].sort.each do |path| 27 puts File.basename path 28 require path
|
/ontohub/lib/dsl/ |
H A D | repo.rb | 3 def init(path) 4 FileUtils.mkdir_p(path) 5 RepositoryCreator.instance.root_path = path 50 @path = url || RepositoryCreator.instance.root_path.join(name) 54 Subprocess.run 'git', 'init', @path 59 r = Repository.new name: @name, description: 'Seeded Repository', source_address: @path.to_s, access: 'public_r'
|
/ontohub/db/seeds/ |
H A D | 040-git.rb | 30 ontologies.each do |path| 31 path = File.join(Rails.root, 'spec', 'fixtures', 'ontologies', path) 32 basename = File.basename(path) 36 version = repository.save_file path, basename, "#{basename} added", @user
|