class Xanthus::Repository

Public Class Methods

new() click to toggle source
# File lib/xanthus/repository.rb, line 4
def initialize
end

Public Instance Methods

prepare_readme_file(config) click to toggle source
# File lib/xanthus/repository.rb, line 22
def prepare_readme_file config
  File.open('README.md', 'w+') do |f|
    f.write(config.to_readme_md)
  end
end
prepare_xanthus_file() click to toggle source
# File lib/xanthus/repository.rb, line 7
def prepare_xanthus_file
  script = ''
  File.readlines('../../.xanthus').each do |line|
    script += line unless line.include?('github.token') || line.include?('dataverse.token')

    # remove github token
    script += "\t\t# github.token = 'REMOVED'\n" unless !line.include? 'github.token'
    # remove dataverse token
    script += "\t\t# dataverse.token = 'REMOVED'\n" unless !line.include? 'dataverse.token'
  end
  File.open('.xanthus', 'w+') do |f|
    f.write(script)
  end
end