Skip to content

Instantly share code, notes, and snippets.

@tal
Created December 30, 2009 04:28
Show Gist options
  • Save tal/265838 to your computer and use it in GitHub Desktop.
Save tal/265838 to your computer and use it in GitHub Desktop.
require 'yaml'
module UserAgentFetures
class UserAgent
attr_accessor :string
yamlfile = File.join(File.dirname(__FILE__),'features.yaml')
features = YAML::load(File.open(yamlfile))
aliases = []
features.each do |feature,compatability|
if compatability.is_a?(Array)
eval %{
puts "#{feature}", " #{'yo'}"
def #{feature}?
puts "#{compatability}"
end
}
elsif compatability.is_a?(Symbol)
aliases << [feature,compatability]
end
end
puts (UserAgent.new('yo').methods - Object.methods).inspect
def initialize(string)
@string = string
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment