swift_db 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -10,3 +10,4 @@ lib/root/leaf.rb
10
10
  lib/root/table.rb
11
11
  lib/root/tree.rb
12
12
  lib/swift_db.rb
13
+ swift_db.gemspec
data/Rakefile CHANGED
@@ -2,7 +2,7 @@
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('swift_db', '0.1.2') do |p|
5
+ Echoe.new('swift_db', '0.1.4') do |p|
6
6
  p.description = "Stores data in a B+tree structure"
7
7
  p.url = "https://github.com/ask4prasath/swift_db"
8
8
  p.author = "Prasath V Ram"
data/lib/root/binary.rb CHANGED
@@ -4,4 +4,5 @@ module Db
4
4
 
5
5
  end
6
6
  end
7
- end
7
+ end
8
+
@@ -29,7 +29,6 @@ module Db
29
29
  end
30
30
 
31
31
  def insert_node_pointer(key_and_node)
32
- puts "-------------#{key_and_node}"
33
32
  @keys_and_node_pointers << key_and_node
34
33
  sort_keys
35
34
  split if @keys_and_node_pointers.size > @max_capacity
@@ -70,11 +69,11 @@ module Db
70
69
  private
71
70
 
72
71
  def sort_keys
73
- @keys_and_node_pointers.sort! {|a,b| a<=>b}
74
- end
72
+ @keys_and_node_pointers.sort!
73
+ end
75
74
 
76
75
  def split
77
- puts "============#{@keys_and_node_pointers}"
76
+ puts "----New Internal Node Created----"
78
77
  split_index=((@keys_and_node_pointers.length / @max_capacity.to_f).ceil)-1
79
78
  splited_values=@keys_and_node_pointers.values_at(0..split_index)
80
79
  @keys_and_node_pointers.slice!(0..split_index)
data/swift_db.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{swift_db}
5
- s.version = "0.1.2"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Prasath V Ram"]
9
- s.date = %q{2010-12-07}
9
+ s.date = %q{2010-12-09}
10
10
  s.description = %q{Stores data in a B+tree structure}
11
11
  s.email = %q{ask4prasath@gmail.com}
12
12
  s.extra_rdoc_files = ["README.rdoc", "lib/a.rb", "lib/common/comparison.rb", "lib/db.rb", "lib/root/binary.rb", "lib/root/internal_node.rb", "lib/root/leaf.rb", "lib/root/table.rb", "lib/root/tree.rb", "lib/swift_db.rb"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swift_db
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Prasath V Ram
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-07 00:00:00 +05:30
18
+ date: 2010-12-09 00:00:00 +05:30
19
19
  default_executable:
20
20
  dependencies: []
21
21