beezwax 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
+ Beezwax is a Ruby API used to access Btrieve databases through the BTR protocol.
1
2
  Copyright (c) 2010 Patrick Lardin
2
3
 
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
10
 
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
11
+ The above copyright notice and this permission notice shall be included in
12
+ all copies or substantial portions of the Software.
13
13
 
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
data/README ADDED
File without changes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.5.1
data/beezwax.gemspec ADDED
@@ -0,0 +1,70 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{beezwax}
8
+ s.version = "0.5.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Patrick Lardin"]
12
+ s.date = %q{2010-10-05}
13
+ s.description = %q{Access BTR db files through a ruby API.}
14
+ s.email = %q{plardin@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README",
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ "LICENSE",
22
+ "README",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "beezwax.gemspec",
27
+ "lib/beezwax.rb",
28
+ "lib/btrieve/btrieve_const.rb",
29
+ "lib/btrieve/btrieve_core.rb",
30
+ "lib/btrieve/btrieve_model.rb",
31
+ "lib/btrieve/btrieve_record.rb",
32
+ "lib/btrieve/btrieve_schema.rb",
33
+ "lib/btrieve/btrieve_session.rb",
34
+ "lib/btrieve/btrieve_table.rb",
35
+ "pkg/beezwax-0.0.0.gem",
36
+ "pkg/beezwax-0.1.0.gem",
37
+ "pkg/beezwax-0.1.1.gem",
38
+ "pkg/beezwax-0.1.2.gem",
39
+ "pkg/beezwax-0.1.3.gem",
40
+ "pkg/beezwax-0.1.4.gem",
41
+ "pkg/beezwax-0.2.0.gem",
42
+ "pkg/beezwax-0.3.0.gem",
43
+ "pkg/beezwax-0.4.0.gem",
44
+ "test/helper.rb",
45
+ "test/test_beezwax.rb"
46
+ ]
47
+ s.homepage = %q{http://github.com/plardin/beezwax}
48
+ s.rdoc_options = ["--charset=UTF-8"]
49
+ s.require_paths = ["lib"]
50
+ s.rubygems_version = %q{1.3.7}
51
+ s.summary = %q{BTRAPI wrapper.}
52
+ s.test_files = [
53
+ "test/test_beezwax.rb",
54
+ "test/helper.rb"
55
+ ]
56
+
57
+ if s.respond_to? :specification_version then
58
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
59
+ s.specification_version = 3
60
+
61
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
62
+ s.add_development_dependency(%q<ffi>, [">= 0.6.3"])
63
+ else
64
+ s.add_dependency(%q<ffi>, [">= 0.6.3"])
65
+ end
66
+ else
67
+ s.add_dependency(%q<ffi>, [">= 0.6.3"])
68
+ end
69
+ end
70
+
@@ -73,6 +73,31 @@ class BtrieveTable
73
73
  end
74
74
  end
75
75
 
76
+ def find_in_range(index_num, key, range)
77
+ result_set = []
78
+ index = @schema[:indices][index_num]
79
+ columns = @schema[:columns]
80
+ index_values = index.inject([]){|vals,akey|vals << (akey == key ? range.first : nil); vals}
81
+ key_packer = index.inject("") do |packer, akey|
82
+ value_packer = BtrieveSchema.lookup(columns[akey][:datatype], columns[akey][:size])[:unpacker]
83
+ nil_packer = 'x'*columns[key][:size]
84
+ packer << (akey == key ? value_packer : nil_packer)
85
+ packer
86
+ end
87
+ key_buffer = index_values.pack(key_packer)
88
+
89
+ btr_record = BtrieveRecord.new(self)
90
+ batch do
91
+ btr_op(@session, GET_GREATER_THAN_OR_EQUAL, @pos_buffer, btr_record.data_buffer, key_buffer, index_num, [OK, EOF])
92
+ while(range.include?(btr_record[key]))
93
+ result_set << btr_record
94
+ btr_record = BtrieveRecord.new(self)
95
+ btr_op(@session, GET_NEXT, @pos_buffer, btr_record.data_buffer, key_buffer, index_num, [OK, EOF])
96
+ end
97
+ end
98
+ result_set
99
+ end
100
+
76
101
  def close
77
102
  btr_op(@session, CLOSE, @pos_buffer, NULL_BUFFER, NULL_BUFFER, NULL_KEY)
78
103
  end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beezwax
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 4
9
- - 0
10
- version: 0.4.0
8
+ - 5
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Patrick Lardin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-03 00:00:00 -07:00
18
+ date: 2010-10-05 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -42,14 +42,15 @@ extensions: []
42
42
 
43
43
  extra_rdoc_files:
44
44
  - LICENSE
45
+ - README
45
46
  - README.rdoc
46
47
  files:
47
- - .document
48
- - .gitignore
49
48
  - LICENSE
49
+ - README
50
50
  - README.rdoc
51
51
  - Rakefile
52
52
  - VERSION
53
+ - beezwax.gemspec
53
54
  - lib/beezwax.rb
54
55
  - lib/btrieve/btrieve_const.rb
55
56
  - lib/btrieve/btrieve_core.rb
@@ -58,6 +59,15 @@ files:
58
59
  - lib/btrieve/btrieve_schema.rb
59
60
  - lib/btrieve/btrieve_session.rb
60
61
  - lib/btrieve/btrieve_table.rb
62
+ - pkg/beezwax-0.0.0.gem
63
+ - pkg/beezwax-0.1.0.gem
64
+ - pkg/beezwax-0.1.1.gem
65
+ - pkg/beezwax-0.1.2.gem
66
+ - pkg/beezwax-0.1.3.gem
67
+ - pkg/beezwax-0.1.4.gem
68
+ - pkg/beezwax-0.2.0.gem
69
+ - pkg/beezwax-0.3.0.gem
70
+ - pkg/beezwax-0.4.0.gem
61
71
  - test/helper.rb
62
72
  - test/test_beezwax.rb
63
73
  has_rdoc: true
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC