Permalink
Browse files

Imported KirbyBase 2.6

  • Loading branch information...
0 parents commit ee03978e5b248d1ba559fb73348bc19a9be4d660 @weppos committed Nov 26, 2009
Showing with 12,938 additions and 0 deletions.
  1. +67 −0 README
  2. +18 −0 bin/kbserver.rb
  3. +144 −0 changes.txt
  4. +237 −0 examples/aaa_try_this_first/kbtest.rb
  5. +27 −0 examples/add_column_test/add_column_test.rb
  6. +51 −0 examples/calculated_field_test/calculated_field_test.rb
  7. +25 −0 examples/change_column_type_test/change_column_type_test.rb
  8. +44 −0 examples/column_required_test/column_required_test.rb
  9. +100 −0 examples/crosstab_test/crosstab_test.rb
  10. +31 −0 examples/csv_import_test/csv_import_test.rb
  11. +11 −0 examples/csv_import_test/plane.csv
  12. +54 −0 examples/default_value_test/default_value_test.rb
  13. +24 −0 examples/drop_column_test/drop_column_test.rb
  14. +46 −0 examples/indexes_test/add_index_test.rb
  15. +66 −0 examples/indexes_test/drop_index_test.rb
  16. +94 −0 examples/indexes_test/index_test.rb
  17. +47 −0 examples/kbserver_as_win32_service/kbserver_daemon.rb
  18. +75 −0 examples/kbserver_as_win32_service/kbserverctl.rb
  19. +70 −0 examples/link_many_test/link_many_test.rb
  20. +55 −0 examples/lookup_field_test/lookup_field_test.rb
  21. +62 −0 examples/lookup_field_test/lookup_field_test_2.rb
  22. +69 −0 examples/lookup_field_test/the_hal_fulton_feature_test.rb
  23. +65 −0 examples/many_to_many_test/many_to_many_test.rb
  24. +74 −0 examples/memo_test/memo_test.rb
  25. 0 examples/memo_test/memos/blank.txt
  26. +77 −0 examples/record_class_test/record_class_test.rb
  27. +38 −0 examples/record_class_test/record_class_test2.rb
  28. +46 −0 examples/rename_column_test/rename_column_test.rb
  29. +38 −0 examples/rename_table_test/rename_table_test.rb
  30. +47 −0 examples/yaml_field_test/yaml_field_test.rb
  31. BIN images/blank.png
  32. BIN images/callouts/1.png
  33. BIN images/callouts/10.png
  34. BIN images/callouts/11.png
  35. BIN images/callouts/12.png
  36. BIN images/callouts/13.png
  37. BIN images/callouts/14.png
  38. BIN images/callouts/15.png
  39. BIN images/callouts/2.png
  40. BIN images/callouts/3.png
  41. BIN images/callouts/4.png
  42. BIN images/callouts/5.png
  43. BIN images/callouts/6.png
  44. BIN images/callouts/7.png
  45. BIN images/callouts/8.png
  46. BIN images/callouts/9.png
  47. BIN images/caution.png
  48. BIN images/client_server.png
  49. BIN images/example.png
  50. BIN images/home.png
  51. BIN images/important.png
  52. BIN images/kirby1.jpg
  53. BIN images/next.png
  54. BIN images/note.png
  55. BIN images/prev.png
  56. BIN images/single_user.png
  57. BIN images/smallnew.png
  58. BIN images/tip.png
  59. BIN images/toc-blank.png
  60. BIN images/toc-minus.png
  61. BIN images/toc-plus.png
  62. BIN images/up.png
  63. BIN images/warning.png
  64. +8 −0 install.rb
  65. +2,324 −0 kirbybaserubymanual.html
  66. +3,896 −0 lib/kirbybase.rb
  67. +4,004 −0 lib/kirbybase_kb_column_stuff.rb
  68. +17 −0 test/base_test.rb
  69. +80 −0 test/tc_local_db.rb
  70. +803 −0 test/tc_local_table.rb
  71. +4 −0 test/ts_local.rb
