module Mumukit::Sync::Store::Github::WithFileReading

Public Instance Methods

read_code_file(root, filename) click to toggle source
# File lib/mumukit/sync/store/github/with_file_reading.rb, line 5
def read_code_file(root, filename)
  files = Dir.glob("#{root}/#{filename}.*")
  file = files[0]
  read_file(file) if files.length == 1
end
read_file(path) click to toggle source
# File lib/mumukit/sync/store/github/with_file_reading.rb, line 15
def read_file(path)
  File.read(path) if path && File.exist?(path)
end
read_yaml_file(path) click to toggle source
# File lib/mumukit/sync/store/github/with_file_reading.rb, line 11
def read_yaml_file(path)
  YAML.load_file(path) if path && File.exist?(path)
end