<commit_before>require "vmc/plugin"
require "console-vmc-plugin/console"

module VMCConsole
  class Console < VMC::CLI
    desc "Open a console connected to your app"
    group :apps, :manage
    input :app, :argument => :required, :from_given => by_name("app"),
      :desc => "App to connect to"
    input :port, :default => 10000
    def console
      app = input[:app]

      console = CFConsole.new(client, app)
      port = console.pick_port!(input[:port])

      with_progress("Opening console on port #{c(port, :name)}") do
        console.open!
        console.wait_for_start
      end

      console.start_console
    end

    filter(:start, :start_app) do |app|
      if !v2? && app.framework.name == "rails3"
        app.console = true
      end

      app
    end
  end
end<commit_msg>enable console for v2<commit_after>require "vmc/plugin"
require "console-vmc-plugin/console"

module VMCConsole
  class Console < VMC::CLI
    desc "Open a console connected to your app"
    group :apps, :manage
    input :app, :argument => :required, :from_given => by_name("app"),
      :desc => "App to connect to"
    input :port, :default => 10000
    def console
      app = input[:app]

      console = CFConsole.new(client, app)
      port = console.pick_port!(input[:port])

      with_progress("Opening console on port #{c(port, :name)}") do
        console.open!
        console.wait_for_start
      end

      console.start_console
    end

    filter(:start, :start_app) do |app|
      if app.framework.name == "rails3"
        app.console = true
      end

      app
    end
  end
end
{'fraction_non_alphanumeric': 0.11654135338345864, 'fraction_numerical': 0.008771929824561403, 'mean_word_length': 2.6295454545454544, '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': '1860884', 'n_tokens_mistral': 524, 'n_tokens_neox': 497, 'n_words': 143}