keep 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -13,8 +13,7 @@ It makes keeping config information pretty easy.
13
13
  keep.set(:password,'Ellen Page')
14
14
  keep.get(:password)
15
15
 
16
- Just tell Keep where to keep things, then give it a hash of what to keep and
17
- what the value is.
16
+ Just tell Keep where to keep things, then tell it a key and what the value is.
18
17
 
19
18
  Keep currently serializes to YAML (although different backends are likely to
20
19
  come next- pull requests welcome).
@@ -22,7 +21,9 @@ come next- pull requests welcome).
22
21
  ## More
23
22
 
24
23
  keep = Keep.new('config/settings.yml')
25
- keep.present?(:password)
24
+ keep.present?(:password) # => 'Ellen Page'
25
+
26
+ keep.keys # => ['Ellen Page']
26
27
 
27
28
  ## Other important information
28
29
 
data/keep.gemspec CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'keep'
16
- s.version = '0.0.1'
17
- s.date = '2011-02-17'
16
+ s.version = '0.0.2'
17
+ s.date = '2011-02-18'
18
18
  s.rubyforge_project = 'keep'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
data/lib/keep.rb CHANGED
@@ -7,7 +7,7 @@ require 'keep/disk'
7
7
  require 'keep/yaml'
8
8
 
9
9
  class Keep
10
- VERSION = '0.0.1'
10
+ VERSION = '0.0.2'
11
11
 
12
12
  # The path to the configuration file.
13
13
  attr_reader :path
@@ -77,4 +77,11 @@ class Keep
77
77
  @disk.present?(key)
78
78
  end
79
79
 
80
+ # Accesses all of the keys we're keeping.
81
+ #
82
+ # Returns an Array of Objects.
83
+ def keys
84
+ @disk.keys
85
+ end
86
+
80
87
  end
data/lib/keep/disk.rb CHANGED
@@ -62,6 +62,13 @@ class Keep
62
62
  data[key.to_s]
63
63
  end
64
64
 
65
+ # Accesses all of the keys we're keeping.
66
+ #
67
+ # Returns an Array of Objects.
68
+ def keys
69
+ data.keys
70
+ end
71
+
65
72
  # Searches for the key in the in-memory Hash.
66
73
  #
67
74
  # Returns whether or not the key is present.
data/test/test_yaml.rb CHANGED
@@ -32,4 +32,10 @@ class TestKeep < Test::Unit::TestCase
32
32
  assert @yaml.present?('cute')
33
33
  end
34
34
 
35
+ def test_keys
36
+ @yaml.set('cute', 'ellen page')
37
+ @yaml.set('hot', 'elisha cuthbert')
38
+ assert_equal %w(hot cute), @yaml.keys
39
+ end
40
+
35
41
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keep
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Zach Holman
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-17 00:00:00 -08:00
18
+ date: 2011-02-18 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies: []
21
21