added simple readme
This commit is contained in:
parent
4c186ddd6f
commit
4b684929f3
2 changed files with 34 additions and 1 deletions
31
README.rdoc
31
README.rdoc
|
@ -1,6 +1,35 @@
|
||||||
= SANE FFI
|
= SANE FFI
|
||||||
|
|
||||||
Scanner Access Now Easier in Ruby using FFI. This gem provides bindings
|
Scanner Access Now Easier in Ruby using FFI. This gem provides
|
||||||
|
bindings to SANE library using Ruby FFI. You can easily access to the
|
||||||
|
device state (i.e. buttons), setup device parameters, scan images,
|
||||||
|
etc.
|
||||||
|
|
||||||
|
== Usage
|
||||||
|
|
||||||
|
>> require "sane"
|
||||||
|
=> true
|
||||||
|
>> Sane.open { |sane| puts sane.devices.inspect }
|
||||||
|
[#<Sane::Device:"genesys:libusb:002:032">]
|
||||||
|
=> nil
|
||||||
|
>> Sane.open { |sane| puts sane.devices.first.name }
|
||||||
|
genesys:libusb:002:032
|
||||||
|
=> nil
|
||||||
|
>> Sane.open { |sane| puts sane.devices.first.vendor }
|
||||||
|
Canon
|
||||||
|
=> nil
|
||||||
|
>> Sane.open { |sane| puts sane.devices.first.model }
|
||||||
|
LiDE 100
|
||||||
|
=> nil
|
||||||
|
>> Sane.open { |sane| puts sane.devices.first.type }
|
||||||
|
flatbed scanner
|
||||||
|
=> nil
|
||||||
|
>> Sane.open { |sane| sane.devices.first.open { |device| puts device.describe(:copy) } }
|
||||||
|
{:name=>"copy", :title=>"Copy button", :desc=>"Copy button", :type=>:bool, :unit=>:none, :size=>4, :cap=>70}
|
||||||
|
=> nil
|
||||||
|
>> Sane.open { |sane| sane.devices.first.open { |device| puts device[:copy] } }
|
||||||
|
false
|
||||||
|
=> nil
|
||||||
|
|
||||||
== Copyright
|
== Copyright
|
||||||
|
|
||||||
|
|
|
@ -116,6 +116,10 @@ class Sane
|
||||||
option_descriptors[option_lookup(option)]
|
option_descriptors[option_lookup(option)]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def inspect
|
||||||
|
%Q{#<#{self.class.name}:"#{name}">}
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def ensure_closed!
|
def ensure_closed!
|
||||||
|
|
Loading…
Add table
Reference in a new issue