<commit_before>module Renren
  module Rails
    module Helpers
      module XnConnect
        def xn_connect_javascript_tag
          "<script type='text/javascript' src='http://static.connect.renren.com/js/v1.0/FeatureLoader.jsp'></script>"
        end
        
        def init_xn_connect
          # TODO: use Renren.api_key instead
          javascript_tag "XN_RequireFeatures(['EXNML'], function(){ XN.Main.init('#{ENV['RENREN_API_KEY']}', 'xd_receiver.html'); });"
        end
        
        def xn_login_button(*args)
          callback = args.first
          options = args[1] || {}
          options.merge!(:onlogin => callback) if callback

          content_tag("xn:login-button", nil, options)
        end
      end
    end
  end
end<commit_msg>use globel configuration in helper<commit_after>module Renren
  module Rails
    module Helpers
      module XnConnect
        def xn_connect_javascript_tag
          "<script type='text/javascript' src='http://static.connect.renren.com/js/v1.0/FeatureLoader.jsp'></script>"
        end
        
        def init_xn_connect
          javascript_tag "XN_RequireFeatures(['EXNML'], function(){ XN.Main.init('#{Renren.api_key}', 'xd_receiver.html'); });"
        end
        
        def xn_login_button(*args)
          callback = args.first
          options = args[1] || {}
          options.merge!(:onlogin => callback) if callback

          content_tag("xn:login-button", nil, options)
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.11701412239408204, 'fraction_numerical': 0.004034969737726967, 'mean_word_length': 2.3066666666666666, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '7135133', 'n_tokens_mistral': 455, 'n_tokens_neox': 449, 'n_words': 87}