hash-save 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +4 -0
- data/README +0 -0
- data/Rakefile +11 -0
- data/hash-save.gemspec +30 -0
- data/lib/hash.rb +21 -0
- metadata +75 -0
data/Manifest
ADDED
data/README
ADDED
File without changes
|
data/Rakefile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'echoe'
|
3
|
+
|
4
|
+
Echoe.new( 'hash-save', '0.0.1' ) do |p|
|
5
|
+
p.description = "Save your hashes to a file."
|
6
|
+
p.url = "http://github.com/thirdreplicator/hash-save"
|
7
|
+
p.author = "David Beckwith"
|
8
|
+
p.email = "thirdreplicator@gmail.com"
|
9
|
+
p.ignore_pattern = ["tmp/*", "script/*"]
|
10
|
+
p.development_dependencies = []
|
11
|
+
end
|
data/hash-save.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{hash-save}
|
5
|
+
s.version = "0.0.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["David Beckwith"]
|
9
|
+
s.date = %q{2011-02-19}
|
10
|
+
s.description = %q{Save your hashes to a file.}
|
11
|
+
s.email = %q{thirdreplicator@gmail.com}
|
12
|
+
s.extra_rdoc_files = ["README", "lib/hash.rb"]
|
13
|
+
s.files = ["README", "Rakefile", "lib/hash.rb", "Manifest", "hash-save.gemspec"]
|
14
|
+
s.homepage = %q{http://github.com/thirdreplicator/hash-save}
|
15
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Hash-save", "--main", "README"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubyforge_project = %q{hash-save}
|
18
|
+
s.rubygems_version = %q{1.3.7}
|
19
|
+
s.summary = %q{Save your hashes to a file.}
|
20
|
+
|
21
|
+
if s.respond_to? :specification_version then
|
22
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
23
|
+
s.specification_version = 3
|
24
|
+
|
25
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
+
else
|
27
|
+
end
|
28
|
+
else
|
29
|
+
end
|
30
|
+
end
|
data/lib/hash.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
class Hash
|
2
|
+
BASE_DIR = './data'
|
3
|
+
|
4
|
+
def save
|
5
|
+
self.each do |k,v|
|
6
|
+
File.open("#{BASE_DIR}/#{k}", 'wb') do |f|
|
7
|
+
Marshal.dump(v, f)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
rescue Errno::ENOENT
|
11
|
+
Dir.mkdir(BASE_DIR)
|
12
|
+
retry if Dir.exists(BASE_DIR)
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.find(k)
|
16
|
+
File.open("#{BASE_DIR}/#{k}", 'rb') do |f|
|
17
|
+
Marshal.load(f)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hash-save
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- David Beckwith
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-02-19 00:00:00 -08:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: Save your hashes to a file.
|
22
|
+
email: thirdreplicator@gmail.com
|
23
|
+
executables: []
|
24
|
+
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files:
|
28
|
+
- README
|
29
|
+
- lib/hash.rb
|
30
|
+
files:
|
31
|
+
- README
|
32
|
+
- Rakefile
|
33
|
+
- lib/hash.rb
|
34
|
+
- Manifest
|
35
|
+
- hash-save.gemspec
|
36
|
+
has_rdoc: true
|
37
|
+
homepage: http://github.com/thirdreplicator/hash-save
|
38
|
+
licenses: []
|
39
|
+
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options:
|
42
|
+
- --line-numbers
|
43
|
+
- --inline-source
|
44
|
+
- --title
|
45
|
+
- Hash-save
|
46
|
+
- --main
|
47
|
+
- README
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
version: "0"
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
segments:
|
64
|
+
- 1
|
65
|
+
- 2
|
66
|
+
version: "1.2"
|
67
|
+
requirements: []
|
68
|
+
|
69
|
+
rubyforge_project: hash-save
|
70
|
+
rubygems_version: 1.3.7
|
71
|
+
signing_key:
|
72
|
+
specification_version: 3
|
73
|
+
summary: Save your hashes to a file.
|
74
|
+
test_files: []
|
75
|
+
|