usefuldb 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,10 @@
1
1
  usefuldb gem CHANGELOG
2
2
 
3
+ ## Version 0.0.5
4
+ - Fixed bordercase issue when deleting entries from the database
5
+ - Updated README
6
+ - Added UsefulDB::Version
7
+
3
8
  ## Version 0.0.4
4
9
  - Altered the UsefulDB::GUI.list function's output to mimic Array#to_s as it was not operating correctly on the Mac platform I tested the gem on
5
10
  - Altered the UsefulDB::UsefulUtils.search function's output to mimic Array#to_s as it was not operating correctly on the Mac platform I tested the gem on
data/README CHANGED
@@ -1,13 +1,11 @@
1
- ## Readme
2
-
3
- ### Dependencies
4
- In order to run the rake tests, you may require the following gems to be installed on your system:
5
-
6
- : rake
7
- : rack-test
8
- : test-unit
9
-
1
+ ## Readme - v0.0.5
10
2
 
11
3
  ### Install
4
+ To run the unit tests use the following rake target
12
5
  : rake test
6
+
7
+ If you cloned the repository, or downloaded this gem as an archive, you can install using the following rake target
13
8
  : rake install / sudo rake install
9
+
10
+ This gem is also stored on rubygems.org and can be installed with the following command:
11
+ gem install usefuldb
data/bin/usefuldb CHANGED
@@ -24,7 +24,7 @@ begin
24
24
  optparse = OptionParser.new do |opts|
25
25
 
26
26
  opts.banner = <<-WELCOME
27
- UsefulDB - a simple command and URL database
27
+ UsefulDB - a simple command and URL database (#{UsefulDB::Version})
28
28
 
29
29
  Useage: usefuldb <searchtag1> <searchtag2> .. <searchtagN>
30
30
 
@@ -60,8 +60,8 @@ module UsefulDB
60
60
  def remove(key, opts)
61
61
  if @data.count == 0
62
62
  raise EmptyDB, "You cannot call the remove function on an empty Database!"
63
- elsif @data.count < key || key < 0
64
- raise KeyOutOfBounds, "Key does not exist in the DB"
63
+ elsif @data.count <= key || key < 0
64
+ raise KeyOutOfBounds, "Key is out of bounds and therefore does not exist in the DB"
65
65
  else
66
66
  @data.delete_at(key)
67
67
  end
@@ -0,0 +1,19 @@
1
+ require 'usefuldb'
2
+
3
+ module UsefulDB
4
+
5
+ class Version
6
+ class << self
7
+
8
+ MAJOR = 0 unless defined? MAJOR
9
+ MINOR = 0 unless defined? MINOR
10
+ PATCH = 5 unless defined? PATCH
11
+
12
+ def to_s
13
+ [MAJOR, MINOR, PATCH].compact.join('.')
14
+ end
15
+
16
+ end
17
+ end
18
+
19
+ end
data/lib/usefuldb.rb CHANGED
@@ -2,6 +2,7 @@ require 'usefuldb/settings'
2
2
  require 'usefuldb/utilities'
3
3
  require 'usefuldb/exceptions'
4
4
  require 'usefuldb/gui'
5
+ require 'usefuldb/version'
5
6
  require 'fileutils'
6
7
 
7
8
  module UsefulDB
@@ -36,4 +37,4 @@ module UsefulDB
36
37
  end
37
38
 
38
39
  end
39
- end
40
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usefuldb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: test-unit
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
30
46
  - !ruby/object:Gem::Dependency
31
47
  name: rack-test
32
48
  requirement: !ruby/object:Gem::Requirement
@@ -54,6 +70,7 @@ extra_rdoc_files: []
54
70
  files:
55
71
  - lib/usefuldb/utilities.rb
56
72
  - lib/usefuldb/settings.rb
73
+ - lib/usefuldb/version.rb
57
74
  - lib/usefuldb/gui.rb
58
75
  - lib/usefuldb/exceptions.rb
59
76
  - lib/usefuldb.rb