Skip to content

Instantly share code, notes, and snippets.

View ab5tract's full-sized avatar

ab5tract ab5tract

  • Amsterdam, Netherlands
View GitHub Profile
def self.dependencies( *args )
self['dependencies'] ||= Set.new
args.length == 0 ? self['dependencies'] :
self['dependencies'] += ( args - gems.dependencies )
end
Runtime config attributes
host
port (will it be possible for an app to have a separate port?)
log (i'm beginning to see that runtime level logs may be best. perhaps the runtime could have an optional "log viewer" waves app built in that could sort out stuff 'per app')
debug
synchronize?
application (rack builder block)
mime_types
resources (routing)
handler (rack handler)
http://www.codingmonkeys.de/subethaedit/
a grammar for me, a grammar for home, a grammar for anybody, and a grammar for none
$ waves-console
>> Waves.cache[:o] = :p
NoMethodError: undefined method `[]=' for nil:NilClass
from (irb):1
>> Waves.config.cache
=> {:dir=>"/tmp"}
>> m = Waves::Layers::Cache::FileCache
=> Waves::Layers::Cache::FileCache
>> o = m.new Waves.config.cache
NoMethodError: undefined method `new' for Waves::Layers::Cache::FileCache:Module
$ waves-console
./lib/application.rb:7:in `included': wrong number of arguments (1 for 0) (ArgumentError)
from ./lib/application.rb:7:in `include'
from ./lib/application.rb:7
from /Library/Ruby/Gems/1.8/gems/waves-0.8.0/lib/runtime/runtime.rb:47:in `load'
from /Library/Ruby/Gems/1.8/gems/waves-0.8.0/lib/runtime/runtime.rb:47:in `initialize'
from /Library/Ruby/Gems/1.8/gems/waves-0.8.0/lib/runtime/console.rb:10:in `new'
from /Library/Ruby/Gems/1.8/gems/waves-0.8.0/lib/runtime/console.rb:10:in `load'
from /Library/Ruby/Gems/1.8/gems/waves-0.8.0/lib/commands/waves-console.rb:16
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
#!waves#########/0.8.0/##\|/4V35###
# a Waves Cache brought to you by ab5tract
# :This is the Cache API. Do as you will, so long as you return what I do.
###################################
module Waves
class Cache
# Exception classes
module Waves
module Layers
module Cache
module FileCache
def self.included(app)
require 'layers/cache/filecache/filecache-ipi'
if Waves.cache.nil?
module Waves
module Cache
module Memcached
module Extensions
def method_missing(*args, &block)
@cache.__send__(*args, &block)
rescue => e
Waves::Logger.error e.to_s
I, [2008-09-25 00:25:43 #1341] INFO -- : Waves Runtime 0.8.0 **
>> require 'layers/cache/memcached'
=> true
>> include Waves::Layers::Cache::Memcached
=> Object
>> x = Waves::Cache::Memcached
=> Waves::Cache::Memcached
>> x.new :servers => '127.0.0.1'
=> #<Memcached:0x192c948 @options={:show_not_found_backtraces=>false, :prefix_key=>nil, :hash=>:default, :buffer_requests=>false, :failover=>false, :connect_timeout=>5, :tcp_nodelay=>false, :retry_timeout=>60, :support_cas=>false, :distribution=>:consistent, :verify_key=>true, :no_block=>false, :cache_lookups=>true, :sort_hosts=>false}, @struct=#<Rlibmemcached::MemcachedSt:0x192c90c>>
>> x.store :y, 5
john@Curts-MacBook ~/ruby/pages[hashin]% waves-console
./waves/lib/runtime/runtime.rb:32:in `send': undefined method `cache' for nil:NilClass (NoMethodError)
from ./waves/lib/runtime/runtime.rb:32:in `method_missing'
from ./waves/lib/layers/cache/file.rb:10:in `included'
from ./lib/application.rb:12:in `include'
from ./lib/application.rb:12
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
from ./startup.rb:1
from ./waves/lib/runtime/runtime.rb:50:in `load'