<commit_before># Author:: <NAME> <<EMAIL>>
# Copyright:: Copyright (c) 2012 <NAME>
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# this file is derived f

require 'thor'
require 'whisk'
require 'whisk/runner'

class Whisk
  class CLI < Thor
    def initialize(*)
      super
      # JW TODO: Replace Chef::Knife::UI with our own UI class
      ::Whisk.ui = Chef::Knife::UI.new(STDOUT, STDERR, STDIN, {})
      @options = options.dup # unfreeze frozen options Hash from Thor
    rescue Error => e
      Whisk.ui.fatal e
      exit e.status_code
    end

    namespace "whisk"

    method_option :whiskfile,
      type: :string,
      default: File.join(Dir.pwd, Whisk::DEFAULT_FILENAME),
      desc: "Path to a Whiskfile to operate off of.",
      aliases: "-w",
      banner: "PATH"
    desc "diff", "run git diff in your bowls"
    def diff(filter=nil)
      runner = Whisk::Runner.new(options[:whiskfile], filter)
      runner.run('diff')
    end

    method_option :whiskfile,
      type: :string,
      default: File.join(Dir.pwd, Whisk::DEFAULT_FILENAME),
      desc: "Path to a Whiskfile to operate off of.",
      aliases: "-w",
      banner: "PATH"
    desc "list", "list the configured bowls and ingredients"
    def list(filter=nil)
      runner = Whisk::Runner.new(options[:whiskfile], filter)
      runner.run('list')
    end

    method_option :whiskfile,
      type: :string,
      default: File.join(Dir.pwd, Whisk::DEFAULT_FILENAME),
      desc: "Path to a Whiskfile to operate off of.",
      aliases: "-w",
      banner: "PATH"
    desc "prepare", "prepare a bowl by cloning any missing repositories"
    def prepare(filter=nil)
      runner = Whisk::Runner.new(options[:whiskfile], filter)
      runner.run('prepare')
    end

    method_option :whiskfile,
      type: :string,
      default: File.join(Dir.pwd, Whisk::DEFAULT_FILENAME),
      desc: "Path to a Whiskfile to operate off of.",
      aliases: "-w",
      banner: "PATH"
    desc "status", "run git status in your bowls"
    def status(filter=nil)
      runner = Whisk::Runner.new(options[:whiskfile], filter)
      runner.run('status')
    end

    method_option :whiskfile,
      type: :string,
      default: File.join(Dir.pwd, Whisk::DEFAULT_FILENAME),
      desc: "Path to a Whiskfile to operate off of.",
      aliases: "-w",
      banner: "PATH"
    desc "update", "run git remote update in your bowls"
    def update(filter=nil)
      runner = Whisk::Runner.new(options[:whiskfile], filter)
      runner.run('update')
    end

    method_option :whiskfile,
      type: :string,
      default: File.join(Dir.pwd, Whisk::DEFAULT_FILENAME),
      desc: "Path to a Whiskfile to operate off of.",
      aliases: "-w",
      banner: "PATH"
    desc "upload", "upload the specified bowls to a chef server"
    def upload(filter=nil)
      runner = Whisk::Runner.new(options[:whiskfile], filter)
      runner.run('upload')
    end

  end
end<commit_msg>reduce<commit_after># Author:: <NAME> <<EMAIL>>
# Copyright:: Copyright (c) 2012 <NAME>insor
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# this file is derived f

require 'thor'
require 'whisk'
require 'whisk/runner'

class Whisk
  class CLI < Thor
    def initialize(*)
      super
      # JW TODO: Replace Chef::Knife::UI with our own UI class
      ::Whisk.ui = Chef::Knife::UI.new(STDOUT, STDERR, STDIN, {})
      @options = options.dup # unfreeze frozen options Hash from Thor
    rescue Error => e
      Whisk.ui.fatal e
      exit e.status_code
    end

    namespace "whisk"

    class_option :whiskfile,
      type: :string,
      default: File.join(Dir.pwd, Whisk::DEFAULT_FILENAME),
      desc: "Path to a Whiskfile to operate off of.",
      aliases: "-w",
      banner: "PATH"

    desc "diff", "run git diff in your bowls"
    def diff(filter=nil)
      runner = Whisk::Runner.new(options[:whiskfile], filter)
      runner.run('diff')
    end

    desc "list", "list the configured bowls and ingredients"
    def list(filter=nil)
      runner = Whisk::Runner.new(options[:whiskfile], filter)
      runner.run('list')
    end

    desc "prepare", "prepare a bowl by cloning any missing repositories"
    def prepare(filter=nil)
      runner = Whisk::Runner.new(options[:whiskfile], filter)
      runner.run('prepare')
    end

    desc "status", "run git status in your bowls"
    def status(filter=nil)
      runner = Whisk::Runner.new(options[:whiskfile], filter)
      runner.run('status')
    end

    desc "update", "run git remote update in your bowls"
    def update(filter=nil)
      runner = Whisk::Runner.new(options[:whiskfile], filter)
      runner.run('update')
    end

    desc "upload", "upload the specified bowls to a chef server"
    def upload(filter=nil)
      runner = Whisk::Runner.new(options[:whiskfile], filter)
      runner.run('upload')
    end
  end
end
{'fraction_non_alphanumeric': 0.11443542934415145, 'fraction_numerical': 0.0033806626098715348, 'mean_word_length': 3.129099790648988, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1253925', 'n_tokens_mistral': 1856, 'n_tokens_neox': 1790, 'n_words': 617}