Class: Xanthus::Repository
- Inherits:
-
Object
- Object
- Xanthus::Repository
- Defined in:
- lib/xanthus/repository.rb
Instance Method Summary collapse
-
#initialize ⇒ Repository
constructor
A new instance of Repository.
- #prepare_readme_file(config) ⇒ Object
- #prepare_xanthus_file ⇒ Object
Constructor Details
#initialize ⇒ Repository
Returns a new instance of Repository.
4 5 |
# File 'lib/xanthus/repository.rb', line 4 def initialize end |
Instance Method Details
#prepare_readme_file(config) ⇒ Object
22 23 24 25 26 |
# 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 ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# 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 |