Sha256: bf86094095cf424498a4ade2e7416947f9904e28da9824653d199211a1742d98

Contents?: true

Size: 540 Bytes

Versions: 2

Compression:

Stored size: 540 Bytes

Contents

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

module PairingMatrix
  class Server < Sinatra::Base
    set :bind, '0.0.0.0'

    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

2 entries across 2 versions & 1 rubygems

Version Path
pairing_matrix-0.1.2 lib/pairing_matrix/server/server.rb
pairing_matrix-0.1.1 lib/pairing_matrix/server/server.rb