Class: SedgeApi::GitController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/sedge_cms/sedge_api/git_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/sedge_cms/sedge_api/git_controller.rb', line 5

def index
  commits = []
  g = Git.open(Rails.root, :log => Logger.new(STDOUT))
  g.log.each_with_index do |commit, index|
    commits.push({:name => commit.committer.name, :message => commit.message, :commited_at => commit.committer_date})
    if index == 10
      break
    end
  end
  render :json => commits
end