A base module that is
extended into a main module by default. Not completely documented.
The contents of this base module are available immediately when
a Lever runtime starts.
Most of the functions in the base
module are built into the language runtime.
Table of contents ↑ Table of contents Constant, represents
absence.
null always represents an absence of something.
null and false are the only values that produce false when
converted into boolean values.
The definition of null is a bit
weird because it's a legal class while being a constant.
As an internal detail, the null is an interface that is its own
interface and parent.
01. Boolean Logic
The booleans false and true are the only instances of the bool interface.
Constant,
represents falsehood.
Constant,
represents truth.
Interface of the true and
false
Booleans are hashable and can be used
in a dictionary.
This hash function can be a bit of an oxymoron
because in Lever constants and interfaces would have a hash anyway.
pointless?
+init (obj ) obj can be any value available.
returns false if obj is false or null, true
otherwise.
Converts a value into a boolean if
it already isn't. Returns 'false' iff value is absent.
Otherwise 'true'.
+repr ( ) returns "true" for true.
"false" for false.
Returns a string
representation of a value.
volatile
and (a : bool , b : bool ) returns true if both a and b are
true, otherwise returns false.
Boolean AND
The compiler uses control flow to implement 'and'
operation, therefore this function is only there for consistency.
uncertain
or (a : bool , b : bool ) returns true if either a or b is
true, otherwise returns false.
Boolean OR
The compiler uses control flow to implement 'or'
operation, therefore this function is only there for consistency.
uncertain
not (a : bool ) returns true if a is false.
Boolean not
The compiler uses control flow
or instructions to implement 'not' operation, therefore this
function is only there for consistency.
uncertain
02. Objects &
Interfaces Python calls 'interfaces' types and
likewise has a 'type' where Lever has an interface.
The decision to use the name 'interface' here
originates from the fact that you do not often touch these parts. Also
the term 'type' is used usually to denote what kind of
object you have stored into a json file.
Also we have a concept
of a C type. The first-class C type system in Lever runtime is
somewhat crucial element, and there will be more more of that as time
goes on.
Base interface for
everything
Instantiates a freeform record that can hold
any attributes.
Oftentimes we have data that has to be structured,
but it is also so short-lived that there's no point writing an
explicit class definition for it.
There are plans to add list
pattern matching into Lever some day, so some of these objects in the
current runtime will be replaced with plain lists.
Despite that
the concept will likely stay and you'll be able to instantiate by
calling the object() interface.
This kind of
"objects" can be converted back into dictionary with dict().
debatable
Interface for
interfaces
Every value has an interface. Since interfaces are first
class values they also have to have an interface.
Obtains the interface of an object given as an
argument.
If you pass an interface, you get an interface back.
internals may change
isinstance (value : object , which : object ) value The value to test
which Interface or a list of interfaces
returns true if the object is an instance of certain
interface.
Tests whether the object is an
instance of an interface or a subinterface.
Returns a
'super interface' of the given interface.
This is a
mostly feature for introspection. You can use it to obtain a parent
interface of an interface until you hit the object, super(object) is
null.
03. Functions & Multimethods Type for builtin
functions.
volatile
Every function,
builtin or not has .spec and .loc attributes for introspection. They
are both freely formed objects with attributes.
The shape and
structure of all of these fields is very likely going to change, but
for now we got something like this:
spec.varnames : list spec.is_variadic : bool spec.optional : int spec.argc : int spec.argtypes : list or null loc.source - source path
loc.start - source location start (inclusive)
loc.stop - source location stop (exclusive) The
introspection features will eventually improve until we can run
abstract interpretation on the user-defined functions.
Establishes a dispatch
table that can be used to customize this method.
Multimethods
represent bundles of functions of fixed arity. Programmer can insert
more of functions into a multimethod at any time.
During
invocation multimethods calls interface() for every argument they get.
The result is used to determine the function to call. If the value is
missing in the table, the default -method is called. If there's
no default method, then an error is raised.
It is expected that
multimethods have a clear semantic and modes of failures that are
obeyed by the functions put into the table.
+init (arity ) returns a new multimethod that
dispatches on the arity count of arguments.
A
multimethod is partially mutable, but you are not expected to
overwrite functions in a method table.
volatile
Adds a method into the dispatch table.
The key must be a list containing interfaces, having a length matching
the arity.
Fails if the key is already in the table.
volatile
+getitem (self, key ) returns The function associated to
a key.
volatile
Gathers the key from the arguments and
attempts to call a function in the dispatch table. If the key
isn't in the table, it will then call the .default(args...) to
provide a default resolution.
volatile
Dispatches on the multimethod table
but returns an error instead of calling the .default(args...) if the
dispatch fails.
volatile
keys ( ) returns The list of keys in the
dispatch table.
Dispatches on the multimethod
volatile
Multimethods have an
.arity field that tells their arity and a .default field that can be
set. The .default field should be set only once.
volatile
04. Custom classes
& objects The class definitions are part of a language,
but it can be interesting to know how they construct underneath.
class (freeform, super = object , name = "customobject" ) freeform Freeform object holding
the new fields for the new interface super
The interface that this interface extends from
returns a new interface
Called by the 'class' syntax.
Interfaces are immutable to favor the JIT compiler. This can be
changed, but so far I haven't found a real need to change an
interface after it has been created. It's usually just as simple
to create a new interface.
volatile
Provides
getters/setters via the class interface.
volatile
+init ( ) returns a new property object.
The getters and setters are put into .get and
.set attributes of this object.
volatile
05. Primitives not documented
volatile
+init (other = null ) other not documented
returns not documented
not documented
volatile
get (argv... ) argv not documented
returns not documented
not documented
volatile
items (self : dict ) self not documented
returns not documented
not documented
volatile
keys (self : dict ) self not documented
returns not documented
not documented
volatile
pop (self : dict , key : object ) self not documented
key not documented
returns not documented
not documented
volatile
update (self : dict , other : object ) self not documented
other not documented
returns not documented
not documented
volatile
values (self : dict ) self not documented
returns not documented
not documented
volatile
not documented
volatile
+init (obj : object ) obj not documented
returns not documented
not documented
volatile
not documented
volatile
+init (obj : object ) obj not documented
returns not documented
not documented
volatile
to_string (integer : int , base = null ) integer not documented
base not documented
returns not documented
not documented
volatile
not documented
volatile
+init (argv... ) argv not documented
returns not documented
not documented
volatile
append (self : list , other : object ) self not documented
other not documented
returns not documented
not documented
volatile
count (self : list , obj : object ) self not documented
obj not documented
returns not documented
not documented
volatile
extend (self : list , iterable : object ) self not documented
iterable not documented
returns not documented
not documented
volatile
index (self : list , obj : object ) self not documented
obj not documented
returns not documented
not documented
volatile
insert (self : list , index : int , obj : object ) self not documented
index not documented obj
not documented
returns not documented
not documented
volatile
pop (self : list , index = null ) self not documented
index not documented
returns not documented
not documented
volatile
remove (self : list , obj : object ) self not documented
obj not documented
returns not documented
not documented
volatile
reverse (self : list ) self not documented
returns not documented
not documented
volatile
sort (self : list , lt = null ) self not documented
lt not documented
returns not documented
not documented
volatile
not documented
volatile
+init (arg = null ) arg not documented
returns not documented
not documented
volatile
add (self : set , obj : object ) self not documented
obj not documented
returns not documented
not documented
volatile
clear (self : set ) self not documented
returns not documented
not documented
volatile
copy (self : set ) self not documented
returns not documented
not documented
volatile
difference (self : set , argv... ) self not documented
argv not documented
returns not documented
not documented
volatile
difference_update (self : set , argv... ) self not documented
argv not documented
returns not documented
not documented
volatile
discard (self : set , obj : object ) self not documented
obj not documented
returns not documented
not documented
volatile
intersection (self : set , argv... ) self not documented
argv not documented
returns not documented
not documented
volatile
is_subset (self : set , other : object ) self not documented
other not documented
returns not documented
not documented
volatile
pop (self : set ) self not documented
returns not documented
not documented
volatile
remove (self : set , obj : object ) self not documented
obj not documented
returns not documented
not documented
volatile
union (self : set , argv... ) self not documented
argv not documented
returns not documented
not documented
volatile
update (self : set , argv... ) self not documented
argv not documented
returns not documented
not documented
volatile
not documented
volatile
+init (start : object , stop : object , step = null ) start not documented
stop not documented step
not documented
returns not documented
not documented
volatile
not documented
volatile
+init (obj : object ) obj not documented
returns not documented
not documented
volatile
center (self : str , width : int , fillchar = null ) self not documented
width not documented
fillchar not documented
returns not documented
not documented
volatile
count (self : str , ch : str ) self not documented
ch not documented
returns not documented
not documented
volatile
endswith (self : str , postfix : str ) self not documented
postfix not documented
returns not documented
not documented
volatile
is_alpha (string : str ) string not documented
returns not documented
not documented
volatile
is_digit (string : str , base = null ) string not documented
base not documented
returns not documented
not documented
volatile
is_space (string : str ) string not documented
returns not documented
not documented
volatile
join (string : str , seq : object ) string not documented
seq not documented
returns not documented
not documented
volatile
ljust (self : str , width : int , fillchar = null ) self not documented
width not documented
fillchar not documented
returns not documented
not documented
volatile
lower (obj : str ) obj not documented
returns not documented
not documented
volatile
replace (a : str , b : str , c : str ) a not documented
b not documented c
not documented
returns not documented
not documented
volatile
rjust (self : str , width : int , fillchar = null ) self not documented
width not documented
fillchar not documented
returns not documented
not documented
volatile
rsplit (self : str , sep : str , maxsplit = null ) self not documented
sep not documented
maxsplit not documented
returns not documented
not documented
volatile
split (self : str , sep : str , maxsplit = null ) self not documented
sep not documented
maxsplit not documented
returns not documented
not documented
volatile
startswith (self : str , prefix : str ) self not documented
prefix not documented
returns not documented
not documented
volatile
upper (obj : str ) obj not documented
returns not documented
not documented
volatile
06. String decoding & encoding &
conversions not documented
volatile
+call (argv... ) argv not documented
returns not documented
not documented
volatile
chr (value : int ) value not documented
returns not documented
Returns a character that corresponds to the
integer.
volatile
ord (string : str ) string not documented
returns not documented
Returns integer representing the unicode point
of the character.
volatile
parse_int (string : str , base = null ) string not documented
base not documented
returns not documented
not documented
volatile
07. Path handling Represents file paths.
Note that irrespective of the OS, lever expects you to provide POSIX
compatible paths.
Paths have mutable attributes
"is_absolute", "basename", "label".
There is also .push(path) -method to help in-place modify the path.
To pass path to FFI, the path object has
"get_os_path" -method to convert the path into system path.
volatile
+init (obj : object ) obj not documented
returns not documented
not documented
volatile
drop (self : path , count : int ) self not documented
count not documented
returns not documented
not documented
volatile
relpath (dst : path , rel = null, cwd = null ) dst not documented
rel not documented cwd
not documented
returns not documented
not documented
volatile
08. Byte arrays not documented
volatile
+init (obj : object ) obj not documented
returns not documented
not documented
volatile
not documented
volatile
memcpy (self : Uint8Data , src : Uint8Data , size = null ) self not documented
src not documented size
not documented
returns not documented
not documented
volatile
09. Basic I/O print (argv... ) argv not documented
returns not documented
Prints the given values, with space between
them.
volatile
not documented
volatile
+init (ipc : bool ) ipc not documented
returns not documented
not documented
volatile
bind (self : Pipe , name : str ) self not documented
name not documented
returns not documented
not documented
volatile
connect (self : Pipe , name : str ) self not documented
name not documented
returns not documented
not documented
volatile
not documented
volatile
append (self : Queue , obj : object ) self not documented
obj not documented
returns not documented
not documented
volatile
close (self : Queue ) self not documented
returns not documented
not documented
volatile
wait (self : Queue ) self not documented
returns not documented
not documented
volatile
not documented
volatile
set_mode (self : TTY , modename_obj : str ) self not documented
modename_obj not documented
returns not documented
not documented
volatile
class Timer extends handle2
not documented
volatile
again (self : Timer ) self not documented
returns not documented
not documented
volatile
close (self : Timer ) self not documented
returns not documented
not documented
volatile
set_repeat (self : Timer , value : float ) self not documented
value not documented
returns not documented
not documented
volatile
start (self : Timer , delay : float , repeat = null ) self not documented
delay not documented
repeat not documented
returns not documented
not documented
volatile
stop (self : Timer ) self not documented
returns not documented
not documented
volatile
10. Greenlets & Concurrency
sleep (argv... ) argv not documented
returns not documented
The sleep performs two functions. It can be
used to suspend the current greenlet, queue it after duration of
seconds pass.
If you pass it a function or greenlet, it will
convert it into a greenlet and adds it to the event queue after the
duration passes.
volatile
schedule (argv... ) argv not documented
returns newly created greenlet
Schedule is similar to the greenlet -command,
except that it queues the greenlet and sets it to return into the
eventloop when it finishes. It returns the newly created greenlet.
volatile
getcurrent ( ) returns The currently running
greenlet.
not documented
volatile
A stack branch point, or
something like that
Conceptually greenlets represent a body of work
you can stop for a moment while you do a different task. Note that you
are always in a greenlet. You can always put the current task to
sleep, or switch to the eventloop to run a different task.
Greenlet represents a call frame that can be suspended. The
arguments describe a function to call and it can be left blank. In
that case the switching has to pass a function that is called inside
the greenlet.
The greenlet.parent describes where the call
returns once it finishes.
greenlet.switch(arguments...)
suspends the current greenlet and switches to the targeted greenlet.
If the greenlet hasn't started yet, the given arguments are
concatenated to the initial arguments. If the greenlet is suspended,
the arguments are compacted into a value and returned in the target
greenlet.
volatile
+init (argv... ) argv not documented
returns not documented
not documented
volatile
switch (argv... ) argv not documented
returns not documented
not documented
volatile
11. Runtime getattr (obj : object , index : str ) obj not documented
index not documented
returns not documented
Retrieves attribute from an object.
volatile
getitem (obj : object , index : object ) obj not documented
index not documented
returns not documented
Equivalent to object[index]. Presented as a
convenience. Invokes the +getitem from the interface table.
volatile
hash (obj : object ) obj not documented
returns not documented
not documented
volatile
iter (obj : object ) obj not documented
returns not documented
Retrieve an iterator. Invokes the +iter from
the interface table.
volatile
len (obj : object ) obj not documented
returns not documented
not documented
volatile
load (program : object , path = null ) program not documented
path not documented
returns not documented
not documented
volatile
range (start : int , stop = null, step = null ) start not documented
stop not documented step
not documented
returns not documented
not documented
volatile
repr (obj : object ) obj not documented
returns not documented
not documented
volatile
reversed (obj : list ) obj not documented
returns not documented
not documented
volatile
setattr (obj : object , index : str , value : object ) obj not documented
index not documented
value not documented
returns not documented
Sets an attribute to an object.
volatile
setitem (obj : object , index : object , value : object ) obj not documented
index not documented
value not documented
returns not documented
Equivalent to object[index] = value. Presented
as a convenience. Invokes the +setitem from the interface table.
volatile
12. Modules
Modules are hierarchical now, but I'm wondering whether
the hierarchical idea of modules should be moved into the evaluation
environment or program objects instead.
There is a function
"import" that imports a module and is used behind the import
syntax. Every module has an import function and it is always an
instance of a Import.
not documented
volatile
+call (argv... ) argv not documented
returns not documented
not documented
volatile
+init (local : path , scope : ModuleScope ) local not documented
scope not documented
returns not documented
not documented
volatile
not documented
volatile
+init (local : path , parent = null, options = null ) local not documented
parent not documented
options not documented
returns not documented
not documented
volatile
13. Logging info (value : object , type = null ) value not documented
type not documented
returns not documented
not documented
volatile
14. Errors and exceptions not documented
volatile
+init (obj : object , value : object ) obj not documented
value not documented
returns not documented
not documented
volatile
not documented
volatile
+init (message : str ) message not documented
returns not documented
not documented
volatile
not documented
volatile
+init (obj : object , name : str ) obj not documented
name not documented
returns not documented
not documented
volatile
not documented
volatile
+init (message : str ) message not documented
returns not documented
not documented
volatile
not documented
volatile
close (self : Event ) self not documented
returns not documented
not documented
volatile
dispatch (self : Event , argv... ) self not documented
argv not documented
returns not documented
not documented
volatile
register (self : Event , cb : object ) self not documented
cb not documented
returns not documented
not documented
volatile
wait (self : Event ) self not documented
returns not documented
not documented
volatile
not documented
volatile
+init (obj : object ) obj not documented
returns not documented
not documented
volatile
not documented
volatile
+init (thing : object ) thing not documented
returns not documented
not documented
volatile
not documented
volatile
+init (obj : object , name : str ) obj not documented
name not documented
returns not documented
not documented
volatile
15. Operators Nearly all
operators in Lever are multimethods. The current Lever multimethods
can be extended but they do not obey type inheritance.
Arithmetic coercion.
A
Base multimethod for converting two value into values that pair
arithmetically. Coercion is used when the values cannot be found from
the usual multimethod table and when the exact pairing cannot be
found.
Sometimes we expect that two types are arithmetically
interchangeable although they would be technically different.
Therefore many arithmetic operations in Lever come with coercion as
default for the time when there's not a specific method for the
given operation.
This method must coerce the two values into
most specific common type they share.
The conversion must make
sense before doing an arithmetic operation such as addition,
multiplication or substraction.
(a : float , b : int ) Implicit conversion to
float from integers. volatile
(a : int , b : float ) Implicit conversion to
float from integers. volatile
(a : bool , b : int ) Implicit conversion from
boolean into integer. 'true' becomes 1, and
'false' becomes 0.
volatile
(a : bool , b : bool ) Implicit conversion from
booleans into integers. This is not the most common type for
booleans, but usually when we are doing arithmetic operation and there
are no booleans defined, we expect that they represent integer values.
volatile
(a : int , b : bool ) Implicit conversion from
boolean into integer. volatile
volatile
Arithmetic addition
(a : vec3 , b : vec3 ) Addition is defined on
vectors. volatile
(a : int , b : int ) volatile
(a : float , b : float ) volatile
default(args... ) Calls coerce on the arguments and re-attempts the
operation on the results once. volatile
volatile
Arithmetic subtraction
(a : vec3 , b : vec3 ) Of course... volatile
(a : set , b : set ) Alias to set.difference volatile
(a : int , b : int ) What do you expect? volatile
(a : float , b : float ) Kind of obvious. volatile
default(args... ) Calls coerce on the arguments and re-attempts the
operation on the results once. volatile
volatile
Multiplication of two elements
together
(n : int , s : str ) Repeats the
's' string 'n' times. Multiplication in this
case makes a lot of sense, although repeating of a string is a repeat
of concatenation rather than addition.
volatile
(a : mat4 , b : mat4 ) Matrix multiplication.
volatile
(a : int , b : int ) volatile
(s : str , n : int ) Repeats the
's' string 'n' times. volatile
(a : float , b : float ) volatile
(s : float , v : vec3 ) Vector multiplication
by scalar volatile
(q : quat , v : vec3 ) I am a bit unsure about
what this was.. TODO: review quaternion math. volatile
(self : mat4 , other : vec3 ) Plain old matrix
multiplication of vector. Transforms the vector by the matrix.
volatile
(v : vec3 , s : float ) Scalar multiplication
on vector. volatile
(self : quat , other : quat ) Quaternion
multiplication volatile
default(args... ) Calls coerce on the arguments and re-attempts the
operation on the results once. volatile
volatile
Arithmetic division operator
(self : vec3 , s : float ) self not documented
s not documented
returns not documented
not documented volatile
(s : float , self : vec3 ) s not documented
self not documented
returns not documented
not documented volatile
(a : int , b : int ) a not documented
b not documented
returns not documented
not documented volatile
(a : float , b : float ) a not documented
b not documented
returns not documented
not documented volatile
default(argv... ) argv not documented
returns not documented
not documented volatile
volatile
Prefix plus
(self : quat ) self not documented
returns not documented
not documented volatile
(a : int ) a not documented
returns not documented
not documented volatile
(self : vec3 ) self not documented
returns not documented
not documented volatile
(a : float ) a not documented
returns not documented
not documented volatile
volatile
Modulo takes a remainder from the
division of the first argument by the second.
(a : int , b : int ) volatile
default(args... ) Default on module is an arithmetic coercion
and a re-attempt once. volatile
volatile
Bitwise AND
(a : int , b : int ) volatile
(a : set , b : set ) Alias to set.intersection volatile
default(args... ) Default on module is an arithmetic coercion
and a re-attempt once. volatile
volatile
Bitwise OR operation or similar
(a : int , b : int ) Bitwise OR operation on
two integers volatile
(a : set , b : set ) An alias to set.union This behavior has been inherited
from Python.
volatile
default(args... ) Calls coerce on the arguments and re-attempts the
operation on the results once. volatile
volatile
Bitwise XOR operator
(a : int , b : int ) a not documented
b not documented
returns not documented
not documented volatile
(a : set , b : set ) a not documented
b not documented
returns not documented
not documented volatile
default(argv... ) argv not documented
returns not documented
not documented volatile
volatile
Equality
(a : path , b : path ) a not documented
b not documented
returns not documented
not documented volatile
(a : float , b : float ) a not documented
b not documented
returns not documented
not documented volatile
(a : list , b : list ) a not documented
b not documented
returns not documented
not documented volatile
(a : int , b : int ) a not documented
b not documented
returns not documented
not documented volatile
(a : str , b : str ) a not documented
b not documented
returns not documented
not documented volatile
(a : Id , b : Id ) a not documented
b not documented
returns not documented
not documented volatile
(a : EIM , b : EIM ) a not documented
b not documented
returns not documented
not documented volatile
default(a : object , b : object ) a not documented
b not documented
returns not documented
not documented volatile
volatile
Inequality operator
(a : path , b : path ) Two path objects are
inequal if their prefixes and path sequences are different. volatile
(a : str , b : str ) Two strings are inequal
if they are different. volatile
(a : int , b : int ) Two integers are
inequal if erm... volatile
(a : float , b : float ) volatile
default(a : object , b : object ) By default, two items
are inequal if they are not equal as defined by == . volatile
volatile
Concatenation
Concatenation
and addition are not a same thing because the two can make sense
separately in a same object. This was the case in the numpy module of
the Python. We rather do not repeat that mistake.
(a : Uint8Array , b : Uint8Array ) Concatenates two
byte arrays together. This operation always allocates new memory to
contain the new concatenated byte sequence.
volatile
(a : path , b : path ) Concatenates two paths
together. If the 'b' path is not a relative path, it is
returned. Otherwise we get a concatenation of the two.
volatile
(a : Uint8Array , b : Uint8Slice ) Concatenates two
byte arrays together. This operation always allocates new memory to
contain the new concatenated byte sequence.
volatile
(a : Uint8Slice , b : Uint8Array ) Concatenates two
byte arrays together. This operation always allocates new memory to
contain the new concatenated byte sequence.
volatile
(a : path , s : str ) Converts a string into
a path and then proceeds to concatenate the two. String
concatenation from the right side is extremely common operation, for
example 'a.dirname ++ (a.basename ++ ".text")'
adds a file extension '.text'
volatile
(a : list , b : list ) List concatenation volatile
(a : str , b : path ) Converts a string into
a path and then proceeds to concatenate the two. Not as common as
the another, but is present there for convenience.
volatile
(a : str , b : str ) String concatenation.
volatile
(a : Uint8Slice , b : Uint8Slice ) Concatenates two
byte arrays together. This operation always allocates new memory to
contain the new concatenated byte sequence.
volatile
volatile
(self : quat ) self not documented
returns not documented
not documented volatile
(a : int ) a not documented
returns not documented
not documented volatile
(self : vec3 ) self not documented
returns not documented
not documented volatile
(a : float ) a not documented
returns not documented
not documented volatile
volatile
Less than -operator
(a : path , b : path ) a not documented
b not documented
returns not documented
not documented volatile
(a : str , b : str ) a not documented
b not documented
returns not documented
not documented volatile
(a : set , b : set ) a not documented
b not documented
returns not documented
not documented volatile
(a : int , b : int ) a not documented
b not documented
returns not documented
not documented volatile
(a : float , b : float ) a not documented
b not documented
returns not documented
not documented volatile
volatile
Less than or equal -operator
(a : path , b : path ) a not documented
b not documented
returns not documented
not documented volatile
(a : str , b : str ) a not documented
b not documented
returns not documented
not documented volatile
(a : set , b : set ) a not documented
b not documented
returns not documented
not documented volatile
(a : int , b : int ) a not documented
b not documented
returns not documented
not documented volatile
(a : float , b : float ) a not documented
b not documented
returns not documented
not documented volatile
volatile
Greather than -operator
(a : path , b : path ) a not documented
b not documented
returns not documented
not documented volatile
(a : str , b : str ) a not documented
b not documented
returns not documented
not documented volatile
(a : set , b : set ) a not documented
b not documented
returns not documented
not documented volatile
(a : int , b : int ) a not documented
b not documented
returns not documented
not documented volatile
(a : float , b : float ) a not documented
b not documented
returns not documented
not documented volatile
volatile
Greater than or equal
-operator
(a : path , b : path ) a not documented
b not documented
returns not documented
not documented volatile
(a : str , b : str ) a not documented
b not documented
returns not documented
not documented volatile
(a : set , b : set ) a not documented
b not documented
returns not documented
not documented volatile
(a : int , b : int ) a not documented
b not documented
returns not documented
not documented volatile
(a : float , b : float ) a not documented
b not documented
returns not documented
not documented volatile
volatile
Left bitwise shift
(a : int , b : int ) a not documented
b not documented
returns not documented
not documented volatile
default(argv... ) argv not documented
returns not documented
not documented volatile
volatile
Bitwise right shift
(a : int , b : int ) a not documented
b not documented
returns not documented
not documented volatile
default(argv... ) argv not documented
returns not documented
not documented volatile
volatile
16. Mathematic functions and interfaces abs (f : float ) f not documented
returns not documented
not documented
volatile
axisangle (v : vec3 , angle : float ) v not documented
angle not documented
returns not documented
not documented
volatile
(x : float , low : float , high : float ) x not documented
low not documented high
not documented
returns not documented
not documented volatile
(x : int , low : int , high : int ) x not documented
low not documented high
not documented
returns not documented
not documented volatile
(c : slice , start : int , stop : int ) c not documented
start not documented stop
not documented
returns not documented
not documented volatile
not documented
volatile
cos (f : float ) f not documented
returns not documented
not documented
volatile
(a : vec3 , b : vec3 ) a not documented
b not documented
returns not documented
not documented volatile
not documented
volatile
(a : vec3 , b : vec3 ) a not documented
b not documented
returns not documented
not documented volatile
not documented
volatile
exp (a : float ) a not documented
returns not documented
not documented
volatile
(v : vec3 ) v not documented
returns not documented
not documented volatile
not documented
volatile
ln (a : float ) a not documented
returns not documented
not documented
volatile
log (a : float , b : float ) a not documented
b not documented
returns not documented
not documented
volatile
not documented
volatile
+init (argv... ) argv not documented
returns not documented
not documented
volatile
adjoint (self : mat4 ) self not documented
returns not documented
not documented
volatile
invert (self : mat4 ) self not documented
returns not documented
not documented
volatile
scale (self : mat4 , v : vec3 ) self not documented
v not documented
returns not documented
not documented
volatile
translate (self : mat4 , v : vec3 ) self not documented
v not documented
returns not documented
not documented
volatile
(a : int , b : int ) a not documented
b not documented
returns not documented
not documented volatile
(a : float , b : float ) a not documented
b not documented
returns not documented
not documented volatile
default(argv... ) argv not documented
returns not documented
not documented volatile
not documented
volatile
(a : int , b : int ) a not documented
b not documented
returns not documented
not documented volatile
(a : float , b : float ) a not documented
b not documented
returns not documented
not documented volatile
default(argv... ) argv not documented
returns not documented
not documented volatile
not documented
volatile
(v : vec3 ) v not documented
returns not documented
not documented volatile
not documented
volatile
Half of the circumference of an unit circle.
volatile
Circumference of an unit circle.
volatile
pow (a : float , b : float ) a not documented
b not documented
returns not documented
not documented
volatile
not documented
volatile
+init (argv... ) argv not documented
returns not documented
not documented
volatile
invert (self : quat ) self not documented
returns not documented
not documented
volatile
to_mat4 (self, translation = vec3(0,0,0) ) returns Affine transformation
matrix.
Present your affection to your
significant other with matrices.
volatile
sign (f : float ) f not documented
returns not documented
not documented
volatile
sin (f : float ) f not documented
returns not documented
not documented
volatile
sqrt (f : float ) f not documented
returns not documented
not documented
volatile
tan (f : float ) f not documented
returns not documented
not documented
volatile
not documented
volatile
+init (argv... ) argv not documented
returns not documented
not documented
volatile
17. Random numbers and quantities
This was copied from somewhere in the
internet.
volatile
This was copied from somewhere in the
internet.
volatile
18. Miscellaneous chdir (obj : object ) obj not documented
returns not documented
Changes the current directory.
Note that
both getcwd() and chdir(path) may eventually move into fs -module.
volatile
not documented
volatile
+init (doc : object , name : object , parent = null ) doc not documented
name not documented
parent not documented
returns not documented
not documented
volatile
exit (obj = null ) obj not documented
returns not documented
not documented
volatile
not documented
volatile
+init (ref : object ) ref not documented
returns not documented
not documented
volatile
get (self : Id , name : str , default = null ) self not documented
name not documented
default not documented
returns not documented
not documented
volatile
Returns a path object denoting the current
path. Note that this object is converted once, so if you have unusual
path that doesn't follow posix conventions, the lever getcwd may
give a incorrect path.
Note that both getcwd() and chdir(path) may
eventually move into fs -module.
volatile
time (argv... ) argv not documented
returns not documented
not documented
volatile


