<commit_before># coding=utf-8

Rango.import("bundling/strategies")

class Rango
  class << self
    # @since 0.0.1
    # @return [String] Returns current environment name. Possibilities are +development+ or +production+.
    attribute :environment, "development"

    attribute :dependencies, Hash.new
    # @examples
    #   Rango.dependency("dm-core", github: "datamapper/dm-core")
    #   Rango.dependency("dm-core", "1.0.2", svn: "datamapper/dm-core")
    #   Rango.dependency("dm-core", "1.0.2", gem: "datamapper/dm-core")
    #   Rango.dependency("a-rango-plugin") do
    #     # code which will be called when the library is imported
    #   end
    # </pre>
    #
    # === Bundling:
    # Dependencies aren't good just for importing libraries, but also for their bundling. It's the reason why we have +github+, +git+, +svn+ and +gem+ options.
    #
    # @since 0.0.1
    # @param [String] library Library to require
    # @param [String] version Which version should be required (optional)
    # @param [Hash] options Available options: <tt>soft: boolean</tt>, <tt>github: user/repo</tt>, <tt>git: repo</tt>, <tt>svn: repo</tt>, <tt>gem: gemname</tt>.
    # @raise [LoadError] Unless soft importing is enable, it will raise LoadError if the file wasn't found
    # @return [Boolean] Returns true if importing succeed or false if not.
    def dependency(library, options = Hash.new)
      self.bundle(library, options)
      if options[:as]
        require options[:as]
      else
        require library
      end
    end<commit_msg>Rango.dependency can take block.<commit_after># coding=utf-8

Rango.import("bundling/strategies")

class Rango
  class << self
    # @since 0.0.1
    # @return [String] Returns current environment name. Possibilities are +development+ or +production+.
    attribute :environment, "development"

    attribute :dependencies, Hash.new
    # @examples
    #   Rango.dependency("dm-core", github: "datamapper/dm-core")
    #   Rango.dependency("dm-core", "1.0.2", svn: "datamapper/dm-core")
    #   Rango.dependency("dm-core", "1.0.2", gem: "datamapper/dm-core")
    #   Rango.dependency("a-rango-plugin") do
    #     # code which will be called when the library is imported
    #   end
    # </pre>
    #
    # === Bundling:
    # Dependencies aren't good just for importing libraries, but also for their bundling. It's the reason why we have +github+, +git+, +svn+ and +gem+ options.
    #
    # @since 0.0.1
    # @param [String] library Library to require
    # @param [String] version Which version should be required (optional)
    # @param [Hash] options Available options: <tt>soft: boolean</tt>, <tt>github: user/repo</tt>, <tt>git: repo</tt>, <tt>svn: repo</tt>, <tt>gem: gemname</tt>.
    # @raise [LoadError] Unless soft importing is enable, it will raise LoadError if the file wasn't found
    # @return [Boolean] Returns true if importing succeed or false if not.
    def dependency(library, options = Hash.new, &block)
      self.bundle(library, options)
      if options[:as]
        require options[:as]
      else
        require library
      end
      block.call if block_given?
    end
{'fraction_non_alphanumeric': 0.1322314049586777, 'fraction_numerical': 0.008264462809917356, 'mean_word_length': 3.1462450592885376, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 25, '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': '5086786', 'n_tokens_mistral': 1020, 'n_tokens_neox': 967, 'n_words': 308}