Sha256: 4275903b3e2228e1289dce742030a7ba153908f884f77ff24717ea20568f6859

Contents?: true

Size: 763 Bytes

Versions: 7

Compression:

Stored size: 763 Bytes

Contents

if get(:api_support)
  gather_gem 'versionist'
  gather_gem 'responders'
  gather_gem 'active_model_serializers', '~> 0.9.3'
  gather_gem 'simple_token_authentication', '~> 1.0'

  after(:gem_install) do
    line = "Rails.application.routes.draw do\n"
    insert_into_file "config/routes.rb", after: line do
      <<-HERE.gsub(/^ {7}/, '')
        scope path: '/api' do
          api_version(:module => "Api::V1", :path => {:value => "v1"}) do
          end
        end
      HERE
    end

    copy_file 'assets/api/base_controller.rb', 'app/controllers/api/v1/base_controller.rb'
    copy_file 'assets/api/api_error_concern.rb', 'app/controllers/concerns/api_error_concern.rb'
    copy_file 'assets/api/responder.rb', 'app/responders/api_responder.rb'
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
potassium-1.3.5 lib/potassium/templates/application/recipes/api.rb
potassium-1.3.4 lib/potassium/templates/application/recipes/api.rb
potassium-1.3.3 lib/potassium/templates/application/recipes/api.rb
potassium-1.3.2 lib/potassium/templates/application/recipes/api.rb
potassium-1.3.0 lib/potassium/templates/application/recipes/api.rb
potassium-1.2.4 lib/potassium/templates/application/recipes/api.rb
potassium-1.2.3 lib/potassium/templates/application/recipes/api.rb