Rakefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. require 'rake'
  2. require "bundler/gem_tasks"
  3. require 'rake/testtask'
  4. require 'rubocop/rake_task'
  5. Rake::TestTask.new(:test) do |test|
  6. test.libs << 'lib' << 'test'
  7. test.pattern = 'test/**/*_test.rb'
  8. test.warning = false
  9. end
  10. RuboCop::RakeTask.new
  11. begin
  12. require 'rcov/rcovtask'
  13. Rcov::RcovTask.new do |test|
  14. test.libs << 'test'
  15. test.pattern = 'test/**/*_test.rb'
  16. test.verbose = true
  17. end
  18. rescue LoadError
  19. task :rcov do
  20. abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
  21. end
  22. end
  23. task :default => [:test, :rubocop, :verify_docs]
  24. require 'verify_docs'
  25. task :verify_docs do
  26. unless VerifyDocs.call
  27. abort("\nWARNING: docs/index.md and README.md no longer have identical content. Please correct this.")
  28. end
  29. end
  30. require 'rdoc/task'
  31. Rake::RDocTask.new do |rdoc|
  32. if File.exist?('VERSION.yml')
  33. config = YAML.load(File.read('VERSION.yml'))
  34. version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
  35. else
  36. version = ""
  37. end
  38. rdoc.rdoc_dir = 'rdoc'
  39. rdoc.title = "shopify_api #{version}"
  40. rdoc.rdoc_files.include('README*')
  41. rdoc.rdoc_files.include('lib/**/*.rb')
  42. end
  43. task :docker do
  44. cmd = "docker-compose up -d && docker exec -i -t shopify_api bash"
  45. exec(cmd, err: File::NULL)
  46. end