lib/split/configuration.rb in split-0.6.5 vs lib/split/configuration.rb in split-0.6.6

- old
+ new

@@ -10,63 +10,82 @@ attr_accessor :allow_multiple_experiments attr_accessor :enabled attr_accessor :persistence attr_accessor :algorithm attr_accessor :store_override + attr_accessor :start_manually attr_accessor :on_trial_choose attr_accessor :on_trial_complete attr_accessor :on_experiment_reset attr_accessor :on_experiment_delete + attr_accessor :include_rails_helper attr_reader :experiments def bots @bots ||= { # Indexers - "AdsBot-Google" => 'Google Adwords', + 'AdsBot-Google' => 'Google Adwords', 'Baidu' => 'Chinese search engine', + 'Baiduspider' => 'Chinese search engine', + 'bingbot' => 'Microsoft bing bot', + 'Butterfly' => 'Topsy Labs', 'Gigabot' => 'Gigabot spider', 'Googlebot' => 'Google spider', + 'MJ12bot' => 'Majestic-12 spider', 'msnbot' => 'Microsoft bot', - 'bingbot' => 'Microsoft bing bot', 'rogerbot' => 'SeoMoz spider', + 'PaperLiBot' => 'PaperLi is another content curation service', 'Slurp' => 'Yahoo spider', 'Sogou' => 'Chinese search engine', - "spider" => 'generic web spider', + 'spider' => 'generic web spider', + 'UnwindFetchor' => 'Gnip crawler', 'WordPress' => 'WordPress spider', - 'ZIBB' => 'ZIBB spider', 'YandexBot' => 'Yandex spider', + 'ZIBB' => 'ZIBB spider', + # HTTP libraries 'Apache-HttpClient' => 'Java http library', 'AppEngine-Google' => 'Google App Engine', - "curl" => 'curl unix CLI http client', + 'curl' => 'curl unix CLI http client', 'ColdFusion' => 'ColdFusion http library', - "EventMachine HttpClient" => 'Ruby http library', - "Go http package" => 'Go http library', + 'EventMachine HttpClient' => 'Ruby http library', + 'Go http package' => 'Go http library', 'Java' => 'Generic Java http library', 'libwww-perl' => 'Perl client-server library loved by script kids', 'lwp-trivial' => 'Another Perl library loved by script kids', - "Python-urllib" => 'Python http library', - "PycURL" => 'Python http library', - "Test Certificate Info" => 'C http library?', - "Wget" => 'wget unix CLI http client', + 'Python-urllib' => 'Python http library', + 'PycURL' => 'Python http library', + 'Test Certificate Info' => 'C http library?', + 'Wget' => 'wget unix CLI http client', + # URL expanders / previewers 'awe.sm' => 'Awe.sm URL expander', - "bitlybot" => 'bit.ly bot', - "facebookexternalhit" => 'facebook bot', + 'bitlybot' => 'bit.ly bot', + 'bot@linkfluence.net' => 'Linkfluence bot', + 'facebookexternalhit' => 'facebook bot', + 'Feedfetcher-Google' => 'Google Feedfetcher', + 'https://developers.google.com/+/web/snippet' => 'Google+ Snippet Fetcher', 'LongURL' => 'URL expander service', + 'NING' => 'NING - Yet Another Twitter Swarmer', + 'redditbot' => 'Reddit Bot', + 'ShortLinkTranslate' => 'Link shortener', + 'TweetmemeBot' => 'TweetMeMe Crawler', 'Twitterbot' => 'Twitter URL expander', 'UnwindFetch' => 'Gnip URL expander', + 'vkShare' => 'VKontake Sharer', + # Uptime monitoring 'check_http' => 'Nagios monitor', 'NewRelicPinger' => 'NewRelic monitor', 'Panopta' => 'Monitoring service', - "Pingdom" => 'Pingdom monitoring', + 'Pingdom' => 'Pingdom monitoring', 'SiteUptime' => 'Site monitoring services', + # ??? - "DigitalPersona Fingerprint Software" => 'HP Fingerprint scanner', - "ShowyouBot" => 'Showyou iOS app spider', + 'DigitalPersona Fingerprint Software' => 'HP Fingerprint scanner', + 'ShowyouBot' => 'Showyou iOS app spider', 'ZyBorg' => 'Zyborg? Hmmm....', } end def experiments= experiments @@ -115,10 +134,14 @@ end if goals = value_for(settings, :goals) experiment_config[experiment_name.to_sym][:goals] = goals end + + if (resettable = value_for(settings, :resettable)) != nil + experiment_config[experiment_name.to_sym][:resettable] = resettable + end end experiment_config end end @@ -169,16 +192,17 @@ @allow_multiple_experiments = false @enabled = true @experiments = {} @persistence = Split::Persistence::SessionAdapter @algorithm = Split::Algorithms::WeightedSample + @include_rails_helper = true end private def value_for(hash, key) if hash.kind_of?(Hash) - hash[key.to_s] || hash[key.to_sym] + hash.has_key?(key.to_s) ? hash[key.to_s] : hash[key.to_sym] end end def escaped_bots bots.map { |key, _| Regexp.escape(key) }