class LearnRepair

Public Class Methods

new(filepath) click to toggle source
Calls superclass method LearnBase::new
# File lib/learn-tool/learn-repair.rb, line 3
def initialize(filepath)
  super(filepath)
  cd_into_and(filepath, create_learn_file)
  cd_into_and(filepath, create_support_file("LICENSE.md"))
  cd_into_and(filepath, create_support_file("CONTRIBUTING.md"))
end

Public Instance Methods

create_learn_file() click to toggle source
# File lib/learn-tool/learn-repair.rb, line 10
def create_learn_file
  'echo "languages:" > .learn && echo "  - none" >> .learn'
end
create_support_file(name_of_file) click to toggle source
# File lib/learn-tool/learn-repair.rb, line 14
def create_support_file(name_of_file)
  # copies a template folder from the learn_create gem to a subfolder of the current directory
  gem_template_location = File.dirname(__FILE__)
  template_path = File.expand_path(gem_template_location) + "/support_files/#{name_of_file}"
  "cp #{template_path} #{@filepath}"
end