hashy_db 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.9.3
@@ -15,6 +15,12 @@ module HashyDb
15
15
  Digest::SHA256.hexdigest("#{Time.current.utc}#{salt}")[0..6]
16
16
  end
17
17
 
18
+ def delete(collection_name, field)
19
+ find_all(collection_name).each do |row|
20
+ row.delete(field)
21
+ end
22
+ end
23
+
18
24
  def add(collection_name, hash)
19
25
  find_all(collection_name) << hash
20
26
  end
@@ -1,3 +1,3 @@
1
1
  module HashyDb
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.8'
3
3
  end
@@ -36,6 +36,14 @@ describe HashyDb::DataStore do
36
36
  end
37
37
  end
38
38
 
39
+ it 'can delete a field' do
40
+ subject.delete(:some_collection, :field_1)
41
+
42
+ subject.find_all(:some_collection).each do |row|
43
+ row.has_key?(:field_1).should be_false
44
+ end
45
+ end
46
+
39
47
  it 'can write and read data to and from a collection' do
40
48
  data4 = {id: 3, field_1: 'value 3', field_2: 9, shared_between_1_and_2: 'not the same as 1 and 2', :some_array => [1, 7]}
41
49
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hashy_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-04-04 00:00:00.000000000 Z
14
+ date: 2012-05-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -71,6 +71,7 @@ extra_rdoc_files: []
71
71
  files:
72
72
  - .gitignore
73
73
  - .rspec
74
+ - .rvmrc
74
75
  - Gemfile
75
76
  - LICENSE.txt
76
77
  - README.md