Sha256: 2d12514a6130f6c13ba7adfb6e6cf906825c82da931d825686dbd284b4b8a73f

Contents?: true

Size: 542 Bytes

Versions: 2

Compression:

Stored size: 542 Bytes

Contents

require 'sinatra'
require 'json'
require 'repoman'

module Repoman
  class App < Sinatra::Application

    configure do
      set :static, true
      set :port, 4567
    end

    get '/' do
      erb :index
    end

    get '/commits.json' do
      content_type :json
      parsed_commits = Repoman::DiffParse.new(File.expand_path('.'), ARGV[0]).parse
      if !parsed_commits.empty? 
        parsed_commits.to_json
      else
      end
    end

    not_found do
      erb :not_found
    end

    error do
      erb :error
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
repoman-0.5.2 lib/repoman/app/app.rb
repoman-0.5.1 lib/repoman/app/app.rb