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
| module CouchRest | |
| class Database | |
| attr_accessor :name, :server | |
| def initialize(server, database_name) | |
| @name = database_name | |
| @server = server | |
| end | |
| def documents(params=nil) |
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
| ~ % ruby hash.rb | |
| "foo" | |
| nil | |
| hash.rb:9:in `[]': PythonLike (PythonLike) | |
| from hash.rb:14 |
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
| class Hash | |
| def stringify_keys! | |
| keys.each do |key| | |
| self[key.to_s] = delete(key) | |
| end | |
| self | |
| end | |
| def jsonify_necessary_values! | |
| values.each do |key, value| |
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
| 19:57 <sha1> http://pastie.org/281547 .. why is this weird thing happenning? | |
| 19:58 <elliottcable> one-upped! | |
| 19:58 <elliottcable> Grr apeiros can you voice me on #Ruby-Pro just so I can change nicks without leaving it? | |
| 19:59 <_rane> #ruby-pro? is that were all the elitists dwell? | |
| 19:59 <_rane> where* | |
| 19:59 <elliottcable> _rane: Apperantly so. | |
| 19:59 <elliottcable> I'd think that'd be *any* Ruby channel, but meh. | |
| 20:00 <wmoxam> lol | |
| 20:00 <wmoxam> #ruby-pro | |
| 20:00 -!- dug [n=doug@c-24-130-242-180.hsd1.ca.comcast.net] has quit [Read error: 110 (Connection timed out)] |
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
| function(doc) { | |
| if ( doc.type == "collection" ) { | |
| emit([doc._id, 0], doc); | |
| } else if ( doc.type == "entry" ) { | |
| emit([doc.collection, 1, doc.edited], doc); | |
| } | |
| } |
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
| require 'linahi' # this is just my app, which seems to work ok | |
| require 'sinatra/test/spec' | |
| context 'Linahi' do | |
| specify 'should list files when asked' do | |
| get_it '/' | |
| puts body | |
| 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
| require 'rubygems' | |
| require 'grit' | |
| %w(saloon config couchy dst dumbapp git-wiki integrity).each do |repository| | |
| repo = Grit::Repo.new(File.expand_path("~/code/#{repository}")) | |
| commits = repo.log.collect { |commit| commit.message } | |
| total_commits = commits.length.to_f | |
| cosmetic_commits = commits.select { |message| message =~ /cosmetic/ }.length.to_f | |
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
| The list is now managed directly in Sinatra's website. | |
| <http://www.sinatrarb.com/wild.html> |
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
| =begin | |
| Shooter | |
| <http://gist.github.com/25886> | |
| Harry Vangberg <http://trueaffection.net> | |
| Simon Rozet <http://purl.org/net/sr/> | |
| EXAMPLE | |
| IRC.shoot('irc://irc.freenode.net:6667/integrity', :as => "IntegrityBot") do |channel| |