karottenreibe-ohash 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.markdown +16 -0
- data/LICENSE.txt +22 -0
- data/Manifest.txt +4 -0
- data/README.markdown +60 -0
- data/Rakefile +27 -0
- data/VERSION +1 -0
- data/lib/ohash.rb +20 -0
- data/ohash.gemspec +45 -0
- metadata +62 -0
data/HISTORY.markdown
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
/*---- DON'T PANIC License 1.1 -----------
|
2
|
+
|
3
|
+
Don't panic, this piece of software is
|
4
|
+
free, i.e. you can do with it whatever
|
5
|
+
you like, including, but not limited to:
|
6
|
+
|
7
|
+
* using it
|
8
|
+
* copying it
|
9
|
+
* (re)distributing it
|
10
|
+
* burning/burying/shredding it
|
11
|
+
* eating it
|
12
|
+
* using it to obtain world domination
|
13
|
+
* and ignoring it
|
14
|
+
|
15
|
+
Under the sole condition that you
|
16
|
+
|
17
|
+
* CONSIDER buying the author a strong
|
18
|
+
brownian motion producer, say a nice
|
19
|
+
hot cup of tea, should you ever meet
|
20
|
+
him in person.
|
21
|
+
|
22
|
+
----------------------------------------*/
|
data/Manifest.txt
ADDED
data/README.markdown
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
ohash
|
2
|
+
=====
|
3
|
+
|
4
|
+
* http://github.com/karottenreibe/ohash
|
5
|
+
|
6
|
+
Description
|
7
|
+
-----------
|
8
|
+
|
9
|
+
OpenHash (short: ohash) is a simple, enhanced hash structure with the direct
|
10
|
+
member access of OpenStruct, but without all the restrictions.
|
11
|
+
|
12
|
+
Synopsis
|
13
|
+
--------
|
14
|
+
|
15
|
+
require 'rubygems'
|
16
|
+
require 'ohash'
|
17
|
+
|
18
|
+
o = OpenHash.new({:foo => 12})
|
19
|
+
o.foo #=> 12
|
20
|
+
|
21
|
+
o[:foo] #=> 12
|
22
|
+
|
23
|
+
o.bar = 42
|
24
|
+
o.bar #=> 42
|
25
|
+
|
26
|
+
o.merge!({:goo => 23})
|
27
|
+
o.goo #=> 23
|
28
|
+
|
29
|
+
Installing
|
30
|
+
----------
|
31
|
+
|
32
|
+
* sudo gem install karottenreibe-ohash --source http://gems.github.com
|
33
|
+
* sudo gem install ohash
|
34
|
+
|
35
|
+
License
|
36
|
+
-------
|
37
|
+
|
38
|
+
/*---- DON'T PANIC License 1.1 -----------
|
39
|
+
|
40
|
+
Don't panic, this piece of software is
|
41
|
+
free, i.e. you can do with it whatever
|
42
|
+
you like, including, but not limited to:
|
43
|
+
|
44
|
+
* using it
|
45
|
+
* copying it
|
46
|
+
* (re)distributing it
|
47
|
+
* burning/burying/shredding it
|
48
|
+
* eating it
|
49
|
+
* using it to obtain world domination
|
50
|
+
* and ignoring it
|
51
|
+
|
52
|
+
Under the sole condition that you
|
53
|
+
|
54
|
+
* CONSIDER buying the author a strong
|
55
|
+
brownian motion producer, say a nice
|
56
|
+
hot cup of tea, should you ever meet
|
57
|
+
him in person.
|
58
|
+
|
59
|
+
----------------------------------------*/
|
60
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'jeweler'
|
2
|
+
|
3
|
+
task :release do
|
4
|
+
sh "vim HISTORY.markdown"
|
5
|
+
sh "vim README.markdown"
|
6
|
+
sh "git commit -a -m 'prerelease adjustments'; true"
|
7
|
+
end
|
8
|
+
|
9
|
+
Jeweler::Tasks.new do |gem|
|
10
|
+
gem.name = "ohash"
|
11
|
+
gem.summary = gem.description = "A simple, enhanced hash structure with the direct member access of OpenStruct, but without all the restrictions."
|
12
|
+
gem.email = "karottenreibe@gmail.com"
|
13
|
+
gem.homepage = "http://github.com/karottenreibe/vim-syntax"
|
14
|
+
gem.authors = ["Fabian Streitel"]
|
15
|
+
gem.rubyforge_project = 'ohash'
|
16
|
+
end
|
17
|
+
|
18
|
+
Jeweler::RubyforgeTasks.new
|
19
|
+
|
20
|
+
require 'rake/rdoctask'
|
21
|
+
Rake::RDocTask.new do |rdoc|
|
22
|
+
rdoc.rdoc_dir = 'rdoc'
|
23
|
+
rdoc.title = 'ohash'
|
24
|
+
rdoc.rdoc_files.include(%w{README.markdown LICENSE.txt HISTORY.markdown})
|
25
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
26
|
+
end
|
27
|
+
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.3
|
data/lib/ohash.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Since I personally hate OpenStructs, this is a
|
4
|
+
# Hash with the same features, but it's mergeable etc...
|
5
|
+
#
|
6
|
+
class OpenHash < Hash
|
7
|
+
|
8
|
+
def method_missing meth, *args
|
9
|
+
method = meth.to_s
|
10
|
+
|
11
|
+
if method =~ %r{.+=$}
|
12
|
+
super unless args.length == 1
|
13
|
+
self[method[0...-1].to_sym] = args.first
|
14
|
+
else
|
15
|
+
self[meth]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
data/ohash.gemspec
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{ohash}
|
8
|
+
s.version = "0.0.3"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Fabian Streitel"]
|
12
|
+
s.date = %q{2009-08-05}
|
13
|
+
s.description = %q{A simple, enhanced hash structure with the direct member access of OpenStruct, but without all the restrictions.}
|
14
|
+
s.email = %q{karottenreibe@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.markdown"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
"HISTORY.markdown",
|
21
|
+
"LICENSE.txt",
|
22
|
+
"Manifest.txt",
|
23
|
+
"README.markdown",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/ohash.rb",
|
27
|
+
"ohash.gemspec"
|
28
|
+
]
|
29
|
+
s.homepage = %q{http://github.com/karottenreibe/vim-syntax}
|
30
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
31
|
+
s.require_paths = ["lib"]
|
32
|
+
s.rubyforge_project = %q{ohash}
|
33
|
+
s.rubygems_version = %q{1.3.4}
|
34
|
+
s.summary = %q{A simple, enhanced hash structure with the direct member access of OpenStruct, but without all the restrictions.}
|
35
|
+
|
36
|
+
if s.respond_to? :specification_version then
|
37
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
38
|
+
s.specification_version = 3
|
39
|
+
|
40
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
41
|
+
else
|
42
|
+
end
|
43
|
+
else
|
44
|
+
end
|
45
|
+
end
|
metadata
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: karottenreibe-ohash
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Fabian Streitel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-08-05 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: A simple, enhanced hash structure with the direct member access of OpenStruct, but without all the restrictions.
|
17
|
+
email: karottenreibe@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- LICENSE.txt
|
24
|
+
- README.markdown
|
25
|
+
files:
|
26
|
+
- HISTORY.markdown
|
27
|
+
- LICENSE.txt
|
28
|
+
- Manifest.txt
|
29
|
+
- README.markdown
|
30
|
+
- Rakefile
|
31
|
+
- VERSION
|
32
|
+
- lib/ohash.rb
|
33
|
+
- ohash.gemspec
|
34
|
+
has_rdoc: false
|
35
|
+
homepage: http://github.com/karottenreibe/vim-syntax
|
36
|
+
licenses:
|
37
|
+
post_install_message:
|
38
|
+
rdoc_options:
|
39
|
+
- --charset=UTF-8
|
40
|
+
require_paths:
|
41
|
+
- lib
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: "0"
|
47
|
+
version:
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: "0"
|
53
|
+
version:
|
54
|
+
requirements: []
|
55
|
+
|
56
|
+
rubyforge_project: ohash
|
57
|
+
rubygems_version: 1.3.5
|
58
|
+
signing_key:
|
59
|
+
specification_version: 3
|
60
|
+
summary: A simple, enhanced hash structure with the direct member access of OpenStruct, but without all the restrictions.
|
61
|
+
test_files: []
|
62
|
+
|