<commit_before>require 'panorama'
require 'bulk_career_importer'

class CareersController < ApplicationController
  before_action :set_career, only: [:show, :edit, :update, :destroy, :panorama]

  respond_to :html

  def index
    @careers = Career.all
    respond_with(@careers)
  end

  def show
    respond_with(@career)
  end

  def new
    @career = Career.new
    respond_with(@career)
  end

  def edit
  end

  def create
    @career = BulkCareerImporter.new career_params[:name],
                                     career_params[:requirements].try(:tempfile),
                                     career_params[:description]
    respond_with(@career)
  end

  def update
    @career = BulkCareerImporter.new career_params[:name],
                                     career_params[:requirements].try(:tempfile),
                                     career_params[:description]
    respond_with(@career)
  end

  def destroy
    @career.destroy
    respond_with(@career)
  end

  def panorama
    @panorama = Panorama.new @career
    respond_with(@panorama)
  end

  private
    def set_career
      @career = Career.find(params[:id])
    end

    def career_params
      params.require(:career).permit(:name, :description, :requirements)
    end
end<commit_msg>Remove duplication.<commit_after>require 'panorama'
require 'bulk_career_importer'

class CareersController < ApplicationController
  before_action :set_career, only: [:show, :edit, :update, :destroy, :panorama]

  respond_to :html

  def index
    @careers = Career.all
    respond_with(@careers)
  end

  def show
    respond_with(@career)
  end

  def new
    @career = Career.new
    respond_with(@career)
  end

  def edit
  end

  def create
    @career = build_bulk_importer
    respond_with(@career)
  end

  def update
    @career = build_bulk_importer
    respond_with(@career)
  end

  def destroy
    @career.destroy
    respond_with(@career)
  end

  def panorama
    @panorama = Panorama.new @career
    respond_with(@panorama)
  end

  private
    def set_career
      @career = Career.find(params[:id])
    end

    def career_params
      params.require(:career).permit(:name, :description, :requirements)
    end

    def build_bulk_importer
      BulkCareerImporter.new career_params[:name],
        career_params[:requirements].try(:tempfile),
        career_params[:description]
    end
end
{'fraction_non_alphanumeric': 0.08770457406630298, 'fraction_numerical': 0.0, 'mean_word_length': 2.7661927330173777, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5756292', 'n_tokens_mistral': 786, 'n_tokens_neox': 755, 'n_words': 159}