This file contains hidden or 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
| # Trace is a model in vendor/plugins/mylogger/lib/app/models/trace.rb | |
| # vendor/plugins/mylogger/lib/mylogger.rb | |
| #... | |
| module MyLoggerImpl | |
| def self.trace(controller_instance) | |
| puts 'Tracing' |
This file contains hidden or 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
| controller: | |
| def show | |
| begin | |
| asset = Attachment.find(params[:id]).asset | |
| render :text => "#{asset.path} #{asset.content_type} #{asset.original_filename}" | |
| rescue | |
| session_redirect | |
| end |
This file contains hidden or 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
| def create | |
| @ticket = Ticket.new(params[:ticket]) | |
| flash[:notice] = "Ticket created." | |
| redirect_to(@ticket) | |
| end | |
| def validate | |
| errors.add("No such category") unless self.category | |
| end |
This file contains hidden or 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 "rubygems" | |
| require "hpricot" | |
| require "open-uri" | |
| url = "http://feeds.feedburner.com/Rubyconf2008-Confreaks" | |
| (Hpricot(open url)/:enclosure).map {|x| x.attributes["url"]}.uniq.each do |vid| | |
| File.exist?(vid.split("/").last) ? next : `wget #{vid}` |
NewerOlder