<commit_before>#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++

#
# The configuration class gives you a means to define a config block
# to override the defaults provided in the gem.  You can configure the
# mobile subdomain, the view path, and the regex for recognizing mobile
# devices. 
#
# @author <NAME>

require 'singleton'

module MobilePath
  class Configuration
    include Singleton
    
    @@defaults = {
      :subdomain => 'm',
      :mobile_view_path => "mobile_views",
      :mobile_device_regex => /(iPhone|iPod|iPad|Android)/
    }
    
    def self.defaults
      @@defaults
    end
    
    def initialize
      @@defaults.each_pair{|k,v| self.send("#{k}=",v)}
    end
    
    attr_accessor :subdomain, :mobile_view_path, :mobile_device_regex
    
  end
  
  def self.config
    Configuration.instance
  end
  <commit_msg>borrowed mobile_fu regex for mobile devises<commit_after>#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++

#
# The configuration class gives you a means to define a config block
# to override the defaults provided in the gem.  You can configure the
# mobile subdomain, the view path, and the regex for recognizing mobile
# devices. 
#
# @author <NAME>

require 'singleton'

module MobilePath
  class Configuration
    include Singleton
    
    @@defaults = {
      :subdomain => 'm',
      :mobile_view_path => "mobile_views",
      :mobile_device_regex => /('palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|' +
                          'audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|' +
                          'x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|' +
                          'pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|' +
                          'webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|' +
                          'mobile')/i
    }
    
    def self.defaults
      @@defaults
    end
    
    def initialize
      @@defaults.each_pair{|k,v| self.send("#{k}=",v)}
    end
    
    attr_accessor :subdomain, :mobile_view_path, :mobile_device_regex
    
  end
  
  def self.config
    Configuration.instance
  end
  
{'fraction_non_alphanumeric': 0.08630271330500164, 'fraction_numerical': 0.002615233736515201, 'mean_word_length': 3.191780821917808, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '906017', 'n_tokens_mistral': 946, 'n_tokens_neox': 907, 'n_words': 307}