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
| 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
| 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 [[email protected]] 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
| 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
| ~ % 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
| 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
| require 'rubygems' | |
| require 'json' | |
| require 'rest_client' | |
| $:.unshift File.dirname(__FILE__) + '/couch_rest' | |
| module CouchRest | |
| autoload :Server, 'server' | |
| autoload :Database, 'database' | |
| autoload :Pager, 'pager' |
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
| CmdUtils.CreateCommand( | |
| { | |
| name: "ruby", | |
| takes: {"function": noun_arb_text}, | |
| icon: "http://ruby-doc.org/favicon.ico", | |
| homepage: "http://jackndempsey.blogspot.com", | |
| author: {name: "Jack Dempsey", email: "[email protected]"}, | |
| license: "MPL,GPL", | |
| description: "Search ruby functions documentation", | |
| help: "Select a ruby function", |
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
| all: rdf html | |
| rdf: card.n3 | |
| cwm.py card.n3 --rdf > card.rdf | |
| html: head.html foot.html card.n3 foaf2html.n3 | |
| cat head.html > index.html | |
| cwm.py card.n3 foaf2html.n3 --think --strings >> index.html | |
| cat foot.html >> index.html | |
| clean: | |
| rm -f card.rdf | |
| rm -f index.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
| $rest = RestClient.new('http://foo.org') | |
| get '/' do | |
| $rest.put '/foo' | |
| 'hey' | |
| end |