Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surveyor: Make parse function case-insensitive #90

Open
john-huang-121 opened this issue Jan 13, 2020 · 0 comments
Open

Surveyor: Make parse function case-insensitive #90

john-huang-121 opened this issue Jan 13, 2020 · 0 comments

Comments

@john-huang-121
Copy link

Make surveyor_tasks.rake parse method to be case-insensitive when it matches the file. This may help avoid capitalization issues when the ENV['file'] filepath name matches the filename in value, but not lettercase.

desc "generate and load survey (specify FILE=surveys/your_survey.rb)"
task :surveyor => :"surveyor:parse"

namespace :surveyor do
  task :parse => :environment do
    raise "USAGE: file name required e.g. 'FILE=surveys/kitchen_sink_survey.rb'" if ENV["FILE"].blank?
    file = ENV["FILE"].include?(Rails.root.to_s) ? ENV["FILE"] : File.join(Rails.root, ENV["FILE"])
    raise "File does not exist: #{file}" unless FileTest.exists?(file)
    puts "--- Parsing #{file} ---"
    Surveyor::Parser.parse_file(file, {:trace => Rake.application.options.trace})
    puts "--- Done #{file} ---"
  end
@john-huang-121 john-huang-121 self-assigned this Jan 13, 2020
@john-huang-121 john-huang-121 removed their assignment Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant