Skip to content

Instantly share code, notes, and snippets.

View kamal's full-sized avatar

Kamal Fariz Mahyuddin kamal

View GitHub Profile
digest = OpenSSL::Digest::SHA1.new(data).hexdigest
sig = [@@pkey.private_encrypt(digest)].pack("m") #Base64 encode
sig = @@pkey.sign(OpenSSL::Digest::SHA1.new, data)
sig = [sig].pack("m").gsub(/\n/, "") #Base64 encode
require "rubygems"
require "sequel"
DB = Sequel.sqlite("#{File.dirname(__FILE__)}/db/penguin.sqlite3") unless defined?(DB)
unless DB.table_exists?(:waitlists)
DB.create_table :waitlists do
column :email, :text
column :app, :text
column :created_at, :timestamp
MacBook-Pro:webrat(jruby-nokogiri) kamal$ rake spec:jruby
(in /Users/kamal/src/webrat)
(in /Users/kamal/src/webrat)
.............................................................*..........................................*......********..........................................**......**...........................................................................................................................F.............................................................
Pending:
click_button should properly handle HTML entities in textarea default values (needs bug fix)
spec/public/click_button_spec.rb:333
Then /^I should see "(.*)"$/ do |text|
response.body.should =~ /#{text}/m
end
MBP:~ kamal$ ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
MBP:~ kamal$ rvm default
<i> Switching to default ...
MBP:~ kamal$ ruby -v
ruby 1.8.6 (2009-06-08 patchlevel 369) [i686-darwin9.8.0]
MBP:~ kamal$ ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
MBP:~ kamal$ rvm -v
rvm 0.0.17 (2009.08.25) [http://github.com/wayneeseguin/rvm]
MBP:~ kamal$ rvm info
ruby:
interpreter: "ruby"
version: "1.8.6"
date: "2008-08-11"
MBP:~ kamal$ rvm debug
rvm 0.0.18 (2009.08.25) [http://github.com/wayneeseguin/rvm]
ruby:
interpreter: "ruby"
version: "1.8.6"
date: "2008-08-11"
platform: "universal-darwin9.0"
patchlevel: "2008-08-11 patchlevel 287"
full_version: "ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]"
MBP:~ kamal$ rvm -v
rvm 0.0.18 (2009.08.25) [http://github.com/wayneeseguin/rvm]
MBP:~ kamal$ rvm use 1.9 --debug
+ case "$action" in
+ rvm-use ruby 1.9
+ implementation=ruby
+ case "$implementation" in
+ '[' 1.9 = 1.8.7 ']'
+ '[' 1.9 = 1.8.6 -o 1.9 = 1.8 ']'
+ '[' 1.9 = 1.9.2 ']'
1> [error] [<0.1259.0>] Uncaught error in HTTP request: {error,
                                {case_clause,
                                 {{nocatch,
                                   {compilation_error,
                                    <<"expression does not eval to a function. (undefined)">>}},
                                  [{couch_os_process,prompt,2},
                                   {couch_query_servers,
                                    '-start_doc_map/2-fun-0-',2},
                                   {lists,foreach,2},
                                   {couch_query_servers,start_doc_map,2},