Sha256: 3f7cbd5ddb620a44476edec7183a9751072cdb0df944ddc26538020a605febbf

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

require 'rubygems'
require 'bundler'
require 'grape/activerecord/rake'

begin
  Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
  $stderr.puts e.message
  $stderr.puts 'Run `bundle install` to install missing gems'
  exit e.status_code
end

require 'rake'
<% if config[:rspec] %>
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

task :default => :spec
<% else %>
require "rake/testtask"

Rake::TestTask.new(:test) do |t|
  t.libs << "test"
  t.libs << "lib"
  t.test_files = FileList['test/**/*_test.rb']
end

task :default => :test
<% end %>

task :environment do
  ENV['RACK_ENV'] ||= 'development'
  require File.expand_path('../config/environment', __FILE__)
end

namespace :db do
  task :environment do
    require File.expand_path('../config/environment', __FILE__)
  end
end

task routes: :environment do
  <%= config[:app_name] %>::API.routes.each do |route|
    method = route.route_method.ljust(10)
    path   = route.route_path
    puts "     #{method} #{path}"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
grape-cli-0.2.5 lib/grape_cli/templates/application/Rakefile.tt
grape-cli-0.2.4 lib/grape_cli/templates/application/Rakefile.tt
grape-cli-0.2.3 lib/grape_cli/templates/application/Rakefile.tt