67 README
@@ -0,0 +1,67 @@
+= KirbyBase 2.6
+
+A small, plain-text, dbms written in Ruby. It can be used either embedded
+or client/server.
+
+
+== Installation
+
+Unpack the file you downloaded. Execute "ruby install.rb" or simply make
+sure kirbybase.rb is somewhere in your Ruby library path.
+
+
+== Documentation
+
+Documentation is in kirbybaserubymanual.html. Also, RDoc generated
+documentation is in the doc directory.
+
+See the examples directory for examples of how to use KirbyBase.
+
+
+== Manifest
+
+* README - this file
+* install.rb - install script
+* changes.txt - history of changes.
+* kirbybaserubymanual.html - documentation
+* lib/kirbybase.rb - dbms library
+* bin/kbserver.rb - multi-threaded database server script.
+* test directory - unit tests
+* examples directory - many example scripts demonstrating features.
+* images directory - images used in manual.
+
+
+== Author
+
+Written in 2005 by Jamey Cribbs <mailto:jcribbs@twmi.rr.com>
+
+
+== License
+
+KirbyBase is distributed under the same license as Ruby.
+
+Copyright (c) 2005 Jamey Cribbs
+
+
+
+== Warranty
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ IN THE SOFTWARE.
+
+
+== Feedback
+
+Please send any bug reports, suggestions, ideas,
+improvements, to:
+
+jcribbs@netpromi.com
+
+== Home Page
+
+http://www.netpromi.com/kirbybase_ruby.html
@@ -0,0 +1,18 @@
+# Multi-user server script for KirbyBase.
+
+require 'kirbybase'
+require 'drb'
+
+host = ''
+port = 44444
+
+puts 'Initializing database server and indexes...'
+
+# Create an instance of the database.
+db = KirbyBase.new(:server)
+
+DRb.start_service('druby://:44444', db)
+
+puts 'Server ready to receive connections...'
+
+DRb.thread.join
@@ -0,0 +1,144 @@
+2006-06-27:: Version 2.6
+* 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.
+* Added conditional require logic so that KirbyBase will use FasterCVS if
+ it is available. Thanks to James Edward Gray II for this.
+* You can now delay index creation in local mode. Thanks to Nicholas Rahn
+ for this.
+* 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.
+
+2005-12-30:: Version 2.5.2
+* Changed the behavior of KBTable#insert method. If user 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.
+
+2005-12-28:: Version 2.5.1
+* Fixed a bug that had broken encrypted tables.
+* Changed KBTable#pack method so that it raises an error if trying to
+ execute when :connect_type==:client.
+* Fixed a bug where it was possible to insert records missing a required
+ field if using a hash. Thanks to Adam Shelly for this.
+* 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.
+* Fixed a bug that allowed you to have duplicate column names. Thanks to
+ Assaph Mehr for spotting this.
+* Changed the way KBTable#set works with memo/blob fields.
+* Started creating unit tests.
+* Changed the KBTable#clear method to return number of records deleted.
+ Thanks to Assaph Mehr for this enhancement.
+* Moved #build_header_string from KBEngine class to KirbyBase class.
+* Added KirbyBase::VERSION constant.
+
+2005-12-01:: Version 2.5
+* Fixed a subtle bug in KBTable#create_indexes.
+* Added the following new methods to KBTable: add_index, drop_index,
+ rename_column, change_column_type, change_column_default_value, and
+ change_column_required.
+* Added the ability to specify a default column value at table creation
+ time.
+* Added the ability to specify, at table creation time, that a column value
+ is required when inserting or updating records.
+* 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.
+* Added KirbyBase#rename_table method.
+* 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.
+
+2005-11-13:: Version 2.4
+* Added a new column type: :Time. Thanks to George Moschovitis for coding
+ this enhancement.
+* 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.
+* Added the ability to specify, when you initialize a database connection,
+ a base directory where memo/blob fields will be stored.
+* 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.
+* 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.
+* 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.
+* Thouroughly revised the manual. I used the excellent text document
+ formatter, AsciiDoc. Many thanks to Stuart Rackham for developing this
+ great tool.
+* Fixed a bug in KBTable#clear that was causing the recno counter not to
+ be reset. Thanks to basi for this.
+
+2005-10-10:: Version 2.3
+* Added ability to specify lookup fields.
+* Added ability to specify one-to-many links between tables.
+* Added ability to specify calculated fields in tables.
+* Added Memo and Blob field types.
+* Added YAML field type. Many thanks to Logan Capaldo for this idea!
+* Added indexing to speed up queries.
+* Two new methods: #add_table_column and #drop_table_column.
+* Added the ability to designate a table field as the "key" field, for
+ Lookup purposes. This simply makes it easier to define Lookup fields.
+* Added "crosstab" capabilities to KBResultSet.
+
+2005-08-09:: Version 2.2.1
+* Fixed a bug in with_write_lock. Thanks to Zed A. Shaw for this bugfix.
+* Fixed a bug that occurred if @record_class was a nested class. Thanks
+ to Hal Fulton for this bugfix.
+
+2005-05-02:: Version 2.2
+* 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.
+* Changed str_to_date and str_to_datetime to use Date#parse method.
+ Thanks to Emiel van de Laar for this enhancement.
+* Changed #pack method so that it no longer reads the whole file into
+ memory while packing it.
+ Thanks to Hugh Sasse for reporting this bug.
+* Changed code so that special character sequences like &linefeed; can be
+ part of input data and KirbyBase will not interpret it as special
+ characters.
+ Thanks to Hugh Sasse for this bug fix.
+
+2005-04-11:: Version 2.1
+* 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.
+* 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 #insert, #update,
+ #set.
+* Added the ability to encrypt a table so that it is no longer stored as
+ a plain-text file.
+* Added the ability to explicity specify that you want a result set to be
+ sorted in ascending order.
+* Added the ability to import a csv file into an existing table.
+* Added the ability to select a record as if the table were a Hash with
+ it's key being the recno field.
+* Added the ability to update a record as if the table were a Hash with
+ it's key being the recno field.
+
+2005-03-28:: Version 2.0
+* New version with completely new interface. A huge thanks to Hal Fulton
+ for all of his help with this new version.
Oops, something went wrong.

0 comments on commit ee03978

Please sign in to comment.