<commit_before>require 'thor'

module Refinery
  class CLI < Thor
    include Thor::Actions

    OVERRIDES = {
      :view => {
        :glob => '*.{erb,builder}',
        :dir => 'views',
        :desc => 'view template',
      },
      :controller => {
        :glob => '*.rb',
        :dir => 'controllers',
        :desc => 'controller',
      },
      :model => {
        :glob => '*.rb',
        :dir => 'models',
        :desc => 'model',
      },
      :presenter => {
        :glob => '*.rb',
        :dir => 'presenters',
        :desc => 'presenter',
      },
      :javascript => {
        :glob => '*.js{,.*}',
        :dir => 'assets/javascripts',
        :desc => 'javascript',
      },
      :stylesheet => {
        :glob => '*.css{,.scss}',
        :dir => 'assets/stylesheets',
        :desc => 'stylesheet',
      },
    }

    desc "override", "copies files from any Refinery extension that you are using into your application"
    def override(env)
      OVERRIDES.keys.each do |kind|
        if (which = env[kind.to_s]).present?
          return _override(kind, which)
        end
      end

      puts "You didn't specify anything valid to override. Here are some examples:"
      {
        :view => ['pages/home', 'refinery/pages/home', '**/*menu', '_menu_branch'],
        :javascript => %w(admin refinery/site_bar),
        :stylesheet => %w(home refinery/site_bar),
        :controller => %w(pages),<commit_msg>Add js override example how to get all wymeditor files at once.<commit_after>require 'thor'

module Refinery
  class CLI < Thor
    include Thor::Actions

    OVERRIDES = {
      :view => {
        :glob => '*.{erb,builder}',
        :dir => 'views',
        :desc => 'view template',
      },
      :controller => {
        :glob => '*.rb',
        :dir => 'controllers',
        :desc => 'controller',
      },
      :model => {
        :glob => '*.rb',
        :dir => 'models',
        :desc => 'model',
      },
      :presenter => {
        :glob => '*.rb',
        :dir => 'presenters',
        :desc => 'presenter',
      },
      :javascript => {
        :glob => '*.js{,.*}',
        :dir => 'assets/javascripts',
        :desc => 'javascript',
      },
      :stylesheet => {
        :glob => '*.css{,.scss}',
        :dir => 'assets/stylesheets',
        :desc => 'stylesheet',
      },
    }

    desc "override", "copies files from any Refinery extension that you are using into your application"
    def override(env)
      OVERRIDES.keys.each do |kind|
        if (which = env[kind.to_s]).present?
          return _override(kind, which)
        end
      end

      puts "You didn't specify anything valid to override. Here are some examples:"
      {
        :view => ['pages/home', 'refinery/pages/home', '**/*menu', '_menu_branch'],
        :javascript => %w(admin refinery/site_bar wymeditor**/{**/}*),
        :stylesheet => %w(home refinery/site_bar),
        :controller => %w(pages),
{'fraction_non_alphanumeric': 0.17712928401764505, 'fraction_numerical': 0.0, 'mean_word_length': 1.9246031746031746, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 59, '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': '1647286', 'n_tokens_mistral': 905, 'n_tokens_neox': 895, 'n_words': 223}