gkv 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8fa0cf55a5e4b81a786e90001fb8277cf24e60fa
4
- data.tar.gz: 5bf4cc721d9e9a0f76591a0142eba47606570c8b
3
+ metadata.gz: 3d9d15f38f399a55846936dd316f7c6d62338efe
4
+ data.tar.gz: bf35d222841772c66cafa0e7d02994e3389c229e
5
5
  SHA512:
6
- metadata.gz: ed0fb645dc8b0aef29c2af3dd6387cfa0f231adde9f8976c73274571eb7dc2a2c1a4a7a77a1489a3669afef9ccdabcbd86cc89498a5cbff0d61b85c281f799fd
7
- data.tar.gz: f154d350e524294abe19de33632d643d8c17aa550d04f87cc135626cab293e375eae72e9521d2eda59aa23c460ba4e057d466159c41fa56a7c549855380d65f9
6
+ metadata.gz: 178b8e66c48d775fed1f20b5c17a90dda51d3daf540a9229e43435c77a6441f4774a42e98eda778d57bd5519cccf09c06dc96f918ed731c4fdc7cbc126b264c8
7
+ data.tar.gz: 90aad818884a09d5d142178cca7da4fd0f1cb2b294f07dca3288a4e7ee8284c853829a29bfb27a91f7d554ae90e6aa06cc4bd23474fa4a98a6fae99e03f6b475
data/CHANGLELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v0.2.6
2
+ add `all_versions` method
3
+
1
4
  v0.2.5
2
5
  Revert to stdin piping for object hashing
3
6
 
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # Gkv
2
2
 
3
- ## NOTE: this got unexpectedly popular on Hacker News. If you disagree with or think something could be done better, PLEASE TELL ME. I'm all for making this truly useable for general application and not just a toy.
4
-
5
3
  [![Join the chat at https://gitter.im/ybur-yug/gkv](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ybur-yug/gkv?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6
4
  <a href="https://codeclimate.com/github/ybur-yug/gkv"><img src="https://codeclimate.com/github/ybur-yug/gkv/badges/gpa.svg" /></a>
7
5
  [![Gem Version](https://badge.fury.io/rb/gkv.svg)](http://badge.fury.io/rb/gkv)
@@ -112,6 +110,16 @@ db.all
112
110
  # =>[{ 'apples': 20.0 }, { 'ants': 'pants'}, { 'things': {} }]
113
111
  ```
114
112
 
113
+ all_versions(*key*)
114
+
115
+ ```ruby
116
+ db.set('apples', 5)
117
+ db.set('apples', 'pants')
118
+ db.set('apples', 5.0)
119
+ db.all_versions('apples')
120
+ # => [ 5, 'pants', 5.0]
121
+ ```
122
+
115
123
  ## Usage
116
124
 
117
125
  ```ruby
@@ -144,6 +152,13 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
144
152
  update the version number in `version.rb`, and then run `bundle exec rake release`, which will create
145
153
  a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
146
154
 
155
+ ### Dev Roadmap
156
+ #### 0.3
157
+ - Remote synchronization & Backup []
158
+ - Persistance & Dump Loading [x]
159
+ - Stop wrapping git via it's CLI []
160
+ - (possible) Handle symbol types
161
+
147
162
  ## Contributing
148
163
  Feel free to check out the gitter room and ask whats on the agenda.
149
164
 
data/Rakefile CHANGED
@@ -1,6 +1,18 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'rspec/core/rake_task'
3
3
 
4
+ require 'mutant'
5
+
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
- task :default => :spec
8
+ task :fuzz do
9
+ status = Mutant::CLI.run(%w[--use rspec --require gkv --use rspec Gkv::GitFunctions])
10
+
11
+ if status.nonzero?
12
+ puts 'Mutant task was not successful'
13
+ else
14
+ puts 'Mutant task was successful'
15
+ end
16
+ end
17
+
18
+ task :default => [ :spec, :fuzz ]
@@ -25,6 +25,8 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "bundler", "~> 1.10"
26
26
  spec.add_development_dependency "rake", "~> 10.0"
27
27
  spec.add_development_dependency "rspec"
28
+ spec.add_development_dependency "mutant", "~> 0.8.0"
29
+ spec.add_development_dependency "mutant-rspec", "~> 0.8.0"
28
30
  spec.add_development_dependency "pry"
29
31
  spec.add_development_dependency "debt_ceiling"
30
32
  end
@@ -11,6 +11,14 @@ module Gkv
11
11
  `git init`
12
12
  end
13
13
 
14
+ def save
15
+ Gkv::GitFunctions.hash_object(YAML.dump($ITEMS))
16
+ end
17
+
18
+ def load(hash)
19
+ $ITEMS = YAML.load(Gkv::GitFunctions.cat_file(hash))
20
+ end
21
+
14
22
  def set(key, value)
15
23
  update_items(key, YAML.dump(value))
16
24
  key
@@ -36,6 +44,10 @@ module Gkv
36
44
  YAML.load(Gkv::GitFunctions.cat_file($ITEMS[key][version.to_i - 1]))
37
45
  end
38
46
 
47
+ def all_versions(key)
48
+ $ITEMS[key].map { |hash| YAML.load(Gkv::GitFunctions.cat_file(hash)) }
49
+ end
50
+
39
51
  def all
40
52
  $ITEMS.keys.map { |key|
41
53
  hash = $ITEMS[key].last
@@ -1,3 +1,3 @@
1
1
  module Gkv
2
- VERSION = '0.2.5'
2
+ VERSION = '0.2.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gkv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - '='
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-26 00:00:00.000000000 Z
11
+ date: 2015-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: mutant
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.8.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.8.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: mutant-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.8.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.8.0
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: pry
57
85
  requirement: !ruby/object:Gem::Requirement