kelredd-useful 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -11,6 +11,11 @@ the pieces you are interested in.
11
11
  == Installation
12
12
 
13
13
  sudo gem install kelredd-useful --source http://gems.github.com
14
+
15
+ == Dependencies
16
+
17
+ json - http://json.rubyforge.org/ - for hash to/from json
18
+
14
19
 
15
20
  == Usage
16
21
 
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ spec = Gem::Specification.new do |s|
19
19
  s.files = %w(README.rdoc Rakefile) + Dir.glob("{lib,test}/**/*")
20
20
  # s.executables = ['useful']
21
21
 
22
- # s.add_dependency('gem_name', '~> 0.0.1')
22
+ s.add_dependency('json')
23
23
  end
24
24
 
25
25
  Rake::GemPackageTask.new(spec) do |pkg|
@@ -1,3 +1,5 @@
1
+ require 'json' unless defined?(JSON) && defined?(JSON::parse)
2
+
1
3
  module Useful
2
4
  module RubyExtensions
3
5
  module Hash
@@ -19,6 +21,10 @@ module Useful
19
21
  hash
20
22
  end
21
23
 
24
+ def from_json(string)
25
+ JSON.parse(string)
26
+ end
27
+
22
28
  end
23
29
 
24
30
  # Return a new hash with only keys in *keys
@@ -38,7 +44,7 @@ module Useful
38
44
  def except!(*keys)
39
45
  self.class.except(self, keys)
40
46
  end
41
-
47
+
42
48
  # Determines if a value exists for the provided key(s). Allows searching in nested hashes
43
49
  def check_value?(*keys)
44
50
  val = self[keys.first] || self[keys.first.to_s]
@@ -3,7 +3,7 @@ module Useful
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- TINY = 19
6
+ TINY = 20
7
7
 
8
8
  def self.to_s # :nodoc:
9
9
  [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kelredd-useful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.19
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelredd
@@ -9,10 +9,19 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-13 00:00:00 -07:00
12
+ date: 2009-07-17 00:00:00 -07:00
13
13
  default_executable:
14
- dependencies: []
15
-
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: json
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
16
25
  description:
17
26
  email: ""
18
27
  executables: []