Sha256: 27607fa20a36a4a0523cd01bcbb6347e84d04cb8a68d69e64732cb901e793e38
Contents?: true
Size: 735 Bytes
Versions: 14
Compression:
Stored size: 735 Bytes
Contents
class SetupController < ApplicationController before_filter :require_local! layout :false def index @env = File.read( File.join( Rails.root, ".env" ) ) @docs = files end protected def require_local! unless local_request? redirect_to root_url, error: "This information is only available to local requests" end end def local_request? Rails.application.config.consider_all_requests_local || request.local? end def files docs = Dir.glob(File.join( Rails.root, "docs/README.*" )).collect do |file| name = file.gsub( /.*README.\d\d./, "happy_seed:" ).gsub( /.rdoc/, "" ) html = RDiscount.new( File.read( file ) ).to_html { name: name, html: html } end end end
Version data entries
14 entries across 14 versions & 1 rubygems