This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'gollum/app' | |
# to make a valid Git repo by using Heroku's ephemeral filesystem. | |
Grit::Repo.init('.').add('.').commit_all('initial commit for gollum') unless File.exists? '.git' | |
Precious::App.set(:gollum_path, '.') | |
# setting default markup | |
Precious::App.set(:default_markup, :markdown) # markdown or rdoc your call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'gollum/frontend/app' | |
require 'digest/sha1' | |
class App < Precious::App | |
User = Struct.new(:name, :email, :password_hash, :can_write) | |
before { authenticate! } | |
before /^\/(edit|create|delete|livepreview|revert)/ do authorize_write! ; end | |
helpers do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubocop' | |
git_changed_rows = `git status --porcelain` | |
changed_rows_array = git_changed_rows.split(/\n/) | |
added_or_changed_rows_array = changed_rows_array.select { |row| row =~ /A|AM|^M/ } |