--- !ruby/object:RI::ClassDescription 
attributes: []

class_methods: []

comment: 
- !ruby/struct:SM::Flow::P 
  body: KirbyBase is a class that allows you to create and manipulate simple, plain-text databases. You can use it in either a single-user or client-server mode. You can select records for retrieval/updating using code blocks.
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "Author:"
    body: Jamey Cribbs (mailto:jcribbs@twmi.rr.com)
  - !ruby/struct:SM::Flow::LI 
    label: "Homepage:"
    body: http://www.netpromi.com/kirbybase.html
  - !ruby/struct:SM::Flow::LI 
    label: "Copyright:"
    body: Copyright (c) 2005 NetPro Technologies, LLC
  - !ruby/struct:SM::Flow::LI 
    label: "License:"
    body: Distributes under the same terms as Ruby
  type: :NOTE
- !ruby/struct:SM::Flow::P 
  body: "History:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "2005-03-28:"
    body: Version 2.0
  type: :NOTE
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: This is a completely new version. The interface has changed dramatically.
  type: :BULLET
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "2005-04-11:"
    body: Version 2.1
  type: :NOTE
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Changed the interface to KirbyBase#new and KirbyBase#create_table. You now specify arguments via a code block or as part of the argument list.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "Added the ability to specify a class at table creation time. Thereafter, whenever you do a #select, the result set will be an array of instances of that class, instead of instances of Struct. You can also use instances of this class as the argument to KBTable#insert, KBTable#update, and KBTable#set."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added the ability to encrypt a table so that it is no longer stored as a plain-text file.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added the ability to explicity specify that you want a result set to be sorted in ascending order.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added the ability to import a csv file into an existing table.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added the ability to select a record as if the table were a Hash with it's key being the recno field.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added the ability to update a record as if the table were a Hash with it's key being the recno field.
  type: :BULLET
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "2005-05-02:"
    body: Version 2.2
  type: :NOTE
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: By far the biggest change in this version is that I have completely redesigned the internal structure of the database code. Because the KirbyBase and KBTable classes were too tightly coupled, I have created a KBEngine class and moved all low-level I/O logic and locking logic to this class. This allowed me to restructure the KirbyBase class to remove all of the methods that should have been private, but couldn't be because of the coupling to KBTable. In addition, it has allowed me to take all of the low-level code that should not have been in the KBTable class and put it where it belongs, as part of the underlying engine. I feel that the design of KirbyBase is much cleaner now. No changes were made to the class interfaces, so you should not have to change any of your code.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Changed str_to_date and str_to_datetime to use Date#parse method.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "Changed #pack method so that it no longer reads the whole file into memory while packing it."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Changed code so that special character sequences like &amp;linefeed; can be part of input data and KirbyBase will not interpret it as special characters.
  type: :BULLET
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "2005-08-09:"
    body: Version 2.2.1
  type: :NOTE
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Fixed a bug in with_write_lock.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Fixed a bug that occurred if @record_class was a nested class.
  type: :BULLET
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "2005-09-08:"
    body: Version 2.3 Beta 1
  type: :NOTE
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added ability to specify one-to-one links between tables.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added ability to specify one-to-many links between tables.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added ability to specify calculated fields in tables.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added Memo and Blob field types.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added indexing to speed up queries.
  type: :BULLET
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "2005-10-03:"
    body: Version 2.3 Beta 2
  type: :NOTE
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "New column type: :YAML. Many thanks to Logan Capaldo for this idea!"
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "Two new methods: #add_table_column and #drop_table_column."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: I have refined the select code so that, when you are doing a one-to-one or one-to-many select, if an appropriate index exists for the child table, KirbyBase automatically uses it.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: I have changed the designation for a one-to-one link from Link-&gt; to Lookup-&gt; after googling helped me see that this is a more correct term for what I am trying to convey with this link type.
  type: :BULLET
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "2005-10-10:"
    body: Version 2.3 Production
  type: :NOTE
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added the ability to designate a table field as the &quot;key&quot; field, for Lookup purposes. This simply makes it easier to define Lookup fields.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "This led me to finally give in and add &quot;the Hal Fulton Feature&quot; as I am forever going to designate it. You can now specify a Lookup field simply by specifying it's field type as a table, for example: :manager, :person (where :manager is the field name, and :person is the name of a table). See the docs for the specifics or ask Hal. :)"
  type: :BULLET
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "2005-11-13:"
    body: Version 2.4
  type: :NOTE
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "Added a new column type: :Time. Thanks to George Moschovitis for coding this enhancement."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added more functionality to Memo and Blob fields. They are no longer just read-only. You can now also write to them from KirbyBase. The interface for Memo and Blob fields has changed because of this.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added the ability to specify, when you initialize a database connection, a base directory where memo/blob fields will be stored.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Changed the way indexes are handled by KBTable in client/server mode. Now, when KBTable grabs an index from KBEngine, it will hold onto it and re-use it unless it has been modified since the last time it grabbed it. This speeds up subsequent queries on the same index.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "Removed the restriction that the child table had to exist before you could define a Link_many field in #create_table. I did this so that it would possible to now define many-to-many links. See the example in the distribution. This also goes for Lookup fields."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "Added two sample scripts: kbserverctl.rb and kbserver_daemon.rb, that show how to set up a KirbyBase server process as a Windows Service. Thanks to Daniel Berger for his excellent package, win32-service."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Thouroughly revised the manual. I used the excellent text document formatter, AsciiDoc. Many thanks to Stuart Rackham for developing this great tool.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Fixed a bug in KBTable#clear that was causing the recno counter not to be reset. Thanks to basi for this.
  type: :BULLET
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "2005-12-01:"
    body: Version 2.5
  type: :NOTE
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Fixed a subtle bug in KBTable#create_indexes.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "Added the following new methods to KBTable: add_index, drop_index, rename_column, change_column_type, change_column_default_value, and change_column_required."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added the ability to specify a default column value at table creation time.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added the ability to specify, at table creation time, that a column value is required when inserting or updating records.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "Removed #add_table_column and #drop_table_column from KirbyBase class and added #add_column and #drop_column to KBTable class. I felt like it made more sense to have these methods in the table's class rather than the database's class."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added KirbyBase#rename_table method.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added the ability to, upon database initialization, specify that index creation should not happen until a table is actually opened. This speeds up database initialization at the cost of slower table initialization later.
  type: :BULLET
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "2005-12-28:"
    body: Version 2.5.1
  type: :NOTE
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Fixed a bug that had broken encrypted tables.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Changed KBTable#pack method so that it raises an error if trying to execute when :connect_type==:client.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Fixed a bug where it was possible to insert records missing a required field if using a hash. Thanks to Adam Shelly for this.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Fixed a bug that occurred when you tried to update records using a block and you tried to reference a field in the current record inside the block. Much thanks to Assaph Mehr for reporting this.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Fixed a bug that allowed you to have duplicate column names. Thanks to Assaph Mehr for spotting this.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Changed the way KBTable#set works with memo/blob fields.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Started creating unit tests.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Changed the KBTable#clear method to return number of records deleted. Thanks to Assaph Mehr for this enhancement.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "Moved #build_header_string from KBEngine class to KirbyBase class."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added KirbyBase::VERSION constant.
  type: :BULLET
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "2005-12-30:"
    body: Version 2.5.2
  type: :NOTE
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Changed the behavior of KBTable#insert method. If user explicitly specifies nil for a field value and there is a default value for that field, the default value will no longer override the user specified nil value. Thanks to Assaph Mehr for suggesting this.
  type: :BULLET
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "2006-06-27:"
    body: Version 2.6
  type: :NOTE
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "Removed NilClass#method_missing. I have replaced it with a new class called KBNilClass. Thanks to a host of people for help on this, including: Assaph Mehr, James Edward Gray II, Matthew Desmarais, Logan Capaldo, Trans, John Carter, Dave Burt and anyone else I missed."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added conditional require logic so that KirbyBase will use FasterCVS if it is available. Thanks to James Edward Gray II for this.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: You can now delay index creation in local mode. Thanks to Nicholas Rahn for this.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: Added ability to allow for a custom record class with no kb_create or kb_defaults methods. KirbyBase will return each result record as an instance of the custom record class, and will attempt to set attributes with the same names as the table's field names equal to the values of the table record's fields. Thanks to Hal Fulton for this idea.
  type: :BULLET
constants: 
- !ruby/object:RI::Constant 
  comment: 
  - !ruby/struct:SM::Flow::P 
    body: Constant that will represent a kb_nil in the physical table file. If you think you might need to write the value 'kb_nil' to a field yourself, comment out the following line and un-comment the line below that to use an alternative representation for kb_nil.
  name: KB_NIL
  value: "'kb_nil'"
- !ruby/object:RI::Constant 
  comment: 
  - !ruby/struct:SM::Flow::P 
    body: Regular expression used to determine if field needs to be un-encoded.
  name: UNENCODE_RE
  value: /&(?:amp|linefeed|carriage_return|substitute|pipe);/
- !ruby/object:RI::Constant 
  comment: 
  - !ruby/struct:SM::Flow::P 
    body: Regular expression used to determine if field needs to be encoded.
  name: ENCODE_RE
  value: /&|\n|\r|\032|\|/
full_name: KBTypeConversionsMixin
includes: []

instance_methods: 
- !ruby/object:RI::MethodSummary 
  name: convert_to_encoded_string
- !ruby/object:RI::MethodSummary 
  name: convert_to_native_type
name: KBTypeConversionsMixin
superclass: 
