module TestGem
Constants
- VERSION
Public Class Methods
configure()
click to toggle source
# File lib/test_gem.rb, line 11 def self.configure if File.exists? "#{@LOAD_PATH}/test_gem_config.yml" conf = YAML.load(File.open("#{@LOAD_PATH}/test_gem_config.yml")) else raise TestGem::MyError.new("Please run --init first, you have no config file") end @default_file_name = conf[:default_file_name] @supported_types = conf[:supported_types] end
init_config()
click to toggle source
# File lib/test_gem.rb, line 26 def self.init_config data = { :default_file_name => 'default_file.txt', :supported_types => ['txt', 'pdf'] }.to_yaml File.open("#{@LOAD_PATH}/test_gem_config.yml", "w") { |f| f.write(data) } end