gkv 0.2.3 → 0.2.5

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: 174cf3ce2358008f146a194a0ce22e77e81b2064
4
- data.tar.gz: b0ed3ba9d4acf07f219846638ebb00a68b76383c
3
+ metadata.gz: 8fa0cf55a5e4b81a786e90001fb8277cf24e60fa
4
+ data.tar.gz: 5bf4cc721d9e9a0f76591a0142eba47606570c8b
5
5
  SHA512:
6
- metadata.gz: ea0d241aceabdb4e8ce126cddcb833827476c55bf5740d68ac8557d7f946988a8b6220a9f6d1939b51392b26ba189da5d6659df621cfd1643e6ac4d9d9434f81
7
- data.tar.gz: ea7a7dae9e4aa1891d57eaaf2937ed37b8f2e81c6eff96b86ccab08ebed7dd7928e410baf6d5fc3f7100aa2dc0467af415c29946018c6757d9200bac76ce0299
6
+ metadata.gz: ed0fb645dc8b0aef29c2af3dd6387cfa0f231adde9f8976c73274571eb7dc2a2c1a4a7a77a1489a3669afef9ccdabcbd86cc89498a5cbff0d61b85c281f799fd
7
+ data.tar.gz: f154d350e524294abe19de33632d643d8c17aa550d04f87cc135626cab293e375eae72e9521d2eda59aa23c460ba4e057d466159c41fa56a7c549855380d65f9
@@ -0,0 +1,5 @@
1
+ DebtCeiling.configure do |c|
2
+ c.whitelist = %w(bin lib bench example)
3
+ c.max_debt_per_module = 30
4
+ c.debt_ceiling = 75
5
+ end
data/CHANGLELOG CHANGED
@@ -1,4 +1,13 @@
1
- v2.2.x
1
+ v0.2.5
2
+ Revert to stdin piping for object hashing
3
+
4
+ v0.2.4
5
+ Switch `all` method to use hashrocket syntax for pre-Ruby 2.2.x compatibility
6
+
7
+ v0.2.3
8
+ Add operator overloading for set/get sytax
9
+
10
+ v0.2.2
2
11
  Full type system. All bugs related to hashes from 0.2.0 and 0.2.1 fixed.
3
12
 
4
13
  v0.1.x
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # Gkv
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
+
2
5
  [![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)
3
6
  <a href="https://codeclimate.com/github/ybur-yug/gkv"><img src="https://codeclimate.com/github/ybur-yug/gkv/badges/gpa.svg" /></a>
4
7
  [![Gem Version](https://badge.fury.io/rb/gkv.svg)](http://badge.fury.io/rb/gkv)
@@ -9,8 +12,6 @@ Gkv is a simple git wrapper that allows you to use it as a kv store
9
12
 
10
13
  ![proof in our pudding](http://i.imgur.com/EKdt7oR.png)
11
14
 
12
- [![asciicast](https://asciinema.org/a/a157ouz4ju5cy9v5r3pexhj4k.png)](https://asciinema.org/a/a157ouz4ju5cy9v5r3pexhj4k)
13
-
14
15
  The documentation says thats what it does. So why not yo?
15
16
 
16
17
  #### This is the product of a [tutorial](https://github.com/ybur-yug/git_kv_store_tutorial) I wrote to explore git.
@@ -0,0 +1,5 @@
1
+ # A sample Gemfile
2
+ source "https://rubygems.org"
3
+
4
+ gem 'sinatra'
5
+ gem 'gkv'
@@ -26,4 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "rake", "~> 10.0"
27
27
  spec.add_development_dependency "rspec"
28
28
  spec.add_development_dependency "pry"
29
+ spec.add_development_dependency "debt_ceiling"
29
30
  end
@@ -40,7 +40,7 @@ module Gkv
40
40
  $ITEMS.keys.map { |key|
41
41
  hash = $ITEMS[key].last
42
42
  value = YAML.load(Gkv::GitFunctions.cat_file(hash))
43
- { "#{key}": value }
43
+ { "#{key}" => value }
44
44
  }
45
45
  end
46
46
  end
@@ -3,16 +3,7 @@ module Gkv
3
3
  extend self
4
4
 
5
5
  def hash_object(data)
6
- write_tmpfile(data)
7
- hash = `git hash-object -w tmp.txt`.strip!
8
- File.delete('tmp.txt')
9
- hash
10
- end
11
-
12
- def write_tmpfile(data)
13
- f = File.open('tmp.txt', 'w+')
14
- f.write(data)
15
- f.close
6
+ `echo "#{data}" | git hash-object -w --stdin`.strip!
16
7
  end
17
8
 
18
9
  def cat_file(hash)
@@ -1,3 +1,3 @@
1
1
  module Gkv
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gkv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - '='
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: debt_ceiling
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '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'
69
83
  description: Utilize a git repository as a trivially simple kv store.
70
84
  email:
71
85
  - '='
@@ -74,6 +88,7 @@ executables:
74
88
  extensions: []
75
89
  extra_rdoc_files: []
76
90
  files:
91
+ - ".debt_ceiling.rb"
77
92
  - ".gitignore"
78
93
  - ".rspec"
79
94
  - ".travis.yml"
@@ -87,6 +102,7 @@ files:
87
102
  - bin/console
88
103
  - bin/gkv
89
104
  - bin/setup
105
+ - example/Gemfile
90
106
  - example/README.md
91
107
  - example/server.rb
92
108
  - gkv.gemspec