code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
module FlowbaseHelper
end
| Ruby |
class Agent < ActiveRecord::Base
has_many :transfers
end
| Ruby |
class Transfer < ActiveRecord::Base
def agent
return Agent.find(self.agent_id)
end
def recipient
return Agent.find(self.recipient_id)
end
end
| Ruby |
class FlowbaseController < ApplicationController
def index
list
render :action => 'list'
end
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :create, :update ],
:redirect_to => { :action => :list }
def list
@tran... | Ruby |
class FlowController < ApplicationController
def index
@urlbase = "http://www.armsflow.org"
# @urlbase = "http://localhost:3000"
if params[:id].blank?
@year = 2006
else
@year = params[:id]
end
if @year.to_i > 2006
@year = 2006
elsif @year.to_i < 1950
@year = 1950
... | Ruby |
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
# Pick a unique cookie name to distinguish our session data from others'
session :session_key => '_flowbase_s... | Ruby |
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/breakpointer' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/console' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/runner' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/benchmarker'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/benchmarker'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/profiler'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/profiler'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/plugin' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/destroy' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/about' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/runner' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/breakpointer' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/server' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/generate' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/console' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/reaper'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/inspector'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/inspector'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/spawner'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/reaper'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/process/spawner'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/destroy' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/generate' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/server' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/about' | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/plugin' | Ruby |
class CreateAgents < ActiveRecord::Migration
def self.up
create_table :agents do |t|
t.column "name", :string
t.column "lat", :float
t.column "lon", :float
end
end
def self.down
drop_table :agents
end
end
| Ruby |
class CreateTransfers < ActiveRecord::Migration
def self.up
create_table :transfers do |t|
t.column "agent_name", :string
t.column "agent_id", :integer
t.column "recipient_name", :string
t.column "recipient_id", :integer
t.column "value", :float
t.colu... | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaire... | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaire... | Ruby |
#!/usr/bin/env ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
... | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaire... | Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaire... | Ruby |
#!/usr/bin/env ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
... | Ruby |
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
class Test::Unit::TestCase
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion. This ensures that the
# test datab... | Ruby |
#!./miniruby -s
$name = $library = $description = nil
SYM = {}
STDIN.reopen(open("nul"))
ARGV.each do |obj|
IO.foreach("|tdump -q -oiPUBDEF -oiPUBD32 #{obj.tr('/', '\\')}") do |l|
next unless /(?:PUBDEF|PUBD32)/ =~ l
SYM[$1] = true if /'(.*?)'/ =~ l
end
end
exports = []
if $name
exports << "Name " + $n... | Ruby |
#! ./miniruby
exit if defined?(CROSS_COMPILING)
load './rbconfig.rb'
include Config
ruby = "./#{CONFIG['ruby_install_name']}#{CONFIG['EXEEXT']}"
unless File.exist? ruby
print "#{ruby} is not found.\n"
print "Try `make' first, then `make test', please.\n"
exit false
end
if File.exist? CONFIG['LIBRUBY_SO']
cas... | Ruby |
#!/usr/bin/env ruby
###
### mdoc2man - mdoc to man converter
###
### Quick usage: mdoc2man.rb < mdoc_manpage.8 > man_manpage.8
###
### Ported from Perl by Akinori MUSHA.
###
### Copyright (c) 2001 University of Illinois Board of Trustees
### Copyright (c) 2001 Mark D. Roth
### Copyright (c) 2002, 2003 Akinori MUSHA... | Ruby |
#--
# sha2.rb - defines Digest::SHA2 class which wraps up the SHA256,
# SHA384, and SHA512 classes.
#++
# Copyright (c) 2006 Akinori MUSHA <knu@iDaemons.org>
#
# All rights reserved. You can redistribute and/or modify it under the same
# terms as Ruby.
#
# $Id: sha2.rb 11708 2007-02-12 23:01:19Z shyouhei $... | Ruby |
# just for compatibility; requiring "md5" is obsoleted
#
# $RoughId: md5.rb,v 1.4 2001/07/13 15:38:27 knu Exp $
# $Id: md5.rb 12007 2007-03-06 10:09:51Z knu $
require 'digest/md5'
class MD5 < Digest::MD5
class << self
alias orig_new new
def new(str = nil)
if str
orig_new.update(str)
else... | Ruby |
# just for compatibility; requiring "sha1" is obsoleted
#
# $RoughId: sha1.rb,v 1.4 2001/07/13 15:38:27 knu Exp $
# $Id: sha1.rb 12007 2007-03-06 10:09:51Z knu $
require 'digest/sha1'
class SHA1 < Digest::SHA1
class << self
alias orig_new new
def new(str = nil)
if str
orig_new.update(str)
... | Ruby |
require 'digest.so'
module Digest
def self.const_missing(name)
case name
when :SHA256, :SHA384, :SHA512
lib = 'digest/sha2.so'
else
lib = File.join('digest', name.to_s.downcase)
end
begin
require lib
rescue LoadError => e
raise LoadError, "library not found for class ... | Ruby |
#
# newton.rb
#
# Solves the nonlinear algebraic equation system f = 0 by Newton's method.
# This program is not dependent on BigDecimal.
#
# To call:
# n = nlsolve(f,x)
# where n is the number of iterations required,
# x is the initial value vector
# f is an Object which is used to compute the value... | Ruby |
#
# Solves a*x = b for x, using LU decomposition.
#
module LUSolve
# Performs LU decomposition of the n by n matrix a.
def ludecomp(a,n,zero=0,one=1)
prec = BigDecimal.limit(nil)
ps = []
scales = []
for i in 0...n do # pick up largest(abs. val.) element in each row.
ps <<= i
nrmrow ... | Ruby |
#
# require 'bigdecimal/jacobian'
#
# Provides methods to compute the Jacobian matrix of a set of equations at a
# point x. In the methods below:
#
# f is an Object which is used to compute the Jacobian matrix of the equations.
# It must provide the following methods:
#
# f.values(x):: returns the values of all functio... | Ruby |
#
# BigDecimal utility library.
#
# To use these functions, require 'bigdecimal/util'
#
# The following methods are provided to convert other types to BigDecimals:
#
# String#to_d -> BigDecimal
# Float#to_d -> BigDecimal
# Rational#to_d -> BigDecimal
#
# The following method is provided to convert BigDecimals to ... | Ruby |
#
#--
# Contents:
# sqrt(x, prec)
# sin (x, prec)
# cos (x, prec)
# atan(x, prec) Note: |x|<1, x=0.9999 may not converge.
# exp (x, prec)
# log (x, prec)
# PI (prec)
# E (prec) == exp(1.0,prec)
#
# where:
# x ... BigDecimal number to be computed.
# |x| must be small enough to get con... | Ruby |
#
# kconv.rb - Kanji Converter.
#
# $Id: kconv.rb 11708 2007-02-12 23:01:19Z shyouhei $
#
# ----
#
# kconv.rb implements the Kconv class for Kanji Converter. Additionally,
# some methods in String classes are added to allow easy conversion.
#
require 'nkf'
#
# Kanji Converter for Ruby.
#
module Kconv
#
# Public ... | Ruby |
require 'mkmf'
create_makefile('stringio')
| Ruby |
#--
# sha2.rb - defines Digest::SHA2 class which wraps up the SHA256,
# SHA384, and SHA512 classes.
#++
# Copyright (c) 2006 Akinori MUSHA <knu@iDaemons.org>
#
# All rights reserved. You can redistribute and/or modify it under the same
# terms as Ruby.
#
# $Id: sha2.rb 11708 2007-02-12 23:01:19Z shyouhei $... | Ruby |
# $RoughId: extconf.rb,v 1.4 2001/08/14 19:54:51 knu Exp $
# $Id: extconf.rb 11708 2007-02-12 23:01:19Z shyouhei $
require "mkmf"
$defs << "-DHAVE_CONFIG_H"
$INCFLAGS << " -I$(srcdir)/.."
$objs = [
"sha2.#{$OBJEXT}",
"sha2init.#{$OBJEXT}",
]
have_header("sys/cdefs.h")
have_header("inttypes.h")
have_header("un... | Ruby |
require 'mkmf'
$defs << "-DHAVE_CONFIG_H"
$INCFLAGS << " -I$(srcdir)/.."
create_makefile('digest/bubblebabble')
| Ruby |
# $RoughId: extconf.rb,v 1.3 2001/08/14 19:54:51 knu Exp $
# $Id: extconf.rb 11708 2007-02-12 23:01:19Z shyouhei $
require "mkmf"
$defs << "-DHAVE_CONFIG_H"
$INCFLAGS << " -I$(srcdir)/.."
$objs = [ "sha1init.#{$OBJEXT}" ]
dir_config("openssl")
if !with_config("bundled-sha1") &&
have_library("crypto") && have_h... | Ruby |
# just for compatibility; requiring "md5" is obsoleted
#
# $RoughId: md5.rb,v 1.4 2001/07/13 15:38:27 knu Exp $
# $Id: md5.rb 12007 2007-03-06 10:09:51Z knu $
require 'digest/md5'
class MD5 < Digest::MD5
class << self
alias orig_new new
def new(str = nil)
if str
orig_new.update(str)
else... | Ruby |
# just for compatibility; requiring "sha1" is obsoleted
#
# $RoughId: sha1.rb,v 1.4 2001/07/13 15:38:27 knu Exp $
# $Id: sha1.rb 12007 2007-03-06 10:09:51Z knu $
require 'digest/sha1'
class SHA1 < Digest::SHA1
class << self
alias orig_new new
def new(str = nil)
if str
orig_new.update(str)
... | Ruby |
require 'digest.so'
module Digest
def self.const_missing(name)
case name
when :SHA256, :SHA384, :SHA512
lib = 'digest/sha2.so'
else
lib = File.join('digest', name.to_s.downcase)
end
begin
require lib
rescue LoadError => e
raise LoadError, "library not found for class ... | Ruby |
# $RoughId: extconf.rb,v 1.6 2001/07/13 15:38:27 knu Exp $
# $Id: extconf.rb 11708 2007-02-12 23:01:19Z shyouhei $
require "mkmf"
$INSTALLFILES = {
"digest.h" => "$(RUBYARCHDIR)"
}
create_makefile("digest")
| Ruby |
# $RoughId: extconf.rb,v 1.3 2001/08/14 19:54:51 knu Exp $
# $Id: extconf.rb 11708 2007-02-12 23:01:19Z shyouhei $
require "mkmf"
$defs << "-DNDEBUG" << "-DHAVE_CONFIG_H"
$INCFLAGS << " -I$(srcdir)/.."
$objs = [ "rmd160init.#{$OBJEXT}" ]
dir_config("openssl")
if !with_config("bundled-rmd160") &&
have_library("... | Ruby |
# $RoughId: extconf.rb,v 1.3 2001/08/14 19:54:51 knu Exp $
# $Id: extconf.rb 11708 2007-02-12 23:01:19Z shyouhei $
require "mkmf"
$defs << "-DHAVE_CONFIG_H"
$INCFLAGS << " -I$(srcdir)/.."
$objs = [ "md5init.#{$OBJEXT}" ]
dir_config("openssl")
if !with_config("bundled-md5") &&
have_library("crypto") && have_hea... | Ruby |
require 'mkmf'
have_library("sun", "getpwnam") # NIS (== YP) interface for IRIX 4
a = have_func("getlogin")
b = have_func("getpwent")
c = have_func("getgrent")
if a or b or c
have_struct_member('struct passwd', 'pw_gecos', 'pwd.h')
have_struct_member('struct passwd', 'pw_change', 'pwd.h')
have_struct_member('st... | Ruby |
require 'mkmf'
create_makefile 'strscan'
| Ruby |
#
# extconf.rb
#
# $Id: extconf.rb 16679 2008-05-29 11:23:36Z knu $
#
require 'mkmf'
require 'rbconfig'
dir_config 'zlib'
if %w'z libz zlib1 zlib zdll'.find {|z| have_library(z, 'deflateReset')} and
have_header('zlib.h') then
defines = []
message 'checking for kind of operating system... '
os_code = wit... | Ruby |
#
# kconv.rb - Kanji Converter.
#
# $Id: kconv.rb 11708 2007-02-12 23:01:19Z shyouhei $
#
# ----
#
# kconv.rb implements the Kconv class for Kanji Converter. Additionally,
# some methods in String classes are added to allow easy conversion.
#
require 'nkf'
#
# Kanji Converter for Ruby.
#
module Kconv
#
# Public ... | Ruby |
require 'mkmf'
create_makefile('nkf')
| Ruby |
# -*- ruby -*-
require 'mkmf'
$:.unshift File.dirname(__FILE__)
require 'type'
require 'dlconfig'
def mkfunc(rettype, fnum, argc)
args = (0..(argc-1)).collect{|i| "long arg#{i}"}.join(", ")
subst_code = (0..(argc-1)).collect{|i|
" buff[#{i.to_s}] = arg#{i.to_s};"
}.join("\n")
ret_code =
if( DLTYPE[... | Ruby |
# -*- ruby -*-
require 'mkmf'
$:.unshift File.dirname(__FILE__)
require 'type'
require 'dlconfig'
def mktable(rettype, fnum, argc)
code =
"rb_dl_callback_table[#{rettype}][#{fnum}] = &rb_dl_callback_func_#{rettype.to_s}_#{fnum};"
return code
end
DLTYPE.keys.sort.each{|t|
for n in 0..(MAX_CALLBACK - 1)
... | Ruby |
#!/usr/bin/env ruby
# -*- ruby -*-
# $Id: h2rb 11708 2007-02-12 23:01:19Z shyouhei $
require 'mkmf'
require 'ftools'
$recursive = false
$force = false
$conly = true
$inc_path = []
$infilename= nil
$insert_require = true
def valid_ruby_code?(code)
begin
eval("BEGIN {return true}; #{code}")
rescue Syn... | Ruby |
# example:
# DLTYPE[INT][:rb2c]["arg0"] => "NUM2INT(arg0)"
# DLTYPE[DOUBLE][:c2rb]["r"] => "rb_float_new(r)"
DLTYPE = {
VOID = 0x00 => {
:name => 'VOID',
:rb2c => nil,
:c2rb => nil,
:ctype => "void",
:stmem => "v",
:sym => true,
:cb => true,
},
CHAR = 0x01 => {
:name => 'CHAR'... | Ruby |
require 'mkmf'
require 'ftools'
SO_LIBS = ["dl.so"]
$ruby_version = CONFIG['MAJOR'] + "." + CONFIG['MINOR']
$prefix = CONFIG['prefix']
$libdir = File.join($prefix,'lib')
$rubylibdir = File.join($libdir, 'ruby', $ruby_version)
$arch = CONFIG['arch']
$archdir = File.join($rubylibdir, $arch)
def find(dir, match = /./)
... | Ruby |
# This script works on Windows.
require 'dl/win32'
MB_OK = 0
MB_OKCANCEL = 1
message_box = Win32API.new("user32",'MessageBoxA', 'ISSI', 'I')
r = message_box.call(0, 'ok?', 'error', MB_OKCANCEL)
case r
when 1
print("OK!\n")
when 2
print("Cancel!\n")
else
p r
end
| Ruby |
require 'dl'
crtdll = DL::dlopen("crtdll")
getch = crtdll['_getch', 'L']
print(getch.call, "\n")
| Ruby |
# -*- ruby -*-
# drives.rb -- find existing drives and show the drive type.
require 'dl'
require 'dl/import'
module Kernel32
extend DL::Importable
dlload "kernel32"
extern "long GetLogicalDrives()"
extern "int GetDriveType(char*)"
extern "long GetDiskFreeSpace(char*, long ref, long ref, long ref, long ref... | Ruby |
=begin
This script shows how to deal with C++ classes using Ruby/DL.
You must build a dynamic loadable library using "c++sample.C"
to run this script as follows:
$ g++ -o libsample.so -shared c++sample.C
=end
require 'dl'
require 'dl/import'
require 'dl/struct'
# Give a name of dynamic loadable library
LIBNAME ... | Ruby |
# This script works on Windows.
require 'dl'
User32 = DL.dlopen("user32")
Kernel32 = DL.dlopen("kernel32")
MB_OK = 0
MB_OKCANCEL = 1
message_box = User32['MessageBoxA', 'ILSSI']
r,rs = message_box.call(0, 'ok?', 'error', MB_OKCANCEL)
case r
when 1
print("OK!\n")
when 2
print("Cancel!\n")
end
| Ruby |
# -*- ruby -*-
# Display a file name and stream names of a file with those size.
require 'dl'
require 'dl/import'
module NTFS
extend DL::Importable
dlload "kernel32.dll"
OPEN_EXISTING = 3
GENERIC_READ = 0x80000000
BACKUP_DATA = 0x00000001
BACKUP_ALTERNATE_DATA = 0x00000004
F... | Ruby |
require "dl/import"
require "dl/struct"
module LIBC
extend DL::Importable
begin
dlload "libc.so.6"
rescue
dlload "libc.so.5"
end
extern "int atoi(char*)"
extern "ibool isdigit(int)"
extern "int gettimeofday(struct timeval *, struct timezone *)"
extern "char* strcat(char*, char*)"
extern "FI... | Ruby |
# -*- ruby -*-
require 'mkmf'
$:.unshift File.dirname(__FILE__)
require 'type'
require 'dlconfig'
def output_arg(x,i)
"args[#{i}].#{DLTYPE[x][:stmem]}"
end
def output_args(types)
t = []
types[1..-1].each_with_index{|x,i| t.push(output_arg(x,i))}
t.join(",")
end
def output_callfunc(types)
t = types[0]
st... | Ruby |
# -*- ruby -*-
require 'dl'
require 'dl/types'
module DL
module Importable
LIB_MAP = {}
module Internal
def init_types()
@types ||= ::DL::Types.new
end
def init_sym()
@SYM ||= {}
end
def [](name)
return @SYM[name.to_s][0]
end
def dlload(*libnames)
if( !defin... | Ruby |
# -*- ruby -*-
require 'dl'
module DL
class Types
TYPES = [
# FORMAT:
# ["alias name",
# "type name", encoding_method, decoding_method, for function prototypes
# "type name", encoding_method, decoding_method] for structures (not implemented)
# for Windows
["DWORD... | Ruby |
# -*- ruby -*-
require 'dl'
class Win32API
DLL = {}
def initialize(dllname, func, import, export = "0")
prototype = (export + import.to_s).tr("VPpNnLlIi", "0SSI").sub(/^(.)0*$/, '\1')
handle = DLL[dllname] ||= DL::Handle.new(dllname)
@sym = handle.sym(func, prototype)
end
def call(*args)
imp... | Ruby |
# -*- ruby -*-
require 'dl'
require 'dl/import'
module DL
module Importable
module Internal
def define_struct(contents)
init_types()
Struct.new(@types, contents)
end
alias struct define_struct
def define_union(contents)
init_types()
Union.new(@types, contents)
end
alias ... | Ruby |
require 'mkmf'
begin # for the exception SystemExit
$:.unshift File.dirname(__FILE__)
require 'type'
if( ARGV.include?("--help") )
print <<EOF
--help print this messages
--with-type-char strictly use type 'char'
--with-type-short strictly use type 'short'
--with-type-float strictly use type... | Ruby |
# -*- ruby -*-
require 'dl'
require 'dl/import'
$FAIL = 0
$TOTAL = 0
def assert(label, ty, *conds)
$TOTAL += 1
cond = !conds.include?(false)
if( cond )
printf("succeed in `#{label}'\n")
else
$FAIL += 1
case ty
when :may
printf("fail in `#{label}' ... expected\n")
when :must
pr... | Ruby |
require "mkmf"
$readline_headers = ["stdio.h"]
def have_readline_header(header)
if have_header(header)
$readline_headers.push(header)
return true
else
return false
end
end
def have_readline_var(var)
return have_var(var, $readline_headers)
end
dir_config('curses')
dir_config('ncurses')
dir_config... | Ruby |
#! /usr/local/bin/ruby
# -*- ruby -*-
$extension = nil
$extstatic = nil
$force_static = nil
$install = nil
$destdir = nil
$dryrun = false
$clean = nil
$nodynamic = nil
$extinit = nil
$extobjs = nil
$extflags = ""
$extlibs = nil
$extpath = nil
$ignore = nil
$message = nil
$progname = $0
alias $PROGRAM_NAME $0
alias $0... | Ruby |
require 'mkmf'
case RUBY_PLATFORM
when /bccwin32/
test_func = "WSACleanup"
have_library("ws2_32", "WSACleanup")
when /mswin32|mingw/
test_func = "WSACleanup"
if with_config("winsock2")
have_library("ws2_32", "WSACleanup")
else
have_library("wsock32", "WSACleanup")
end
when /cygwin/
test_func = "s... | Ruby |
=begin
= $RCSfile$ -- SSL/TLS enhancement for Net::HTTP.
= Info
'OpenSSL for Ruby 2' project
Copyright (C) 2003 Blaz Grilc <farmer@gmx.co.uk>
All rights reserved.
= Licence
This program is licenced under the same licence as Ruby.
(See the file 'LICENCE'.)
= Requirements
= Version
$Id: ftptls.rb 13657 20... | Ruby |
=begin
= $RCSfile$ -- SSL/TLS enhancement for Net::Telnet.
= Info
'OpenSSL for Ruby 2' project
Copyright (C) 2001 GOTOU YUUZOU <gotoyuzo@notwork.org>
All rights reserved.
= Licence
This program is licenced under the same licence as Ruby.
(See the file 'LICENCE'.)
= Version
$Id: telnets.rb 13657 2007-10-0... | Ruby |
require 'openssl'
| Ruby |
=begin
= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for X509 and subclasses
= Info
'OpenSSL for Ruby 2' project
Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
All rights reserved.
= Licence
This program is licenced under the same licence as Ruby.
(See the file 'LICENCE'.)
= Ver... | Ruby |
=begin
= $RCSfile$ -- Buffering mix-in module.
= Info
'OpenSSL for Ruby 2' project
Copyright (C) 2001 GOTOU YUUZOU <gotoyuzo@notwork.org>
All rights reserved.
= Licence
This program is licenced under the same licence as Ruby.
(See the file 'LICENCE'.)
= Version
$Id: buffering.rb 28004 2010-05-24 23:58:49... | Ruby |
=begin
= $RCSfile$ -- Ruby-space predefined Digest subclasses
= Info
'OpenSSL for Ruby 2' project
Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
All rights reserved.
= Licence
This program is licenced under the same licence as Ruby.
(See the file 'LICENCE'.)
= Version
$Id: digest.rb 28004 2010-05-... | Ruby |
=begin
= Ruby-space definitions that completes C-space funcs for Config
= Info
Copyright (C) 2010 Hiroshi Nakamura <nahi@ruby-lang.org>
= Licence
This program is licenced under the same licence as Ruby.
(See the file 'LICENCE'.)
=end
##
# Should we care what if somebody require this file directly?
#require '... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.