Sha256: dce4f2a62f289fbfaa76831dc68d7790fef6879898267dac5195cfb8b4782926

Contents?: true

Size: 477 Bytes

Versions: 4

Compression:

Stored size: 477 Bytes

Contents

require 'sinatra'
require 'sequel'

module Dcmgr::Web
  class Base < Sinatra::Base
    set :logger, false
    helpers { include Dcmgr::Helpers }
    
    def self.public_crud model
      model.actions {|action, pattern, proc|
        Dcmgr::logger.debug "REGISTER: %s %s" % [action, pattern]
        self.send action, pattern, &proc
      }
    end

    not_found do
      logger.debug "not found: #{request.request_method} #{request.path}"
      "not found"
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
wakame-vdc-dcmgr-10.12.0 lib/dcmgr/web/base.rb
wakame-vdc-agents-10.12.0 lib/dcmgr/web/base.rb
wakame-vdc-dcmgr-10.11.0 lib/dcmgr/web/base.rb
wakame-vdc-agents-10.11.0 lib/dcmgr/web/base.rb