hstruct 0.1.0 → 0.2.0
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/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/hstruct.gemspec +3 -3
- data/lib/hstruct.rb +1 -1
- data/spec/lib/hstruct_spec.rb +2 -4
- metadata +5 -4
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
Struct with the convenience of instantiating from a Hash.
|
2
2
|
|
3
3
|
When you care about speed, this is the Ruby structure that you've been
|
4
4
|
looking for. HStructs are faster than any other gem out there, but still
|
data/hstruct.gemspec
CHANGED
@@ -4,11 +4,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "hstruct"
|
7
|
-
spec.version = "0.
|
7
|
+
spec.version = "0.2.0"
|
8
8
|
spec.authors = ["Gerhard Lazu"]
|
9
9
|
spec.email = ["gerhard@lazu.co.uk"]
|
10
|
-
spec.description = %q{
|
11
|
-
spec.summary = %q{When you care about speed, this is
|
10
|
+
spec.description = %q{Struct with the convenience of instantiating from a Hash}
|
11
|
+
spec.summary = %q{When you care about speed and convenience, this is what you've been looking for}
|
12
12
|
spec.homepage = "https://github.com/cambridge-healthcare/hstruct"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
data/lib/hstruct.rb
CHANGED
data/spec/lib/hstruct_spec.rb
CHANGED
@@ -2,11 +2,9 @@ require_relative '../spec_helper'
|
|
2
2
|
|
3
3
|
require 'hstruct'
|
4
4
|
|
5
|
-
Person = HStruct.new(:first_name, :last_name)
|
5
|
+
Person = HStruct.new(:first_name, :last_name, :dob)
|
6
6
|
|
7
7
|
describe HStruct do
|
8
|
-
let(:person) { }
|
9
|
-
|
10
8
|
it "is a Struct" do
|
11
9
|
Person.ancestors.should include Struct
|
12
10
|
end
|
@@ -17,7 +15,7 @@ describe HStruct do
|
|
17
15
|
person.last_name.should be_nil
|
18
16
|
end
|
19
17
|
|
20
|
-
it "
|
18
|
+
it "when converting back to a hash, leaves empty values out" do
|
21
19
|
person = Person.new(:first_name => "Jimmy")
|
22
20
|
person.last_name = "Kiel"
|
23
21
|
person.to_hash.should eql Hash[:first_name => "Jimmy", :last_name => "Kiel"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hstruct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -107,7 +107,7 @@ dependencies:
|
|
107
107
|
- - ! '>='
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
|
-
description:
|
110
|
+
description: Struct with the convenience of instantiating from a Hash
|
111
111
|
email:
|
112
112
|
- gerhard@lazu.co.uk
|
113
113
|
executables: []
|
@@ -116,6 +116,7 @@ extra_rdoc_files: []
|
|
116
116
|
files:
|
117
117
|
- .gitignore
|
118
118
|
- .rspec
|
119
|
+
- CHANGELOG.md
|
119
120
|
- Gemfile
|
120
121
|
- Guardfile
|
121
122
|
- LICENSE.txt
|
@@ -150,8 +151,8 @@ rubyforge_project:
|
|
150
151
|
rubygems_version: 1.8.23
|
151
152
|
signing_key:
|
152
153
|
specification_version: 3
|
153
|
-
summary: When you care about speed, this is
|
154
|
-
for
|
154
|
+
summary: When you care about speed and convenience, this is what you've been looking
|
155
|
+
for
|
155
156
|
test_files:
|
156
157
|
- spec/lib/hstruct_spec.rb
|
157
158
|
- spec/spec_helper.rb
|