<commit_before>require 'configatron'
require 'gdata'
require 'uri'

rails_root = File.join(FileUtils.pwd, 'rails_root')
if defined?(RAILS_ROOT)
  rails_root = RAILS_ROOT
end

rails_env = 'development'
if defined?(RAILS_ENV)
  rails_env = RAILS_ENV
end

begin 
  APP_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/c2dm.yml")[rails_env]
rescue ex
  raise C2dm::Errors.ConfigFileNotFound.new(ex.message)
end

begin
  configatron.c2dm.api_url = URI.parse('https://android.apis.google.com/c2dm/send')
  configatron.c2dm.username = APP_CONFIG['username']
  configatron.c2dm.password = <PASSWORD>_CONFIG['password']
  configatron.c2dm.app_name = APP_CONFIG['app_name']
rescue ex
  raise C2dm::Errors.ConfigFileMissingAttributes.new(ex.message)
end

module C2dm # :nodoc:
  
  module Errors # :nodoc:
    
    # The payload of the message is too big, the limit is currently 1024
    # bytes. Reduce the size of the message.
    class MessageTooBig < StandardError
      
      def initialize(message) # :nodoc:
        super("The maximum size allowed for a notification payload is 1024 bytes: '#{message}'")
      end<commit_msg>Fixing ruby syntax issue on rescue block during c2dm initialization.<commit_after>require 'configatron'
require 'gdata'
require 'uri'

rails_root = File.join(FileUtils.pwd, 'rails_root')
if defined?(RAILS_ROOT)
  rails_root = RAILS_ROOT
end

rails_env = 'development'
if defined?(RAILS_ENV)
  rails_env = RAILS_ENV
end

begin 
  APP_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/c2dm.yml")[rails_env]
rescue => ex
  raise C2dm::Errors.ConfigFileNotFound.new(ex.message)
end

begin
  configatron.c2dm.api_url = URI.parse('https://android.apis.google.com/c2dm/send')
  configatron.c2dm.username = APP_CONFIG['username']
  configatron.c2dm.password = APP_CONFIG['password']
  configatron.c2dm.app_name = APP_CONFIG['app_name']
rescue => ex
  raise C2dm::Errors.ConfigFileMissingAttributes.new(ex.message)
end

module C2dm # :nodoc:
  
  module Errors # :nodoc:
    
    # The payload of the message is too big, the limit is currently 1024
    # bytes. Reduce the size of the message.
    class MessageTooBig < StandardError
      
      def initialize(message) # :nodoc:
        super("The maximum size allowed for a notification payload is 1024 bytes: '#{message}'")
      end
{'fraction_non_alphanumeric': 0.1076721883173496, 'fraction_numerical': 0.015257192676547515, 'mean_word_length': 4.425531914893617, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 2, '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': '3811519', 'n_tokens_mistral': 832, 'n_tokens_neox': 791, 'n_words': 184}