Sha256: d6df06afd7e04c3cd65533cb30841be6b10d91ea3425a4796715e8935978c288

Contents?: true

Size: 514 Bytes

Versions: 1

Compression:

Stored size: 514 Bytes

Contents

require 'sinatra/base'
require 'json'
require_relative '../../pairing_matrix'

module PairingMatrix
  class Server < Sinatra::Base
    config_reader = PairingMatrix::ConfigReader.new('pairing_matrix.yml')
    config = config_reader.config
    commit_reader = PairingMatrix::CommitReader.new(config)

    get '/data/:days' do
      commit_reader.authors_with_commits(params['days'].to_i).to_json
    end

    get '/matrix' do
      File.read(File.join(File.dirname(__FILE__), 'public/index.html'))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pairing_matrix-0.1 lib/pairing_matrix/server/server.rb