Bosnia confirm Pjanic injury against Italy
by BeSoccerMiralem Pjanic will sit out of Bosnia-Herzegovina's clash with Liechtenstein on Monday after suffering an injury against Italy.
Juventus midfielder Miralem Pjanic suffered a thigh injury against Italy on Friday, Bosnia-Herzegovina have confirmed.
Pjanic has been in impressive form for Juve in Serie A this season but pulled up in a 1-1 draw against Lecce in October, returning in the Turin derby at the start of this month.
He looks to have suffered another setback after being substituted with 13 minutes remaining of a 3-0 home Euro 2020 qualifying defeat to Italy.
Featured links
- Ballon d'Or winner already been decided
- The latest football transfers news and rumours
- Possible 'Clasico' in the Spanish Supercup final
- Who has the most free-kicks goals: Messi or Cristiano?
Bosnia confirmed on Saturday the 29-year-old would miss their trip to Liechtenstein on Monday, leaving Juve with a fitness concern ahead of a tough test against Atalanta next weekend.
"National team players Miralem Pjanic and Luka Menalo will miss the team's next match against Liechtenstein due to injuries," Bosnia's statement read.
"Pjanic has an adductor injury, while Menalo has an ankle injury."


{% extends "common/page_base.html" %} {# common/page_base.html extends layout.html #} {% block content %}
For general comments and collaboration,
please contact Dr. Xueyang Feng (PI)
Email<EMAIL_ADDRESS>Tel:<PHONE_NUMBER>;
For technical support and system maintenance,
please contact Weihua Guo (Principle Scientist)
Email<EMAIL_ADDRESS>Tel:<PHONE_NUMBER>;
For reporting technical problems
please contact Swaraj Dhumne (Web Developer)
Email<EMAIL_ADDRESS>Tel:<PHONE_NUMBER>;
For reporting mistakes,
please contact us at<EMAIL_ADDRESS>{% endblock %}


Wow, this is the most amazing website ever!
Here, we'll break down for you a bit about cats and Daleks.
We hope that this site will help you become well acquainted with both of these species
and who might win DOMINATE in a battle to the DEATH.
This is the media page, which will give you a visual guide to cats, Daleks, and catsvsDaleks.


Two Cents is an intentional 10–12 person community focused on the betterment of oneself and one another.
Two Reasons for Two Cents
Feedback
The idea of asking 10 friends for feedback all at once was easier and less time consuming than asking them separately.
Other Slack groups were too large and self-serving
Dribbble wasn’t being used for feedback like it used to.
There was a need for a small community of trusted eyes.
Friendship
Conferences and workshops are great, but sometimes you miss out on that community until the next year. We wanted to create a place where community was rooted in in-person experiences, but continued to grow during times that we were apart. In-house or freelance work can get lonely but knowing there are other people right there with you can offer comfort in sharing struggles and victories.
Start a Two Cents Chapter
Beginning Steps
Organizing Your Slack Channels
Our current mash of channels is as follows but may change if a new topic arises
Planning A Retreat
Google hangouts are great (and encouraged!) but planning a retreat to spend time with each other in person is the best. Plan trips around activities and locations all members can get into!
FAQs
Can I join the original Two Cents chapter?
No. And not because we’re mean or exclusive but because the magic of a small community is that it is capped at a certain number. We’ve learned that the smaller, the better.
Have a question about Two Cents that isn’t listed?
Feel free to reach out to Ben Stafford on Twitter and he’ll get back to you as soon as possible.


Backend!
Create
Read
Update
Delete
QRCode
Card Operations
Name:
Mobile:
MobileAlt:
Email:
EmailAlt:
Company:
Position:
Color:
More Attributes can be added.
Please Login!!.
Name:
Mobile:
MobileAlt:
Email:
EmailAlt:
Company:
Position:
Color:
Delete
Display QRCode
Register
Login
Update
Logout
User Operations
First name:
Last name:
E-mail:
Password:
Confirmation:
More Attributes can be added. As of now, you have to explicitly activate the account @ Dashboard before trying to Login.
E-mail:
Password:
First name:
Last name:
E-mail:
Old Password:
Password:
Confirmation:
If you change email you have to login again to continue using the updated email.
Password Changing Documentation from built.io is missing . Neverthless, Logic is made already for Signature.


| Overview | Namespace | Class | Index | Help |
| PUBLIC MEMBERS: | CLASSES | STRUCTS | UNIONS | ENUMS | TYPEDEFS | METHODS | STATIC METHODS | DATA | STATIC DATA |
| PROTECTED MEMBERS: | CLASSES | STRUCTS | UNIONS | ENUMS | TYPEDEFS | METHODS | STATIC METHODS | DATA | STATIC DATA |
| virtual | abstract | interface | template |
| NO | NO | NO | NO |
Methods |
|
| Registry( ); |
Default constructor. |
| Registry( const Registry & toCopy ); |
Copy constructcor |
| ~Registry( ); |
Destructor. The Destructor close the registry if it is open. |
| Registry & operator=( const Registry & toAssign ); |
Assign operator |
| sal_Bool isValid( ) const; |
checks if the registry points to a valid registry data file. |
| sal_Bool isReadOnly( ) const; |
returns the access mode of the registry. |
| RegError openRootKey( RegistryKey & rRootKey ); |
opens the root key of the registry. |
| ::rtl::OUString getName( ); |
returns the name of the current registry data file. |
| RegError create( const ::rtl::OUString & registryName ); |
creates a new registry with the specified name and creates a root key. |
| RegError open( const ::rtl::OUString & registryName, RegAccessMode accessMode ); |
opens a registry with the specified name. |
| RegError close( ); |
closes explicitly the current registry data file. |
| RegError destroy( const ::rtl::OUString & registryName ); |
destroys a registry. |
| RegError loadKey( RegistryKey & rKey, const ::rtl::OUString & keyName, const ::rtl::OUString & regFileName ); |
loads registry information from a specified file and save it under the specified keyName. |
| RegError saveKey( RegistryKey & rKey, const ::rtl::OUString & keyName, const ::rtl::OUString & regFileName ); |
saves the registry information of the specified key and all subkeys and save it in the specified file. |
| RegError mergeKey( RegistryKey & rKey, const ::rtl::OUString & keyName, const ::rtl::OUString & regFileName, sal_Bool bWarnings = sal_False, sal_Bool bReport = sal_False ); |
merges the registry information of the specified key with the registry information of the specified file. |
| RegError dumpRegistry( RegistryKey & rKey ); |
This function reports the complete registry information of a key and all of its subkeys. |
| const Registry_Api * getApi( ); |
returns the used registry Api. |
Data |
|
| const Registry_Api * m_pApi; | stores the used and initialized registry Api. |
| RegHandle m_hImpl; | stores the handle of the underlying registry file on which most of the functions work. |
Copyright © 2012, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.


After 20 years of research and development, a groundbreaking approach to clean air has arrived. Molekule breaks down harmful microscopic pollutants like allergens, mold, bacteria, viruses and even airborne chemicals
Indoor air is 5 times more poluted than outdoor air
90% percent of your life is spent indoors
The EPA states indoor air is up to 5x more polluted than outdoor air. Pollutants are trapped inside where they concentrate and multiply to harmful levels. Studies have shown that indoor pollution contributes to a wide variety of health issues for everyone, not just asthma and allergy sufferers.
While everyone is aware of dust, pollen, and pet dander, the pollutants that can cause us the most harm are microscopic like mold, viruses, bacteria, and gaseous chemicals.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam unde alias blanditiis ut neque recusandae, praesentium magni repudiandae inventore delectus.
Hover for more information
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam unde alias blanditiis ut neque recusandae, praesentium magni repudiandae inventore delectus.
Allergens
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nesciunt id eos ratione voluptatibus omnis temporibus amet fugit sunt rerum quaerat.
Airborne chemicals (VOC's)
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero quisquam optio dolores. Odit fugit pariatur adipisci. Enim itaque optio quaerat.
Mold
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatibus voluptatum dolorem earum quibusdam labore tempore, exercitationem nesciunt architecto voluptas nostrum!
Viruses
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Facere aliquid, recusandae sapiente, itaque laudantium ullam quos inventore totam unde eaque?
Bacteria
Independent lab studies have shown 3.9 million E.Coli completely eliminated in a single pass through a Molekule system
Molekule disassembles and converts pollutants into harmless elements that are meant to be in the air. This is done by creating a catalytic reaction that happens when a nanoparticle-coated filter is activated by light. Pollutants are broken down into their most basic molecular components, making them safe for us to breathe.
What if you woke up feeling refreshed, clear-headed and ready to tackle the day? We put our technology to the test and gave it to real people. See trial results from real people.
"Molekule has significantly reduced my allergy symptoms. I no longer have constant sinus pressure and irritated eyes. But the biggest change was for my son, Peyton, who’s no longer battling congestion and finally getting a good night’s sleep!
"Molekule has significantly reduced my allergy symptoms. I no longer have constant sinus pressure and irritated eyes. But the biggest change was for my son, Peyton, who’s no longer battling congestion and finally getting a good night’s sleep!
"Molekule has significantly reduced my allergy symptoms. I no longer have constant sinus pressure and irritated eyes. But the biggest change was for my son, Peyton, who’s no longer battling congestion and finally getting a good night’s sleep!
“These home air purifiers are designed to reduce the symptoms of those with asthma and allergies.”
“Who knew that you can take something that already exists and remarket it for millions.”
“{PRODUCT_NAME} is absolutely great. It is so inovative. We have definitely received no money to write this review for {COMPANY_NAME}”
Unfortunately we're currently out of units for pre-order. Join our wait list and we'll let you know when we have more available


- Definition List
- A number of connected items or names written or printed consecutively, typically one below the other.
- This is a term.
- This is the definition of that term, which both live in a dl.
- Here is another term.
- And it gets a definition too, which is this line.
- Here is term that shares a definition with the term below.
- And it gets a definition too, which is this line.


How to play this game
Your objective is to type html code as quickly and as accurately as possible. 3 bugs (mistypes) and the game is over. Please Follow the prompts:
Continue


Although there are emerging sporadic outbreaks, Japan has seen an overall low level of new infections over the past weeks. Tokyo continues to be the hotbed of new cases. While saliva-based tests were approved on June 2, targeted testing will replace blanket tests in the future. Reopening progresses nationwide. Most businesses and services have already reopened with rules of physical distancing and hygiene. Professional sports must wait until June 19 to resume. Japan is now considering reopening its borders to business travellers from countries with low levels of infections and strong economic ties such as Thailand, Vietnam, Australia and New Zealand, all of which are Trans-Pacific Partnership members.


Tic-tac-toe
Options
How many spaces per side?
Configure the names?
Your Name
Computer Name
Who should go first?
{{vm.playerName}}
{{vm.computerName}}
Random
Let's go!
{{vm.status.message}}
Play Again?
{{ vm.players[ col.playerId ].symbol }}
{{ player.name }}
{{ player.wins }}
Reset


{% load staticfiles %} {% load sb_tags %} Toggle navigation SugarBaby Count sugars Browse diary Logout Admin Help GitHub About
Licensed under the MIT License (MIT). Read a copy of LICENSE distributed with this code. Copyright © 2014 Yauhen Yakimovich


Use the Message Request Response Correlator pattern to accept requests from many client applications on a single queue, and to return responses to the correct client.
Client applications often have to access a server application. The requests from the client applications and the responses from the server can be mediated by being passed through an intermediary or Enterprise Service Bus (ESB) such as IBM Integration Bus. The client applications specify in their request the specific response queue on which the response is expected to be received.
Messaging systems provide a mechanism for ensuring that the response message in a request-reply interaction can be routed to the correct originating application or client instance. Typically this solution involves passing a 'reply-to address' as part of the message header. The receiving application is then able to extract this information and send the response to the appropriate queue. If a mediation is introduced into the interaction, two separate request-reply interactions are established and you must ensure that the response messages are sent to the correct destination in each case.
If many such clients are interacting with a single server application, typically only a single mediation is used. Standard practice is for the server application and the mediation to each provide a single request queue. The mediation also uses a single response queue for processing reply messages from the server application. If each client provides its own response queue, a mechanism is required to ensure that each reply message is sent to the correct queue.
An IBM Integration flow mediates between a requester and provider. The incoming message contains the reply address of the requester, but the message that is forwarded to the provider application must contain the reply address of the message flow. When the provider application responds to the message flow, it has to match each response to the request sent by the client.
Use this pattern when you have a number of requesters that have to send messages to a provider; receive responses on a queue that is specific to the requester; and when both requests and responses are mediated through the broker. You can use the pattern to pass messages of any type, and you have the option to validate the message, for example, to protect providers from incorrectly formatted messages.
The reply-to information from each client request in the mediation flow is stored before forwarding the message to the provider. When responses are received from the provider, correlation information is used to retrieve and restore the correct reply address of the original requester, and to store this information for subsequent retrieval.


ERRORCODE-404
ERRORCODE-404
This website is designed to help you fix your code by pointing out errors in your code.
Enter your file name below:
Submit


Hotel reservation
Your name
Month
January
February
March
April
Persons
1
2
3
4
The best hotels in one place
Copyright 2018


Demo - Getting out of the flying vehicle in Floaterra
A trick Ewil found in the level Floaterra. If you position yourself correctly on the flying vehicle and move forwards (It's quite random to get it done) you'll start to float upwards slowly until you can get out of the flying vehicle and then... fall to your death :D Well, maybe it could also be done when the flying vehicle is about to land on the ground so then you wouldn't die, but I'm not sure if anyone was successful doing that.
Demo - Going Out of Bounds in Jungle
Cortez uses Dino to climb some rocks and get on higher ground from where you can fall Out of Bounds.
Demo - Walking around on the landscape in Coast 2 Cost
The method of getting out of the gameplay area onto the hill is also used in a speedrun, but Cortez shows some more landscape. And he shows that the end level trigger isn't there yet ;) It's also possible to walk on the whole sea and even get on the islands you can see in the distance.
Demo - Getting behind the last gate in Deadwood
In this demo Cortez shows that it's possible to get behind the final gate where the level ends. To get there he uses a trick where if you grab a barrel and put the barrel on some higher ground and then jump while holding it grabbed, you'll jump higher.
Demo - Getting out of the big log in Giant Junkyard
And here Cortez shows that there's a hole in the log so that you can get in the area behind the log without first battling the enemies to get rid of the rocks blocking your way. The enemies still need to be defeated though (Which is why the speedrun doesn't use this log trick because it's faster to fight the enemies immediately instead of first getting out of the log) in order for the torch to appear near the big poo.
Demo - Skipping the hopper part in Branchester
Cortez shows a way of crate-building to freedom, except that, as is often the case in SS2, nothing in the rest of the level will be triggered and thus you can't finish the level :( You can't even pull the levers in the last part...


Multigrain Sliced Bread – 400 g
$3.99
$0.67 / 100 g
Baguette – 300 g
$2.99
$1.00/ 100 g
Sourdough Loaf – 700 g
$4.99
$0.71 / 100 g
Glazed Doughnuts – 6
$5.99
$1.00 / ea
Butter Croissants – 6
$1.66 / 100 g
Chocolate Cake – 1.25 kg
$24.99
$2.00 / 100 g
Apple Pie – 500 g
$4.79
$0.96 / 100 g
Chocolate Chip – 12
$0.85 / 100 g


Anthony Joshua vs Andy Ruiz Jr stadium almost finished - and has plush VIP section
The rematch venue for Anthony Joshua vs Andy Ruiz Jr is taking shape - and the purpose-built facility in Saudi Arabia includes plush VIP areas
by Rich Jones, https://www.mirror.co.uk/authors/rich-jones/The purpose-built stadium for Anthony Joshua's eagerly-anticipated rematch with Andy Ruiz Jr is nearly complete.
And footage of the 15,000 capacity venue has been shared by Matchroom CEO Frank Smith, showing a plush VIP section as well as standard seating.
The arena features an open bowl of temporary seating across three sides of the ring.
On the other end is a vast area featuring several tiers of balconies with padded chairs and tables for VIPs to enjoy the action.
It is believed the changing rooms and backstage areas are underneath that hospitality section, with a tunnel in the middle appearing to show the ramp where fighters will make their walk to the ring on December 7.
Joshua is facing the biggest fight of his career as he aims to avenge his shock June 1 defeat and reclaim his world heavyweight title belts.
But he insisted this week he is still a champion and isn't about to "become a p***** overnight".
“We haven’t done anything differently mentally, I’m a champion,” he said defiantly. “I walked into the gym and three years later I was Olympic champion.
“I’ve had one loss, but I’m not about to become a p***** overnight and not be able to fight.
“I can fight, that’s it. I don’t need to reflect on that, I just need to win.”
He has gone back to the drawing board and drafted in a number of new sparring partners during his Sheffield training camp.
But trainer Rob McCracken, who came in for plenty of criticism after his June 1 loss, insists he has no regrets about his handling of the first bout.
McCracken said: "As a trainer you've got to be honest with yourself - you've got to be able to look yourself in the mirror after a fight and ask yourself, did I do the right thing for that boxer?
After The Bell: Watch Mirror Fighting's new boxing show
Mirror Fighting has launched a new weekly boxing show in association with Betfair in which we analyse the latest big fights, play matchmaker, and preview forthcoming bouts.
Former super-middleweight world champion George Groves provides expert analysis.
To watch the latest show in full, click here.
"The moment you think they have no chance of getting back into it, that's when you should step in and be brave, and take all the criticism you've going to get in the other way.
"At no point did I think that Big Josh had no chance of getting back into that fight. I've always had the best intentions of every boxer at heart and I would never leave them in a moment long enough to be in danger.
"In hindsight there are always things you can do better. If you can't learn from something and do better next time, you've got a problem.
"It was a difficult night in New York - as difficult as it can get. There was always going to be criticism and some sort of backlash, but I've been through it all in boxing and I've got a thick skin.
"People will analyse and have an opinion, and some will be valid and some won't be. From my point of view my first responsibility was a duty of care to AJ on the night, and I think I did my job."


Object
HTTPClient - HTTP
client library. Copyright (C) 2000-2009 NAKAMURA, Hiroshi
This program is copyrighted free software by NAKAMURA, Hiroshi. You can redistribute it and/or modify it under the same terms of Ruby’s license; either the dual license version in 2003, or any later version.
HTTPClient - HTTP
client library. Copyright (C) 2000-2009 NAKAMURA, Hiroshi
This program is copyrighted free software by NAKAMURA, Hiroshi. You can redistribute it and/or modify it under the same terms of Ruby’s license; either the dual license version in 2003, or any later version.
The HTTPClient class provides several methods for accessing Web resources via HTTP.
HTTPClient instance is designed to be MT-safe. You can call a HTTPClient instance from several threads without synchronization after setting up an instance.
clnt = HTTPClient.new clnt.set_cookie_store('/home/nahi/cookie.dat') urls.each do |url| Thread.new(url) do |u| p clnt.head(u).status end end
At first, how to create your client. See initialize for more detail.
Create simple client.
clnt = HTTPClient.new
Accessing resources through HTTP proxy. You can use environment variable ‘http_proxy’ or ‘HTTP_PROXY’ instead.
clnt = HTTPClient.new('http://myproxy:8080')
See get and get_content.
Get content of specified URL. It returns HTTP::Message object and calling ‘body’ method of it returns a content String.
puts clnt.get('http://dev.ctor.org/').body
For getting content directly, use get_content. It follows redirect response and returns a String of whole result.
puts clnt.get_content('http://dev.ctor.org/')
You can pass :follow_redirect option to follow redirect response in get.
puts clnt.get('http://dev.ctor.org/', :foolow_redirect => true)
Get content as chunks of String. It yields chunks of String.
clnt.get_content('http://dev.ctor.org/') do |chunk| puts chunk end
See head, get, post, put, delete, options, propfind, proppatch and trace. It returns a HTTP::Message instance as a response.
Do HEAD request.
res = clnt.head(uri) p res.header['Last-Modified'][0]
Do GET request with query.
query = { 'keyword' => 'ruby', 'lang' => 'en' } res = clnt.get(uri, query) p res.status p res.contenttype p res.header['X-Custom'] puts res.body
You can also use keyword argument style.
res = clnt.get(uri, :query => { :keyword => 'ruby', :lang => 'en' })
See post.
Do POST a form data.
body = { 'keyword' => 'ruby', 'lang' => 'en' } res = clnt.post(uri, body)
Keyword argument style.
res = clnt.post(uri, :body => ...)
Do multipart file upload with POST. No need to set extra header by yourself from httpclient/2.1.4.
File.open('/tmp/post_data') do |file| body = { 'upload' => file, 'user' => 'nahi' } res = clnt.post(uri, body) end
Do multipart wth custom body.
File.open('/tmp/post_data') do |file| body = [{ 'Content-Type' => 'application/atom+xml; charset=UTF-8', :content => '<entry>...</entry>' }, { 'Content-Type' => 'video/mp4', 'Content-Transfer-Encoding' => 'binary', :content => file }] res = clnt.post(uri, body) end
Ruby needs to be compiled with OpenSSL.
Get content of specified URL via SSL. Just pass an URL which starts with ‘https://’.
https_url = 'https://www.rsa.com' clnt.get(https_url)
Getting peer certificate from response.
res = clnt.get(https_url) p res.peer_cert #=> returns OpenSSL::X509::Certificate
Configuring OpenSSL options. See HTTPClient::SSLConfig for more details.
user_cert_file = 'cert.pem' user_key_file = 'privkey.pem' clnt.ssl_config.set_client_cert_file(user_cert_file, user_key_file) clnt.get(https_url)
Using volatile Cookies. Nothing to do. HTTPClient handles Cookies.
clnt = HTTPClient.new res = clnt.get(url1) # receives Cookies. res = clnt.get(url2) # sends Cookies if needed. p res.cookies
Saving non volatile Cookies to a specified file. Need to set a file at first and invoke save method at last.
clnt = HTTPClient.new clnt.set_cookie_store('/home/nahi/cookie.dat') clnt.get(url) ... clnt.save_cookie_store
Disabling Cookies.
clnt = HTTPClient.new clnt.cookie_manager = nil
Authentication with Web server. Supports BasicAuth, DigestAuth, and Negotiate/NTLM (requires ruby/ntlm module).
clnt = HTTPClient.new domain = 'http://dev.ctor.org/http-access2/' user = 'user' password = 'user' clnt.set_auth(domain, user, password) p clnt.get('http://dev.ctor.org/http-access2/login').status
Authentication with Proxy server. Supports BasicAuth and NTLM (requires win32/sspi)
clnt = HTTPClient.new(proxy) user = 'proxy' password = 'proxy' clnt.set_proxy_auth(user, password) p clnt.get(url)
Pass a Hash or an Array for header argument.
header = { 'Accept' => '*/*' } clnt.get(uri, query, header) header = [['Accept', 'image/jpeg'], ['Accept', 'image/png']] clnt.get_content(uri, query, header)
See head_async, get_async, post_async, put_async, delete_async, options_async, propfind_async, proppatch_async, and trace_async. It immediately returns a HTTPClient::Connection instance as a returning value.
connection = clnt.post_async(url, body) print 'posting.' while true break if connection.finished? print '.' sleep 1 end puts '.' res = connection.pop p res.status p res.body.read # res.body is an IO for the res of async method.
You can invoke get_content, get, etc. without creating HTTPClient instance.
ruby -rhttpclient -e 'puts HTTPClient.get_content(ARGV.shift)' http://dev.ctor.org/ ruby -rhttpclient -e 'p HTTPClient.head(ARGV.shift).header["last-modified"]' http://dev.ctor.org/
Default header for PROPFIND request.
An array of request filter which can trap HTTP request/response. See HTTPClient::WWWAuth to see how to use it.
How many times get_content and post_content follows HTTP redirect. 10 by default.
Creates a HTTPClient instance which manages sessions, cookies, etc.
HTTPClient.new takes 3 optional arguments for proxy url string, User-Agent String and From header String. User-Agent and From are embedded in HTTP request Header if given. No User-Agent and From header added without setting it explicitly.
proxy = 'http://myproxy:8080' agent_name = 'MyAgent/0.1' from =<EMAIL_ADDRESS>HTTPClient.new(proxy, agent_name, from)
You can use a keyword argument style Hash. Keys are :proxy, :agent_name and :from.
HTTPClient.new(:agent_name => 'MyAgent/0.1')
# File lib/httpclient.rb, line 374 374: def initialize(*args) 375: proxy, agent_name, from = keyword_argument(args, :proxy, :agent_name, :from) 376: @proxy = nil # assigned later. 377: @no_proxy = nil 378: @www_auth = WWWAuth.new 379: @proxy_auth = ProxyAuth.new 380: @request_filter = [@proxy_auth, @www_auth] 381: @debug_dev = nil 382: @redirect_uri_callback = method(:default_redirect_uri_callback) 383: @test_loopback_response = [] 384: @session_manager = SessionManager.new(self) 385: @session_manager.agent_name = agent_name 386: @session_manager.from = from 387: @session_manager.ssl_config = @ssl_config = SSLConfig.new(self) 388: @cookie_manager = WebAgent::CookieManager.new 389: @follow_redirect_count = 10 390: load_environment 391: self.proxy = proxy if proxy 392: keep_webmock_compat 393: end
# File lib/httpclient.rb, line 296 296: def attr_proxy(symbol, assignable = false) 297: name = symbol.to_s 298: define_method(name) { 299: @session_manager.__send__(name) 300: } 301: if assignable 302: aname = name + '=' 303: define_method(aname) { |rhs| 304: reset_all 305: @session_manager.__send__(aname, rhs) 306: } 307: end 308: end
# File lib/httpclient.rb, line 400 400: def body 401: def (o = self.content).content 402: self 403: end 404: o 405: end
Returns debug device if exists. See debug_dev=.
# File lib/httpclient.rb, line 411 411: def debug_dev 412: @debug_dev 413: end
Sets debug device. Once debug device is set, all HTTP requests and responses are dumped to given device. dev must respond to << for dump.
Calling this method resets all existing sessions.
# File lib/httpclient.rb, line 419 419: def debug_dev=(dev) 420: @debug_dev = dev 421: reset_all 422: @session_manager.debug_dev = dev 423: end
A default method for redirect uri callback. This method is used by HTTPClient instance by default. This callback allows relative redirect such as
Location: ../foo/
in HTTP header.
# File lib/httpclient.rb, line 637 637: def default_redirect_uri_callback(uri, res) 638: newuri = URI.parse(res.header['location'][0]) 639: unless newuri.is_a?(URI::HTTP) 640: newuri = uri + newuri 641: STDERR.puts("could be a relative URI in location header which is not recommended") 642: STDERR.puts("'The field value consists of a single absolute URI' in HTTP spec") 643: end 644: if https?(uri) && !https?(newuri) 645: raise BadResponseError.new("redirecting to non-https resource") 646: end 647: puts "redirect to: #{newuri}" if $DEBUG 648: newuri 649: end
Sends DELETE request to the specified URL. See request for arguments.
# File lib/httpclient.rb, line 672 672: def delete(uri, *args, &block) 673: request(:delete, uri, argument_to_hash(args, :header), &block) 674: end
Sends DELETE request in async style. See request_async for arguments. It immediately returns a HTTPClient::Connection instance as a result.
# File lib/httpclient.rb, line 787 787: def delete_async(uri, *args) 788: header = keyword_argument(args, :header) 789: request_async(:delete, uri, nil, nil, header || {}) 790: end
Sends GET request to the specified URL. See request for arguments.
# File lib/httpclient.rb, line 657 657: def get(uri, *args, &block) 658: request(:get, uri, argument_to_hash(args, :query, :header, :follow_redirect), &block) 659: end
Sends GET request in async style. See request_async for arguments. It immediately returns a HTTPClient::Connection instance as a result.
# File lib/httpclient.rb, line 766 766: def get_async(uri, *args) 767: query, header = keyword_argument(args, :query, :header) 768: request_async(:get, uri, query, nil, header || {}) 769: end
Retrieves a web resource.
| uri | a String or an URI object which represents an URL of web resource. |
| query | a Hash or an Array of query part of URL. e.g. { “a” => “b” } => ‘host/part?a=b’. Give an array to pass multiple value like
|
| header | a Hash or an Array of extra headers. e.g. { ‘Accept’ => ‘/’ } or [[‘Accept’, ‘image/jpeg’], [‘Accept’, ‘image/png’]]. |
| &block | Give a block to get chunked message-body of response like get_content(uri) { |chunked_body| … }. Size of each chunk may not be the same. |
get_content follows HTTP redirect status (see HTTP::Status.redirect?) internally and try to retrieve content from redirected URL. See redirect_uri_callback= how HTTP redirection is handled.
If you need to get full HTTP response including HTTP status and headers, use get method. get returns HTTP::Message as a response and you need to follow HTTP redirect by yourself if you need.
# File lib/httpclient.rb, line 575 575: def get_content(uri, *args, &block) 576: query, header = keyword_argument(args, :query, :header) 577: follow_redirect(:get, uri, query, nil, header || {}, &block).content 578: end
Sends HEAD request to the specified URL. See request for arguments.
# File lib/httpclient.rb, line 652 652: def head(uri, *args) 653: request(:head, uri, argument_to_hash(args, :query, :header)) 654: end
Sends HEAD request in async style. See request_async for arguments. It immediately returns a HTTPClient::Connection instance as a result.
# File lib/httpclient.rb, line 759 759: def head_async(uri, *args) 760: query, header = keyword_argument(args, :query, :header) 761: request_async(:head, uri, query, nil, header || {}) 762: end
webmock 1.6.2 depends on HTTP::Message#body.content to work. let’s keep it work iif webmock is loaded for a while.
# File lib/httpclient.rb, line 397 397: def keep_webmock_compat 398: if respond_to?(:do_get_block_with_webmock) 399: ::HTTP::Message.module_eval do 400: def body 401: def (o = self.content).content 402: self 403: end 404: o 405: end 406: end 407: end 408: end
Returns NO_PROXY setting String if given.
# File lib/httpclient.rb, line 461 461: def no_proxy 462: @no_proxy 463: end
Sets NO_PROXY setting String. no_proxy must be a comma separated String. Each entry must be ‘host’ or ‘host:port’ such as; HTTPClient#no_proxy = ‘example.com,example.co.jp:443’
‘localhost’ is treated as a no_proxy site regardless of explicitly listed. HTTPClient checks given URI objects before accessing it. ‘host’ is tail string match. No IP-addr conversion.
You can use environment variable ‘no_proxy’ or ‘NO_PROXY’ for it.
Calling this method resets all existing sessions.
# File lib/httpclient.rb, line 476 476: def no_proxy=(no_proxy) 477: @no_proxy = no_proxy 478: reset_all 479: end
Sends OPTIONS request to the specified URL. See request for arguments.
# File lib/httpclient.rb, line 677 677: def options(uri, *args, &block) 678: request(:options, uri, argument_to_hash(args, :header), &block) 679: end
Sends OPTIONS request in async style. See request_async for arguments. It immediately returns a HTTPClient::Connection instance as a result.
# File lib/httpclient.rb, line 794 794: def options_async(uri, *args) 795: header = keyword_argument(args, :header) 796: request_async(:options, uri, nil, nil, header || {}) 797: end
Sends POST request to the specified URL. See request for arguments.
# File lib/httpclient.rb, line 662 662: def post(uri, *args, &block) 663: request(:post, uri, argument_to_hash(args, :body, :header, :follow_redirect), &block) 664: end
Sends POST request in async style. See request_async for arguments. It immediately returns a HTTPClient::Connection instance as a result.
# File lib/httpclient.rb, line 773 773: def post_async(uri, *args) 774: body, header = keyword_argument(args, :body, :header) 775: request_async(:post, uri, nil, body || '', header || {}) 776: end
Posts a content.
| uri | a String or an URI object which represents an URL of web resource. |
| body | a Hash or an Array of body part. e.g. { "a" => "b" } => 'a=b' Give an array to pass multiple value like [["a", "b"], ["a", "c"]] => 'a=b&a=c' When you pass a File as a value, it will be posted as a multipart/form-data. e.g. { 'upload' => file } You can also send custom multipart by passing an array of hashes. Each part must have a :content attribute which can be a file, all other keys will become headers. [{ 'Content-Type' => 'text/plain', :content => "some text" }, { 'Content-Type' => 'video/mp4', :content => File.new('video.mp4') }] => <Two parts with custom Content-Type header> |
| header | a Hash or an Array of extra headers. e.g. { 'Accept' => '*/*' } or [['Accept', 'image/jpeg'], ['Accept', 'image/png']]. |
| &block | Give a block to get chunked message-body of response like post_content(uri) { |chunked_body| ... }. Size of each chunk may not be the same. |
post_content follows HTTP redirect status (see HTTP::Status.redirect?) internally and try to post the content to redirected URL. See redirect_uri_callback= how HTTP redirection is handled.
If you need to get full HTTP response including HTTP status and headers, use post method.
# File lib/httpclient.rb, line 610 610: def post_content(uri, *args, &block) 611: body, header = keyword_argument(args, :body, :header) 612: follow_redirect(:post, uri, nil, body, header || {}, &block).content 613: end
Sends PROPFIND request to the specified URL. See request for arguments.
# File lib/httpclient.rb, line 682 682: def propfind(uri, *args, &block) 683: request(:propfind, uri, argument_to_hash(args, :header), &block) 684: end
Sends PROPFIND request in async style. See request_async for arguments. It immediately returns a HTTPClient::Connection instance as a result.
# File lib/httpclient.rb, line 801 801: def propfind_async(uri, *args) 802: header = keyword_argument(args, :header) 803: request_async(:propfind, uri, nil, nil, header || PROPFIND_DEFAULT_EXTHEADER) 804: end
Sends PROPPATCH request to the specified URL. See request for arguments.
# File lib/httpclient.rb, line 687 687: def proppatch(uri, *args, &block) 688: request(:proppatch, uri, argument_to_hash(args, :body, :header), &block) 689: end
Sends PROPPATCH request in async style. See request_async for arguments. It immediately returns a HTTPClient::Connection instance as a result.
# File lib/httpclient.rb, line 808 808: def proppatch_async(uri, *args) 809: body, header = keyword_argument(args, :body, :header) 810: request_async(:proppatch, uri, nil, body, header || {}) 811: end
Returns URI object of HTTP proxy if exists.
# File lib/httpclient.rb, line 426 426: def proxy 427: @proxy 428: end
Sets HTTP proxy used for HTTP connection. Given proxy can be an URI, a String or nil. You can set user/password for proxy authentication like HTTPClient#proxy = ‘user:passwd@myproxy:8080‘
You can use environment variable ‘http_proxy’ or ‘HTTP_PROXY’ for it. You need to use ‘cgi_http_proxy’ or ‘CGI_HTTP_PROXY’ instead if you run HTTPClient from CGI environment from security reason. (HTTPClient checks ‘REQUEST_METHOD’ environment variable whether it’s CGI or not)
Calling this method resets all existing sessions.
# File lib/httpclient.rb, line 440 440: def proxy=(proxy) 441: if proxy.nil? 442: @proxy = nil 443: @proxy_auth.reset_challenge 444: else 445: @proxy = urify(proxy) 446: if @proxy.scheme == nil or @proxy.scheme.downcase != 'http' or 447: @proxy.host == nil or @proxy.port == nil 448: raise ArgumentError.new("unsupported proxy #{proxy}") 449: end 450: @proxy_auth.reset_challenge 451: if @proxy.user || @proxy.password 452<EMAIL_ADDRESS>@proxy.password) 453: end 454: end 455: reset_all 456: @session_manager.proxy = @proxy 457: @proxy 458: end
Sends PUT request to the specified URL. See request for arguments.
# File lib/httpclient.rb, line 667 667: def put(uri, *args, &block) 668: request(:put, uri, argument_to_hash(args, :body, :header), &block) 669: end
Sends PUT request in async style. See request_async for arguments. It immediately returns a HTTPClient::Connection instance as a result.
# File lib/httpclient.rb, line 780 780: def put_async(uri, *args) 781: body, header = keyword_argument(args, :body, :header) 782: request_async(:put, uri, nil, body || '', header || {}) 783: end
Sets callback proc when HTTP redirect status is returned for get_content and post_content. default_redirect_uri_callback is used by default.
If you need strict implementation which does not allow relative URI redirection, set strict_redirect_uri_callback instead.
clnt.redirect_uri_callback = clnt.method(:strict_redirect_uri_callback)
# File lib/httpclient.rb, line 550 550: def redirect_uri_callback=(redirect_uri_callback) 551: @redirect_uri_callback = redirect_uri_callback 552: end
Sends a request to the specified URL.
| method | HTTP method to be sent. method.to_s.upcase is used. |
| uri | a String or an URI object which represents an URL of web resource. |
| query | a Hash or an Array of query part of URL. e.g. { “a” => “b” } => ‘host/part?a=b’ Give an array to pass multiple value like
|
| body | a Hash or an Array of body part. e.g. { "a" => "b" } => 'a=b' Give an array to pass multiple value like [["a", "b"], ["a", "c"]] => 'a=b&a=c'. When the given method is ‘POST’ and the given body contains a file as a value, it will be posted as a multipart/form-data. e.g. { 'upload' => file } You can also send custom multipart by passing an array of hashes. Each part must have a :content attribute which can be a file, all other keys will become headers. [{ 'Content-Type' => 'text/plain', :content => "some text" }, { 'Content-Type' => 'video/mp4', :content => File.new('video.mp4') }] => <Two parts with custom Content-Type header> See HTTP::Message.file? for actual condition of ‘a file’. |
| header | a Hash or an Array of extra headers. e.g. { ‘Accept’ => ‘/’ } or [[‘Accept’, ‘image/jpeg’], [‘Accept’, ‘image/png’]]. |
| &block | Give a block to get chunked message-body of response like get(uri) { |chunked_body| … }. Size of each chunk may not be the same. |
You can also pass a String as a body. HTTPClient just sends a String as a HTTP request message body.
When you pass an IO as a body, HTTPClient sends it as a HTTP request with chunked encoding (Transfer-Encoding: chunked in HTTP header). Bear in mind that some server application does not support chunked request. At least cgi.rb does not support it.
# File lib/httpclient.rb, line 734 734: def request(method, uri, *args, &block) 735: query, body, header, follow_redirect = keyword_argument(args, :query, :body, :header, :follow_redirect) 736: if [:post, :put].include?(method) 737: body ||= '' 738: end 739: if method == :propfind 740: header ||= PROPFIND_DEFAULT_EXTHEADER 741: else 742: header ||= {} 743: end 744: uri = urify(uri) 745: if block 746: filtered_block = proc { |res, str| 747: block.call(str) 748: } 749: end 750: if follow_redirect 751: follow_redirect(method, uri, query, body, header, &block) 752: else 753: do_request(method, uri, query, body, header, &filtered_block) 754: end 755: end
Sends a request in async style. request method creates new Thread for HTTP connection and returns a HTTPClient::Connection instance immediately.
Arguments definition is the same as request.
# File lib/httpclient.rb, line 824 824: def request_async(method, uri, query = nil, body = nil, header = {}) 825: uri = urify(uri) 826: do_request_async(method, uri, query, body, header) 827: end
Resets internal session for the given URL. Keep-alive connection for the site (host-port pair) is disconnected if exists.
# File lib/httpclient.rb, line 831 831: def reset(uri) 832: uri = urify(uri) 833: @session_manager.reset(uri) 834: end
Resets all of internal sessions. Keep-alive connections are disconnected.
# File lib/httpclient.rb, line 837 837: def reset_all 838: @session_manager.reset_all 839: end
Sets credential for Web server authentication.
| domain | a String or an URI to specify where HTTPClient should use this |
credential. If you set uri to nil, HTTPClient uses this credential wherever a server requires it.
| user | username String. |
| passwd | password String. |
You can set multiple credentials for each uri.
clnt.set_auth('http://www.example.com/foo/', 'foo_user', 'passwd') clnt.set_auth('http://www.example.com/bar/', 'bar_user', 'passwd')
Calling this method resets all existing sessions.
# File lib/httpclient.rb, line 494 494: def set_auth(domain, user, passwd) 495: uri = urify(domain) 496: @www_auth.set_auth(uri, user, passwd) 497: reset_all 498: end
Deprecated. Use set_auth instead.
# File lib/httpclient.rb, line 501 501: def set_basic_auth(domain, user, passwd) 502: uri = urify(domain) 503: @www_auth.basic_auth.set(uri, user, passwd) 504: reset_all 505: end
A method for redirect uri callback. How to use:
clnt.redirect_uri_callback = clnt.method(:strict_redirect_uri_callback)
This callback does not allow relative redirect such as
Location: ../foo/
in HTTP header. (raises BadResponseError instead)
# File lib/httpclient.rb, line 620 620: def strict_redirect_uri_callback(uri, res) 621: newuri = URI.parse(res.header['location'][0]) 622: if https?(uri) && !https?(newuri) 623: raise BadResponseError.new("redirecting to non-https resource") 624: end 625: unless newuri.is_a?(URI::HTTP) 626: raise BadResponseError.new("unexpected location: #{newuri}", res) 627: end 628: puts "redirect to: #{newuri}" if $DEBUG 629: newuri 630: end
Sends TRACE request to the specified URL. See request for arguments.
# File lib/httpclient.rb, line 692 692: def trace(uri, *args, &block) 693: request('TRACE', uri, argument_to_hash(args, :query, :body, :header), &block) 694: end
Sends TRACE request in async style. See request_async for arguments. It immediately returns a HTTPClient::Connection instance as a result.
# File lib/httpclient.rb, line 815 815: def trace_async(uri, *args) 816: query, body, header = keyword_argument(args, :query, :body, :header) 817: request_async(:trace, uri, query, body, header || {}) 818: end
# File lib/httpclient.rb, line 1004 1004: def create_boundary 1005: Digest::SHA1.hexdigest(Time.now.to_s) 1006: end
# File lib/httpclient.rb, line 962 962: def create_request(method, uri, query, body, header) 963: method = method.to_s.upcase 964: if header.is_a?(Hash) 965: header = header.to_a 966: else 967: header = header.dup 968: end 969: boundary = nil 970: if body 971: _, content_type = header.find { |key, value| 972: key.downcase == 'content-type' 973: } 974: if content_type 975: if /\Amultipart/ =~ content_type 976: if content_type =~ /boundary=(.+)\z/ 977: boundary = $1 978: else 979: boundary = create_boundary 980: content_type = "#{content_type}; boundary=#{boundary}" 981: header = override_header(header, 'Content-Type', content_type) 982: end 983: end 984: elsif method == 'POST' 985: if file_in_form_data?(body) 986: boundary = create_boundary 987: content_type = "multipart/form-data; boundary=#{boundary}" 988: else 989: content_type = 'application/x-www-form-urlencoded' 990: end 991: header << ['Content-Type', content_type] 992: end 993: end 994: req = HTTP::Message.new_request(method, uri, query, body, boundary) 995: header.each do |key, value| 996: req.header.add(key, value) 997: end 998: if @cookie_manager && cookie = @cookie_manager.find(uri) 999: req.header.add('Cookie', cookie) 1000: end 1001: req 1002: end
!! CAUTION !!
Method 'do_get*' runs under MT conditon. Be careful to change.
# File lib/httpclient.rb, line 1045 1045: def do_get_block(req, proxy, conn, &block) 1046: @request_filter.each do |filter| 1047: filter.filter_request(req) 1048: end 1049: if str = @test_loopback_response.shift 1050: dump_dummy_request_response(req.http_body.dump, str) if @debug_dev 1051: conn.push(HTTP::Message.new_response(str)) 1052: return 1053: end 1054: content = block ? nil : '' 1055: res = HTTP::Message.new_response(content) 1056: @debug_dev << "= Request\n\n" if @debug_dev 1057: sess = @session_manager.query(req, proxy) 1058: res.peer_cert = sess.ssl_peer_cert 1059: @debug_dev << "\n\n= Response\n\n" if @debug_dev 1060: do_get_header(req, res, sess) 1061: conn.push(res) 1062: sess.get_body do |part| 1063: force_binary(part) 1064: if block 1065: block.call(res, part) 1066: else 1067: content << part 1068: end 1069: end 1070: # there could be a race condition but it's OK to cache unreusable 1071: # connection because we do retry for that case. 1072: @session_manager.keep(sess) unless sess.closed? 1073: commands = @request_filter.collect { |filter| 1074: filter.filter_response(req, res) 1075: } 1076: if commands.find { |command| command == :retry } 1077: raise RetryableResponse.new 1078: end 1079: end
# File lib/httpclient.rb, line 1110 1110: def do_get_header(req, res, sess) 1111: res.http_version, res.status, res.reason, headers = sess.get_header 1112: headers.each do |key, value| 1113: res.header.add(key, value) 1114: end 1115: if @cookie_manager 1116: res.header['set-cookie'].each do |cookie| 1117: @cookie_manager.parse(cookie, req.header.request_uri) 1118: end 1119: end 1120: end
# File lib/httpclient.rb, line 1081 1081: def do_get_stream(req, proxy, conn) 1082: @request_filter.each do |filter| 1083: filter.filter_request(req) 1084: end 1085: if str = @test_loopback_response.shift 1086: dump_dummy_request_response(req.http_body.dump, str) if @debug_dev 1087: conn.push(HTTP::Message.new_response(StringIO.new(str))) 1088: return 1089: end 1090: piper, pipew = IO.pipe 1091: res = HTTP::Message.new_response(piper) 1092: @debug_dev << "= Request\n\n" if @debug_dev 1093: sess = @session_manager.query(req, proxy) 1094: res.peer_cert = sess.ssl_peer_cert 1095: @debug_dev << "\n\n= Response\n\n" if @debug_dev 1096: do_get_header(req, res, sess) 1097: conn.push(res) 1098: sess.get_body do |part| 1099: force_binary(part) 1100: pipew.write(part) 1101: end 1102: pipew.close 1103: @session_manager.keep(sess) unless sess.closed? 1104: _ = @request_filter.collect { |filter| 1105: filter.filter_response(req, res) 1106: } 1107: # ignore commands (not retryable in async mode) 1108: end
# File lib/httpclient.rb, line 853 853: def do_request(method, uri, query, body, header, &block) 854: conn = Connection.new 855: res = nil 856: if HTTP::Message.file?(body) 857: pos = body.pos rescue nil 858: end 859: retry_count = @session_manager.protocol_retry_count 860: proxy = no_proxy?(uri) ? nil : @proxy 861: while retry_count > 0 862: body.pos = pos if pos 863: req = create_request(method, uri, query, body, header) 864: begin 865: protect_keep_alive_disconnected do 866: do_get_block(req, proxy, conn, &block) 867: end 868: res = conn.pop 869: break 870: rescue RetryableResponse 871: res = conn.pop 872: retry_count -= 1 873: end 874: end 875: res 876: end
# File lib/httpclient.rb, line 878 878: def do_request_async(method, uri, query, body, header) 879: conn = Connection.new 880: t = Thread.new(conn) { |tconn| 881: begin 882: if HTTP::Message.file?(body) 883: pos = body.pos rescue nil 884: end 885: retry_count = @session_manager.protocol_retry_count 886: proxy = no_proxy?(uri) ? nil : @proxy 887: while retry_count > 0 888: body.pos = pos if pos 889: req = create_request(method, uri, query, body, header) 890: begin 891: protect_keep_alive_disconnected do 892: do_get_stream(req, proxy, tconn) 893: end 894: break 895: rescue RetryableResponse 896: retry_count -= 1 897: end 898: end 899: rescue Exception 900: conn.push $! 901: end 902: } 903: conn.async_thread = t 904: conn 905: end
# File lib/httpclient.rb, line 1122 1122: def dump_dummy_request_response(req, res) 1123: @debug_dev << "= Dummy Request\n\n" 1124: @debug_dev << req 1125: @debug_dev << "\n\n= Dummy Response\n\n" 1126: @debug_dev << res 1127: end
# File lib/httpclient.rb, line 1008 1008: def file_in_form_data?(body) 1009: HTTP::Message.multiparam_query?(body) && 1010: body.any? { |k, v| HTTP::Message.file?(v) } 1011: end
# File lib/httpclient.rb, line 925 925: def follow_redirect(method, uri, query, body, header, &block) 926: uri = urify(uri) 927: if block 928: filtered_block = proc { |r, str| 929: block.call(str) if HTTP::Status.successful?(r.status) 930: } 931: end 932: if HTTP::Message.file?(body) 933: pos = body.pos rescue nil 934: end 935: retry_number = 0 936: while retry_number < @follow_redirect_count 937: body.pos = pos if pos 938: res = do_request(method, uri, query, body, header, &filtered_block) 939: if HTTP::Status.successful?(res.status) 940: return res 941: elsif HTTP::Status.redirect?(res.status) 942: uri = urify(@redirect_uri_callback.call(uri, res)) 943: retry_number += 1 944: else 945: raise BadResponseError.new("unexpected response: #{res.header.inspect}", res) 946: end 947: end 948: raise BadResponseError.new("retry count exceeded", res) 949: end
# File lib/httpclient.rb, line 921 921: def getenv(name) 922: ENV[name.downcase] || ENV[name.upcase] 923: end
# File lib/httpclient.rb, line 907 907: def load_environment 908: # http_proxy 909: if getenv('REQUEST_METHOD') 910: # HTTP_PROXY conflicts with the environment variable usage in CGI where 911: # HTTP_* is used for HTTP header information. Unlike open-uri, we 912: # simply ignore http_proxy in CGI env and use cgi_http_proxy instead. 913: self.proxy = getenv('cgi_http_proxy') 914: else 915: self.proxy = getenv('http_proxy') 916: end 917: # no_proxy 918: self.no_proxy = getenv('no_proxy') 919: end
# File lib/httpclient.rb, line 1027 1027: def no_proxy?(uri) 1028: if !@proxy or NO_PROXY_HOSTS.include?(uri.host) 1029: return true 1030: end 1031: unless @no_proxy 1032: return false 1033: end 1034: @no_proxy.scan(/([^:,]+)(?::(\d+))?/) do |host, port| 1035: if /(\A|\.)#{Regexp.quote(host)}\z/ =~ uri.host && 1036: (!port || uri.port == port.to_i) 1037: return true 1038: end 1039: end 1040: false 1041: end
# File lib/httpclient.rb, line 1013 1013: def override_header(header, key, value) 1014: result = [] 1015: header.each do |k, v| 1016: if k.downcase == key.downcase 1017: result << [key, value] 1018: else 1019: result << [k, v] 1020: end 1021: end 1022: result 1023: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.


NANORC
Section: File Formats (5)Updated: version 2.0.0
Index Return to Main Contents
NAME
nanorc - GNU nano's rcfileDESCRIPTION
This manual page briefly documents GNU nano's rcfile.nano is a small, free and friendly editor which aims to replace Pico, the default editor included in the non-free Pine package. Rather than just copying Pico's look and feel, nano also implements some missing (or disabled by default) features in Pico, such as "search and replace" and "go to line and column number".
The nanorc file contains the default settings for nano. It should not be in DOS or Mac format. During startup, nano will first read its system-wide settings from SYSCONFDIR/nanorc, and then user-specific settings from ~/.nanorc.
OPTIONS
The configuration file accepts a series of set and unset commands, which can be used to configure nano on startup without using the command line options. Additionally, the syntax, color, and icolor keywords are used to define syntax highlighting rules for different text patterns. nano will read one command per line.Options in nanorc files take precedence over nano's defaults, and command line options override nanorc settings. Also, options are unset by default, except for those that take arguments.
Quotes inside string parameters don't have to be escaped with backslashes. The last double quote in the string will be treated as its end. For example, for the brackets option, ""')>]}" will match ", ', ), >, ], and }.
The supported commands and arguments are:
- set/unset autoindent
- Use auto-indentation.
- set/unset backup
- Create backup files in filename~.
- set backupdir directory
- Set the directory where nano puts unique backup files if file backups are enabled.
- set/unset backwards
- Do backwards searches by default.
- set/unset boldtext
- Use bold text instead of reverse video text.
- set brackets string
- Set the characters treated as closing brackets when justifying paragraphs. They cannot contain blank characters. Only closing punctuation, optionally followed by closing brackets, can end sentences. The default value is ""')>]}".
- set/unset casesensitive
- Do case sensitive searches by default.
- set/unset const
- Constantly display the cursor position in the status bar.
- set/unset cut
- Use cut to end of line by default.
- set fill n
- Wrap lines at column number n. If n is 0 or less, the maximum line length will be the screen width less n columns. The default value is -8.
- set/unset historylog
- Enable ~/.nano_history for saving and reading search/replace strings.
- set matchbrackets string
- Set the opening and closing brackets that can be found by bracket searches. They cannot contain blank characters. The former set must come before the latter set, and both must be in the same order. The default value is "(<[{)>]}".
- set/unset morespace
- Use the blank line below the titlebar as extra editing space.
- set/unset mouse
- Enable mouse support, if available for your system. When enabled, mouse clicks can be used to place the cursor, set the mark (with a double click), and execute shortcuts. The mouse will work in the X Window System, and on the console when gpm is running.
- set/unset multibuffer
- Allow inserting files into their own buffers.
- set/unset noconvert
- Don't convert files from DOS/Mac format.
- set/unset nofollow
- Don't follow symlinks when writing files.
- set/unset nohelp
- Don't display the help lists at the bottom of the screen.
- set/unset nonewlines
- Don't add newlines to the ends of files.
- set/unset nowrap
- Don't wrap text at all.
- set operatingdir directory
- nano will only read and write files inside directory and its subdirectories. Also, the current directory is changed to here, so files are inserted from this diractory. By default, the operating directory feature is turned off.
- set/unset preserve
- Preserve the XON and XOFF keys (^Q and ^S).
- set punct string
- Set the characters treated as closing punctuation when justifying paragraphs. They cannot contain blank characters. Only closing punctuation, optionally followed by closing brackets, can end sentences. The default value is "!.?".
- set/unset quickblank
- Do quick statusbar blanking. Statusbar messages will disappear after 1 keystroke instead of 25.
- set quotestr string
- The email-quote string, used to justify email-quoted paragraphs. This is an extended regular expression if your system supports them, otherwise a literal string. The default value is "^([ \t]*[#:>\|}])+" if you have extended regular expression support, or "> " otherwise. Note that '\t' stands for a literal Tab character.
- set/unset rebinddelete
- Interpret the Delete key differently so that both Backspace and Delete work properly. You should only need to use this option if Backspace acts like Delete on your system.
- set/unset rebindkeypad
- Interpret the numeric keypad keys so that they all work properly. You should only need to use this option if they don't, as mouse support won't work properly with this option enabled.
- set/unset regexp
- Do extended regular expression searches by default.
- set/unset smarthome
- Make the Home key smarter. When Home is pressed anywhere but at the very beginning of non-whitespace characters on a line, the cursor will jump to that beginning (either forwards or backwards). If the cursor is already at that position, it will jump to the true beginning of the line.
- set/unset smooth
- Use smooth scrolling by default.
- set speller spellprog
- Use spelling checker spellprog instead of the built-in one, which calls spell.
- set/unset suspend
- Allow nano to be suspended.
- set tabsize n
- Use a tab size of n columns. The value of n must be greater than 0. The default value is 8.
- set/unset tabstospaces
- Convert typed tabs to spaces.
- set/unset tempfile
- Save automatically on exit, don't prompt.
- set/unset view
- Disallow file modification.
- set whitespace string
- Set the two characters used to display the first characters of tabs and spaces. They must be single-column characters.
- set/unset wordbounds
- Detect word boundaries more accurately by treating punctuation characters as parts of words.
- syntax str [fileregex ... ]
-
Defines a syntax named str which can be activated via the
-Y/--syntax command line option, or will be automatically activated if
the current filename matches the extended regular expression
fileregex. All following color and icolor statements
will apply to syntax until a new syntax is defined.
The none syntax is reserved; specifying it on the command line is the same as not having a syntax at all. The default syntax is special: it takes no fileregex, and applies to files that don't match any other syntax's fileregex.
- color fgcolor,bgcolor regex ...
- For the currently defined syntax, display all expressions matching the extended regular expression regex with foreground color fgcolor and background color bgcolor, at least one of which must be specified. Legal colors for foreground and background color are: white, black, red, blue, green, yellow, magenta, and cyan. You may use the prefix "bright" to force a stronger color highlight for the foreground. If your terminal supports transparency, not specifying a bgcolor tells nano to attempt to use a transparent background.
- icolor fgcolor,bgcolor regex ...
- Same as above, except that the expression matching is case insensitive.
- color fgcolor,bgcolor start=sr end=er
- Display expressions which start with the extended regular expression sr and end with the extended regular expression er with foreground color fgcolor and background color bgcolor, at least one of which must be specified. This allows syntax highlighting to span multiple lines. Note that all subsequent instances of sr after an initial sr is found will be highlighted until the first instance of er.
- icolor fgcolor,bgcolor start=sr end=er
- Same as above, except that the expression matching is case insensitive.
- include syntaxfile
- Read in self-contained color syntaxes from syntaxfile. Note that syntaxfile can only contain syntax, color, and icolor commands.
FILES
- SYSCONFDIR/nanorc
- System-wide configuration file
- ~/.nanorc
- Per-user configuration file
SEE ALSO
- nano(1)
/usr/share/doc/nano/examples/nanorc.sample (or equivalent on your system)
AUTHOR
Chris Allegretta<EMAIL_ADDRESS>et al (see AUTHORS and THANKS for details). This manual page was originally written by Jordi Mallach<EMAIL_ADDRESS>for the Debian system (but may be used by others).
Index
This document was created by man2html, using the manual pages.
Time: 05:34:00 GMT, December 24, 2015


Log in
Sign up
Submit
Create a account.
log-in into a existing account.
Edit
Save
+
Log out
Edit First Name
Edit Last Name
Edit e-mail
Edit Password
Done