require 'data/lu/states' require 'generators/lookylu/base_generator' module Lookylu module Generators class StateDataGenerator < Lookylu::Generators::BaseGenerator class_option :country_name, type: :string, default: 'united_states', desc: "Choose a country: united_states, canada, or all." def append_seeds the_file = 'db/seeds.rb' to_append = "\nLookyLu::States.insert_data('#{options.country_name}', '#{object_name}')\n" FileUtils.touch the_file append_file(the_file, to_append) end end end end