code
stringlengths
1
1.73M
language
stringclasses
1 value
#!/usr/bin/ruby # # Copyright:: Copyright 2009 Google Inc. # Original Author:: John Woodell (mailto:woodie@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
Ruby
#!/usr/bin/ruby # # Copyright:: Copyright 2009 Google Inc. # Original Author:: John Woodell (mailto:woodie@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
Ruby
#!/usr/bin/ruby # # Copyright:: Copyright 2009 Google Inc. # Original Author:: John Woodell (mailto:woodie@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
Ruby
require "rails/backtrace_cleaner.rb" module Rails class BacktraceCleaner < ActiveSupport::BacktraceCleaner def add_gem_filters add_filter { |line| line.sub(/(.+gems\.jar\!\/)(.*)/, '\2')} end end end
Ruby
require 'appengine-rack' ENV['RAILS_ENV'] = AppEngine::Rack.environment #deferred_dispatcher = AppEngine::Rack::DeferredDispatcher.new( # :require => File.expand_path('../config/environment', __FILE__), # :dispatch => 'ActionController::Dispatcher') # #map '/' do # run deferred_dispatcher #end require 'config...
Ruby
#!/usr/bin/ruby # # Copyright:: Copyright 2009 Google Inc. # Original Author:: John Woodell (mailto:woodie@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
Ruby
require 'rubygems' require 'appengine-rack' require 'appengine-apis/xmpp' require 'stringio' AppEngine::Rack.configure_app(:application => 'jruby-xmpp', :version => 1) AppEngine::Rack.app.inbound_services << :xmpp_message map "/_ah/xmpp" do run lambda {|env| data = env['rack.input'].read env['CONTENT_LENGTH...
Ruby
# Critical default settings: disable_system_gems disable_rubygems bundle_path ".gems/bundler_gems" # List gems to bundle here: gem "dm-appengine" gem "sinatra"
Ruby
require 'appengine-rack' require 'guestbook' AppEngine::Rack.configure_app( :application => 'application-id', :precompilation_enabled => true, :version => 1) run Sinatra::Application
Ruby
# Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Ruby
#!/usr/bin/env ruby APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) begin require 'rubigen' rescue LoadError require 'rubygems' require 'rubigen' end require 'rubigen/scripts/destroy' ARGV.shift if ['--help', '-h'].include?(ARGV[0]) RubiGen::Base.use_component_sources! [:rubygems, :newgem, ...
Ruby
#!/usr/bin/env ruby # File: script/console irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb' libs = " -r irb/completion" # Perhaps use a console_lib to store any extra methods I may want available in the cosole # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}" libs << " -...
Ruby
#!/usr/bin/env ruby APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) begin require 'rubigen' rescue LoadError require 'rubygems' require 'rubigen' end require 'rubigen/scripts/generate' ARGV.shift if ['--help', '-h'].include?(ARGV[0]) RubiGen::Base.use_component_sources! [:rubygems, :newgem,...
Ruby
begin require 'spec' require 'appengine-sdk' rescue LoadError require 'rubygems' require 'spec' require 'appengine-sdk' end $:.unshift(File.dirname(__FILE__) + '/../lib') require 'appengine-apis/testing' AppEngine::Testing.setup class ProtoMatcher def compare(hash, proto, prefix='') hash.each do |key,...
Ruby
begin require 'spec' rescue LoadError require 'rubygems' require 'spec' end begin require 'spec/rake/spectask' rescue LoadError puts <<-EOS To use rspec for testing you must install rspec gem: gem install rspec EOS exit(0) end desc "Run the specs under spec/models" Spec::Rake::SpecTask.new do |t| t.s...
Ruby
require 'rubygems' require 'rake/gempackagetask' require 'rake/rdoctask' require 'rubygems/specification' require 'date' require 'spec/rake/spectask' require File.dirname(__FILE__) + '/lib/appengine-apis' # set up pretty rdoc if possible begin gem 'rdoc' require 'sdoc' ENV['RDOCOPT'] = '-T lightblu...
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#! /usr/bin/ruby # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: John Woodell (mailto:woodie@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: John Wang (mailto:jwang392@gmail.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Bas Wilbers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Bas Wilbers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
Ruby
require 'rbconfig' module JRuby class Commands class << self def find_script(name) script = Config::CONFIG['bindir'] + "/#{name}" ruby_bin = nil if File.exists? script ruby_bin = File.open(script) {|io| (io.readline rescue "") =~ /^#!.*ruby/} rescue nil else ...
Ruby
require 'rubygems' # try to activate jruby-openssl gem, and only require from the gem if it's there begin gem 'jruby-openssl' require 'openssl.rb' rescue LoadError end
Ruby
JRuby distributes some ruby modules which are distributed under Ruby license: Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>. You can redistribute it and/or modify it under either the terms of the GPL (see the file GPL), or the conditions below: 1. You may make and give away verbatim copie...
Ruby
require 'rubygems' require 'rake/gempackagetask' require 'rubygems/specification' require 'date' require 'erb' require 'fileutils' ROOT = File.expand_path(File.dirname(__FILE__)) require "#{ROOT}/lib/appengine-jruby-jars" GEM_VERSION = AppEngine::JRubyJars::VERSION JRUBY_VERSION = AppEngine::JRubyJars::JRUBY_VERSION ...
Ruby
#!/usr/bin/ruby # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
Ruby
#!/usr/bin/env ruby APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) begin require 'rubigen' rescue LoadError require 'rubygems' require 'rubigen' end require 'rubigen/scripts/destroy' ARGV.shift if ['--help', '-h'].include?(ARGV[0]) RubiGen::Base.use_component_sources! [:newgem_simple, :tes...
Ruby
#!/usr/bin/env ruby APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) begin require 'rubigen' rescue LoadError require 'rubygems' require 'rubigen' end require 'rubigen/scripts/generate' ARGV.shift if ['--help', '-h'].include?(ARGV[0]) RubiGen::Base.use_component_sources! [:newgem_simple, :te...
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
require 'rubygems' require 'rake/gempackagetask' require 'rubygems/specification' require 'date' require 'spec/rake/spectask' GEM = "dm-appengine" GEM_VERSION = "0.1.3" HOMEPAGE = "http://code.google.com/p/appengine-jruby" SUMMARY = "A DataMapper adapter for Google App Engine" spec = Gem::Specification.new do |s| s...
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
module DataMapper class Property class AppEngineNative < Object primitive ::Object def dump(value) value end def load(value) value end end IMHandle = GeoPt = User = AppEngineNative end end
Ruby
module DataMapper class Property class AppEngineStringType < String def self.dump(value, property) if value.nil? nil else typecast(value) end end def self.load(value, property) value end def typecast_to_primitive(value...
Ruby
module DataMapper class Property class Rating < Integer def self.dump(value, property) AppEngine::Datastore::Rating.new(typecast(value)) if value end def self.load(value, property) value.rating if value end end end end
Ruby
module DataMapper class Property class Key < Object primitive AppEngine::Datastore::Key include PassThroughLoadDump def dump(value) typecast(value) end def load(value) value end def typecast(value) if value.nil? value ...
Ruby
module DataMapper class Property class List < Object primitive ::Object def dump(value) value end def load(value) value end end end end
Ruby
module DataMapper class Property prefix = 'dm-appengine/properties' class_mapping = [ ['key', [:AncestorKey, :Key]], ['native', [:AppEngineNative, :IMHandle, :GeoPt, :User]], ['string', [:AppEngineStringType, :Blob, :ByteString, :Link, :Email, :Category, :PhoneNumber, ...
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2010 David Masover # Original Author:: David Masover (mailto:ninja@slaphack.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:...
Ruby
$:.unshift(File.dirname(__FILE__) + '/../lib')
Ruby
require 'rubygems' require 'rake/gempackagetask' require 'rubygems/specification' require 'date' require 'spec/rake/spectask' require 'appengine-sdk' GEM = "appengine-tools" GEM_VERSION = "0.0.17" HOMEPAGE = "http://code.google.com/p/appengine-jruby" PLUGIN_SOURCE = 'src/com/google/appengine/jruby/JRubyYamlPlugin.jav...
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: John Woodell (mailto:woodie@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby1.8 -w # # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
Ruby
#!/usr/bin/ruby # Copyright:: Copyright 2009 Google Inc. # Original Author:: John Woodell (mailto:woodie@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache...
Ruby
#! /usr/bin/ruby # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache....
Ruby
#! /usr/bin/ruby # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache....
Ruby
#! /usr/bin/ruby # Copyright:: Copyright 2009 Google Inc. # Original Author:: Ryan Brown (mailto:ribrdb@google.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache....
Ruby
require 'app_engine_logger' AppEngine::LogDevice.log_uri = 'http://logservertest.appspot.com/log' log_dev = AppEngine::LogDevice.new('Sample Ruby Logger', {:api_key => 'logclient', :secret_key => '11235813'}) logger = AppEngine::Logger.new(log_dev) logger.add(Logger::INFO, "An informational message from the rub...
Ruby
require 'app_engine_logger' AppEngine::LogDevice.log_uri = 'http://localhost:8080/log' log_dev = AppEngine::LogDevice.new('Sample Ruby Logger', {:api_key => 'logclient', :secret_key => '11235813'}) logger = AppEngine::Logger.new(log_dev) logger.add(Logger::INFO, "An informational message from the ruby logger", ...
Ruby
#-- # Copyright (C) 2009 HiveSight sprl # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License, version 3, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, but WITHOU...
Ruby
require 'fileutils' app_config = File.dirname(__FILE__) + '/fixtures/application_config.yml' new_config = File.dirname(__FILE__) + "/../../../config/application_config.yml" unless File.exist?(new_config) puts "Creating default config file: #{new_config}" FileUtils.cp app_config, new_config puts "Setup complete!...
Ruby
require 'application_config' ApplicationConfig::load
Ruby
namespace :application_config do desc "Creates 'application-config' tag in plugins' SVN" task :create_svn_tag do system "svn rm https://application-config.googlecode.com/svn/tags/application-config -m 'removed'" system "svn copy https://application-config.googlecode.com/svn/trunk https://application-config...
Ruby
# Uninstall hook code here
Ruby
require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Default: run unit tests.' task :default => :test desc 'Test the application_config plugin.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.pattern = 'test/**/*_test.rb' t.verbose = true end desc 'Generate documentation for the application...
Ruby
require 'yaml' require 'erb' $__app_config = Hash.new module ApplicationConfig def self.load(config_file = File.join(RAILS_ROOT, 'config/application_config.yml')) if File.exists?(config_file) $__app_config = YAML::load(ERB.new(IO.read(config_file)).result) else raise("ApplicationConfig plugin: n...
Ruby
require 'fileutils' app_config = File.dirname(__FILE__) + '/fixtures/application_config.yml' new_config = File.dirname(__FILE__) + "/../../../config/application_config.yml" unless File.exist?(new_config) puts "Creating default config file: #{new_config}" FileUtils.cp app_config, new_config puts "Setup complete!...
Ruby
require 'application_config' ApplicationConfig::load
Ruby
namespace :application_config do desc "Creates 'application-config' tag in plugins' SVN" task :create_svn_tag do system "svn rm https://application-config.googlecode.com/svn/tags/application-config -m 'removed'" system "svn copy https://application-config.googlecode.com/svn/trunk https://application-config...
Ruby
# Uninstall hook code here
Ruby
require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Default: run unit tests.' task :default => :test desc 'Test the application_config plugin.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.pattern = 'test/**/*_test.rb' t.verbose = true end desc 'Generate documentation for the application...
Ruby
require 'yaml' require 'erb' $__app_config = Hash.new module ApplicationConfig def self.load(config_file = File.join(RAILS_ROOT, 'config/application_config.yml')) if File.exists?(config_file) $__app_config = YAML::load(ERB.new(IO.read(config_file)).result) else raise("ApplicationConfig plugin: n...
Ruby
# $ext_path: This should be the path of where the ExtJS SDK is installed # Generally this will be in a lib/extjs folder in your applications root # <root>/lib/extjs $ext_path = "../../" # sass_path: the directory your Sass files are in. THIS file should also be in the Sass folder # Generally this will be in a resource...
Ruby
# include the utils rb file which has extra functionality for the ext theme dir = File.dirname(__FILE__) require File.join(dir, 'lib', 'utils.rb') # register ext4 as a compass framework Compass::Frameworks.register 'ext4', dir
Ruby
# $ext_path: This should be the path of the Ext JS SDK relative to this file $ext_path = "../../extjs" # sass_path: the directory your Sass files are in. THIS file should also be in the Sass folder # Generally this will be in a resources/sass folder # <root>/resources/sass sass_path = File.dirname(__FILE__) # css_pat...
Ruby
module ExtJS4 module SassExtensions module Functions module Utils def parsebox(list, n) assert_type n, :Number if !n.int? raise ArgumentError.new("List index #{n} must be an integer") elsif n.to_i < 1 raise ArgumentError.new("List index #{n} must...
Ruby
require 'appwiki/note/note_controller.rb' class ScrapbookController < NoteController # xxx sigh xxx the problem is we really want the notes areas files as a fallback # it just means we cannot trivially subclass this scrapbook controller without supplying whereami # def whereami() [__FILE__] end end
Ruby
@@routes = [] # handle files with a .jpg or a .anything load 'appwiki/base/base_file_route.rb' @@routes << BaseFileRoute # handle users load 'appwiki/user/user_route.rb' @@routes << UserRoute # handle notes load 'appwiki/note/note_route.rb' @@routes << NoteRoute # default load "appwiki/route.rb" @...
Ruby
require 'appwiki/base/base_controller.rb' require 'appwiki/user/user.rb' require 'appwiki/note/note.rb' #require 'appwiki/group/group.rb' #require_gem 'ruby-openid' # # User Management # # See http://www.aidanf.net/rails_user_authentication_tutorial # And http://cs.nerdbank.net/blogs/jmpinline/archive/2006/06/03/243...
Ruby
require 'appwiki/base/base_route.rb' require 'appwiki/user/user.rb' class UserRoute < BaseRoute def self.get_handlerpath(request,response,requestpath) # where to look for the controller.rb and .rhtml files handlerpath = nil # where to fetch media assets (everything excepting controller.rb and .r...
Ruby
require 'digest/sha1' # require_gem 'acts_as_taggable' - no user self tagging for now xxx? class User < ActiveRecord::Base #acts_as_taggable # basic validation validates_length_of :login, :within => 3..20 validates_length_of :password, :within => 5..20 validates_presence_of :login, :email, :pa...
Ruby
require 'note/note_controller.rb' include ActionView::Helpers::TextHelper class SignalController < NoteController def event return render_rhtml_with_controller_layout(:index, "skeleton/layout") end def post # xxx the system should be smart enough to know that post.rhtml exists # xxx also the layo...
Ruby
#!/usr/local/bin/ruby require 'appwiki/base/base.rb' @@debuglog = false @@debug = 1 @@sitename = "appwiki" @@sethostpath = "#{@@sitename}" @@sethostname = "#{@@sitename}.com" @@forcehostname = nil # a hack to pretend to always see a given dns name. @@server_port = 3006 @@server_ip = '127.0.0.1' @@debuglogger= nil @...
Ruby
#!/usr/local/bin/ruby require 'appwiki/base/base.rb' @@debuglog = false @@debug = 1 @@sitename = "appwiki" @@sethostpath = "#{@@sitename}" @@sethostname = "#{@@sitename}.com" @@forcehostname = nil # a hack to pretend to always see a given dns name. @@server_port = 3006 @@server_ip = '127.0.0.1' @@debuglogger= nil @...
Ruby
#!/usr/local/bin/ruby require 'rubygems' require 'open-uri' require 'uri' require 'net/http' require 'xmlsimple' def escape(s); s.to_s.gsub(/([^ a-zA-Z0-9_.-]+)/n){'%'+$1.unpack('H2'*$1.size).join('%').upcase}.tr(' ', '+') end puts '<?xml version="1.0" encoding="UTF-8"?>' puts '<feeds xmlns="http://beta.meadan.or...
Ruby
#!/usr/local/bin/ruby require 'rubygems' require 'open-uri' require 'uri' require 'net/http' require 'xmlsimple' def escape(s); s.to_s.gsub(/([^ a-zA-Z0-9_.-]+)/n){'%'+$1.unpack('H2'*$1.size).join('%').upcase}.tr(' ', '+') end puts '<?xml version="1.0" encoding="UTF-8"?>' puts '<feeds xmlns="http://beta.meadan.or...
Ruby
# # This aggregator queries both melissadata and networkforgood/guidestar for information about non-profits: # # http://w5.melissadata.com/lookups/np.asp?zip=97048&submit1=Submit # http://melissadata.com/lookups/np.asp?ein=131659627 # http://www.guidestar.org/pqShowGsReport.do?partner=networkforgood&ein=13-165962...
Ruby
require 'appwiki/note/note_controller.rb' class WikiController < NoteController def whereami() [__FILE__] end def index # # todo # - present input box # - write changes to db # - keep versions # - maybe a captcha # - maybe write to fs also???? # - can i name th...
Ruby
require 'appwiki/note/tag.rb' require 'appwiki/user/user.rb' require 'find' # require_gem 'acts_as_taggable' # # members of a given subject; as a way to do group forming # class NotesUser < ActiveRecord::Base belongs_to :user belongs_to :note def update super end end # # recent observers of a given sub...
Ruby
require 'appwiki/base/base_controller.rb' require 'appwiki/user/user.rb' require 'appwiki/note/note.rb' # # # This controller implements a default view and api over notes. # These kinds of features exist: # + rest api to query for features # + rest api to post features # + common properties typically associated...
Ruby
# tagging class Tag < ActiveRecord::Base end
Ruby
require 'appwiki/base/base_route.rb' require 'appwiki/note/note.rb' class NoteRoute < BaseRoute def self.get_handlerpath(request,response,requestpath) # where to look for the controller.rb and .rhtml files handlerpath = nil # where to fetch media assets (everything excepting controller.rb and .rhtml fil...
Ruby
# # quick and dirty note builder based on a schema # # not dissimilar from active-record scaffolding except different primitives # # useful to do on server side for a variety of reasons such as verifying data # require 'rubygems' require 'json' def to_html(note,schema,form) # load schema sc...
Ruby
require 'appwiki/note/note_controller.rb' # provides specialized server side support for a chatmap type area # may provide non ajax support for chat history at some point xxx # xxx is this obsolete? class LocalAreaController < NoteController def index render :action => :index end end
Ruby