This file contains 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/remote_fetcher' | |
require 'zlib' | |
class GemSpec | |
include DataMapper::Resource | |
property :id, Integer, :serial => true | |
property :authors, DataMapper::Types::Object, :lazy => true | |
# property :dependencies, DataMapper::Types::Object, :lazy => true | |
property :description, DataMapper::Types::Text, :lazy => false |
This file contains 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 File.join(File.dirname(__FILE__), "spec_helper") | |
FileUtils.rm_rf(Merb.root / ".srcs") | |
describe "a POST to /ci/push" do | |
def request_push(user, name) | |
request("/ci/push", :method => "POST", | |
"CONTENT_TYPE" => "application/json", | |
:input => {:payload => {:repository => | |
{:name => name, :user => user, | |
:url => "git://github.com/wycats/merb.git"}}}.to_json) |
This file contains 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 "fileutils" | |
class Ci < Merb::Controller | |
def _template_location(action, type = nil, controller = controller_name) | |
controller == "layout" ? "layout.#{action}.#{type}" : "#{action}.#{type}" | |
end | |
def push(payload) | |
repo = payload[:repository] |
This file contains 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 YourApp | |
class ExampleGroup < Merb::Test::ExampleGroup | |
before(:each) do | |
@transaction = DataMapper::Transaction.new(repository(:default)) | |
@transaction.begin | |
repository(:default).adapter.push_transaction(@transaction) | |
end | |
after(:each) do | |
repository(:default).adapter.pop_transaction |
This file contains 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
<?xml version="1.0"?> | |
<methodCall> | |
<methodName>examples.getStateName</methodName> | |
<params> | |
<param> | |
<value><i4>41</i4></value> | |
</param> | |
</params> | |
</methodCall> | |
This file contains 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
commit ac0879a3896865d1f67d64fd93020218da990329 | |
Author: Yehuda Katz <[email protected]> | |
Date: Wed Oct 22 15:05:24 2008 -0700 | |
Some changes | |
diff --git a/lib/nokogiri/css/xpath_visitor.rb b/lib/nokogiri/css/xpath_visitor.rb | |
index 3309887..77a4c56 100644 | |
--- a/lib/nokogiri/css/xpath_visitor.rb | |
+++ b/lib/nokogiri/css/xpath_visitor.rb |
This file contains 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
#load required files | |
require 'rubygems' | |
gem 'merb-core', '>= 0' | |
require 'merb-core' | |
require 'rack/handler/grizzly' | |
require 'rack/adapter/merb' | |
require 'jruby/rack/grizzly_helper' | |
Merb::Rack::Adapter.register %w{grizzly}, :GrizzlyMerb | |
This file contains 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
#load required files | |
require 'rubygems' | |
gem 'merb-core', '>= 0' | |
require 'merb-core' | |
# require 'rack/handler/grizzly' | |
# require 'rack/adapter/merb' | |
# require 'jruby/rack/grizzly_helper' | |
# Merb::Rack::Adapter.register %w{grizzly}, :GrizzlyMerb | |
This file contains 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 'fcgi' | |
require 'socket' | |
module Rack | |
module Handler | |
class FastCGI | |
def self.run(app, options={}) | |
file = options[:File] and STDIN.reopen(UNIXServer.new(file)) | |
port = options[:Port] and STDIN.reopen(TCPServer.new(port)) | |
FCGI.each { |request| |
This file contains 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 'mongrel' | |
require 'stringio' | |
module Rack | |
module Handler | |
class Mongrel < ::Mongrel::HttpHandler | |
def self.run(app, options={}) | |
server = ::Mongrel::HttpServer.new(options[:Host] || '0.0.0.0', | |
options[:Port] || 8080) | |
# Acts like Rack::URLMap, utilizing Mongrel's own path finding methods. |