<commit_before>require 'with_model/model'
require 'with_model/model/dsl'
require 'with_model/table'
require 'with_model/version'

module WithModel
  def with_model(name, options = {}, &block)
    model = Model.new name, options
    dsl = Model::DSL.new model
    dsl.instance_exec(&block) if block
    scope = options.fetch(:scope, :each)

    before scope do
      model.create
    end

    after scope do
      model.destroy
    end
  end

  def with_table(name, options = {}, &block)
    table = Table.new name, options, &block
    scope = options.fetch(:scope, :each)

    before scope do
      table.create
    end

    after scope do
      table.destroy
    end<commit_msg>Avoid passing :scope option to Model.new<commit_after>require 'with_model/model'
require 'with_model/model/dsl'
require 'with_model/table'
require 'with_model/version'

module WithModel
  def with_model(name, options = {}, &block)
    options = options.dup
    scope = options.delete(:scope) { :each }

    model = Model.new name, options
    dsl = Model::DSL.new model
    dsl.instance_exec(&block) if block

    before scope do
      model.create
    end

    after scope do
      model.destroy
    end
  end

  def with_table(name, options = {}, &block)
    options = options.dup
    scope = options.delete(:scope) { :each }

    table = Table.new name, options, &block

    before scope do
      table.create
    end

    after scope do
      table.destroy
    end
{'fraction_non_alphanumeric': 0.0967519004837595, 'fraction_numerical': 0.0, 'mean_word_length': 2.820580474934037, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '870171', 'n_tokens_mistral': 458, 'n_tokens_neox': 445, 'n_words': 128}