engorge-ostruct 0.1

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/Rakefile ADDED
@@ -0,0 +1,33 @@
1
+ require "rake/gempackagetask"
2
+
3
+ spec = Gem::Specification.new do |s|
4
+ s.name = "engorge-ostruct"
5
+ s.version = "0.1"
6
+ s.author = "Caius Durling"
7
+ s.email = "dev@caius.name"
8
+ s.homepage = "http://github.com/caius/engorge-ostruct"
9
+ s.platform = Gem::Platform::RUBY
10
+ s.summary = "Extends OpenStruct to add some useful methods"
11
+ s.files = FileList["lib/**/*.rb", "[A-Z]*"].to_a
12
+ s.has_rdoc = true
13
+ end
14
+
15
+ Rake::GemPackageTask.new(spec) do |pkg|
16
+ pkg.need_tar = true
17
+ end
18
+
19
+ begin
20
+ require "spec"
21
+ require "spec/rake/spectask"
22
+
23
+ desc "Run all specs"
24
+ Spec::Rake::SpecTask.new('spec') do |t|
25
+ t.spec_files = FileList['spec/**/*.rb']
26
+ end
27
+ rescue LoadError
28
+ puts <<-EOS
29
+ To use rspec for testing you must install rspec gem:
30
+ [sudo] gem install rspec
31
+ EOS
32
+ exit(0)
33
+ end
data/Readme.md ADDED
@@ -0,0 +1,27 @@
1
+ # Engorge OpenStruct
2
+
3
+ Gem to extend (engorge) OpenStruct with some useful methods. Currently just adds `OpenStruct#to_hash`
4
+
5
+ ### to\_hash
6
+
7
+ Returns the OpenStruct as a Hash object.
8
+
9
+ ## Installation
10
+
11
+ [sudo] gem install engorge-ostruct
12
+
13
+ ## Usage
14
+
15
+ To pull in all additions:
16
+
17
+ require "engorge_ostruct"
18
+
19
+ Or to pull in a specific addition (all are listed here):
20
+
21
+ require "engorge_ostruct/to_hash"
22
+
23
+ ## Engorge? Seriously?
24
+
25
+ Hey, blame the late hour it was written, [Will Jessop][will_j] and the ale he's been consuming. And our twisted sense of humour. And the #nwrug IRC channel.
26
+
27
+ [will_j]: http://willj.net/
@@ -0,0 +1,7 @@
1
+ module OpenStructToHash
2
+ def to_hash
3
+ instance_variable_get("@table")
4
+ end
5
+ end
6
+
7
+ OpenStruct.__send__(:include, OpenStructToHash)
@@ -0,0 +1,4 @@
1
+ # Require everything
2
+ Dir[File.dirname(__FILE__) + '/engorge_ostruct/*.rb'].each do |lib_file|
3
+ require lib_file
4
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: engorge-ostruct
3
+ version: !ruby/object:Gem::Version
4
+ hash: 9
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ version: "0.1"
10
+ platform: ruby
11
+ authors:
12
+ - Caius Durling
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-07-25 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description:
22
+ email: dev@caius.name
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files: []
28
+
29
+ files:
30
+ - lib/engorge_ostruct/to_hash.rb
31
+ - lib/engorge_ostruct.rb
32
+ - Rakefile
33
+ - Readme.md
34
+ has_rdoc: true
35
+ homepage: http://github.com/caius/engorge-ostruct
36
+ licenses: []
37
+
38
+ post_install_message:
39
+ rdoc_options: []
40
+
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ hash: 3
49
+ segments:
50
+ - 0
51
+ version: "0"
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ requirements: []
62
+
63
+ rubyforge_project:
64
+ rubygems_version: 1.3.7
65
+ signing_key:
66
+ specification_version: 3
67
+ summary: Extends OpenStruct to add some useful methods
68
+ test_files: []
69
+