<commit_before>class Heroku::JSPlugin
  extend Heroku::Helpers

  def self.setup?
    @is_setup ||= File.exists? bin
  end

  def self.load!
    return unless setup?
    this = self
    topics.each do |topic|
      Heroku::Command.register_namespace(
        :name => topic['name'],
        :description => " #{topic['description']}"
      ) unless Heroku::Command.namespaces.include?(topic['name'])
    end
    commands.each do |plugin|
      klass = Class.new do
        def initialize(args, opts)
          @args = args
          @opts = opts
        end
      end
      klass.send(:define_method, :run) do
        ENV['HEROKU_APP'] = @opts[:app]
        exec this.bin, "#{plugin['topic']}:#{plugin['command']}", *@args
      end
      Heroku::Command.register_command(
        :command   => plugin['command'] ? "#{plugin['topic']}:#{plugin['command']}" : plugin['topic'],
        :namespace => plugin['topic'],
        :klass     => klass,
        :method    => :run,
        :banner    => plugin['usage'],
        :summary   => plugin['description'],
        :help      => "\n#{plugin['help']}"
      )
    end
  end

  def self.plugins
    return [] unless setup?
    @plugins ||= `#{bin} plugins`.lines.map do |line|
      name, version = line.split
      { :name => name, :version => version }
    end
  end
<commit_msg>pass all args to jsplugins<commit_after>class Heroku::JSPlugin
  extend Heroku::Helpers

  def self.setup?
    @is_setup ||= File.exists? bin
  end

  def self.load!
    return unless setup?
    this = self
    topics.each do |topic|
      Heroku::Command.register_namespace(
        :name => topic['name'],
        :description => " #{topic['description']}"
      ) unless Heroku::Command.namespaces.include?(topic['name'])
    end
    commands.each do |plugin|
      klass = Class.new do
        def initialize(args, opts)
          @args = args
          @opts = opts
        end
      end
      klass.send(:define_method, :run) do
        exec this.bin, "#{plugin['topic']}:#{plugin['command']}", *ARGV[1..-1]
      end
      Heroku::Command.register_command(
        :command   => plugin['command'] ? "#{plugin['topic']}:#{plugin['command']}" : plugin['topic'],
        :namespace => plugin['topic'],
        :klass     => klass,
        :method    => :run,
        :banner    => plugin['usage'],
        :summary   => plugin['description'],
        :help      => "\n#{plugin['help']}"
      )
    end
  end

  def self.plugins
    return [] unless setup?
    @plugins ||= `#{bin} plugins`.lines.map do |line|
      name, version = line.split
      { :name => name, :version => version }
    end
  end

{'fraction_non_alphanumeric': 0.1635673624288425, 'fraction_numerical': 0.0007590132827324478, 'mean_word_length': 2.349428208386277, 'pattern_counts': {'":': 0, '<': 3, '<?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': '733220', 'n_tokens_mistral': 793, 'n_tokens_neox': 807, 'n_words': 184}