darkholme 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/VERSION +1 -1
- data/darkholme.gemspec +3 -4
- data/lib/darkholme/bitset.rb +1 -1
- data/spec/lib/darkholme/bitset_spec.rb +14 -2
- metadata +2 -3
- data/Gemfile.lock +0 -117
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c751fbf69610015dd67ae875b1a9789807097c7
|
4
|
+
data.tar.gz: 91a81a41c8a3006bb1750f1526982e20fb4e9c7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 124c8caebe4951c8ad489f424cccbef53e18008fe6679262488826d7e1a880dbef78605e03e07bdad2972b66c0749fc9bb3df2035d37bdbb534dea2eca88f9ef
|
7
|
+
data.tar.gz: 5b979b35e389d4314e0ea6539b8f132dc8ab8083efcbf4965c956169c5a595f8cf1d086a4f50bbd51a392cb1196e1cb57e4deed85fb91eea1b8eeb7c29c33675
|
data/README.md
CHANGED
@@ -7,6 +7,16 @@
|
|
7
7
|
Darkholme is an [entity-component system](http://en.wikipedia.org/wiki/Entity_component_system)
|
8
8
|
written in Ruby. It's still early days for it, but I think it's ready for most basic use cases.
|
9
9
|
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Just add this line to your project's Gemfile
|
13
|
+
|
14
|
+
```
|
15
|
+
gem "darkholme"
|
16
|
+
```
|
17
|
+
|
18
|
+
Then, just `require "darkholme"` in your project and you're on your way!
|
19
|
+
|
10
20
|
## Usage
|
11
21
|
|
12
22
|
First, you need to create an **Engine** to hold all the other parts of Darkholme.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/darkholme.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: darkholme 1.0.
|
5
|
+
# stub: darkholme 1.0.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "darkholme"
|
9
|
-
s.version = "1.0.
|
9
|
+
s.version = "1.0.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.authors = ["Massive Danger"]
|
13
|
-
s.date = "2014-02-
|
13
|
+
s.date = "2014-02-26"
|
14
14
|
s.description = "An entity-component system in Ruby"
|
15
15
|
s.email = "evan@massivedanger.com"
|
16
16
|
s.extra_rdoc_files = [
|
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
|
|
22
22
|
".rspec",
|
23
23
|
".travis.yml",
|
24
24
|
"Gemfile",
|
25
|
-
"Gemfile.lock",
|
26
25
|
"Guardfile",
|
27
26
|
"LICENSE.txt",
|
28
27
|
"README.md",
|
data/lib/darkholme/bitset.rb
CHANGED
@@ -63,7 +63,7 @@ module Darkholme
|
|
63
63
|
#
|
64
64
|
# @return [Boolean] Whether or not all bits are flipped in both
|
65
65
|
def include?(other)
|
66
|
-
set_indexes & other.set_indexes == other.set_indexes
|
66
|
+
set_indexes.sort & other.set_indexes.sort == other.set_indexes.sort
|
67
67
|
end
|
68
68
|
|
69
69
|
# Perform a bitwise AND
|
@@ -29,12 +29,12 @@ module Darkholme
|
|
29
29
|
it "can clear bits" do
|
30
30
|
subject.set(bit)
|
31
31
|
expect(subject.set?(bit)).to eq(true)
|
32
|
-
|
32
|
+
|
33
33
|
expect {
|
34
34
|
subject.clear(bit)
|
35
35
|
}.to change { subject.bits }
|
36
36
|
|
37
|
-
expect(subject.set?(bit)).to eq(false)
|
37
|
+
expect(subject.set?(bit)).to eq(false)
|
38
38
|
end
|
39
39
|
|
40
40
|
it "removes the set index during a clear" do
|
@@ -75,5 +75,17 @@ module Darkholme
|
|
75
75
|
|
76
76
|
expect(subject.include? other).to eq(true)
|
77
77
|
end
|
78
|
+
|
79
|
+
it "can check for inclusion even if the orders are different" do
|
80
|
+
subject.set(10)
|
81
|
+
subject.set(7)
|
82
|
+
subject.set(4)
|
83
|
+
|
84
|
+
other = Bitset.new
|
85
|
+
other.set(4)
|
86
|
+
other.set(10)
|
87
|
+
|
88
|
+
expect(subject.include? other).to eq(true)
|
89
|
+
end
|
78
90
|
end
|
79
91
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: darkholme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Massive Danger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -148,7 +148,6 @@ files:
|
|
148
148
|
- .rspec
|
149
149
|
- .travis.yml
|
150
150
|
- Gemfile
|
151
|
-
- Gemfile.lock
|
152
151
|
- Guardfile
|
153
152
|
- LICENSE.txt
|
154
153
|
- README.md
|
data/Gemfile.lock
DELETED
@@ -1,117 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
addressable (2.3.5)
|
5
|
-
builder (3.2.2)
|
6
|
-
celluloid (0.15.2)
|
7
|
-
timers (~> 1.1.0)
|
8
|
-
coderay (1.1.0)
|
9
|
-
descendants_tracker (0.0.3)
|
10
|
-
diff-lcs (1.2.5)
|
11
|
-
docile (1.1.3)
|
12
|
-
faraday (0.9.0)
|
13
|
-
multipart-post (>= 1.2, < 3)
|
14
|
-
ffi (1.9.3)
|
15
|
-
formatador (0.2.4)
|
16
|
-
git (1.2.6)
|
17
|
-
github_api (0.11.2)
|
18
|
-
addressable (~> 2.3)
|
19
|
-
descendants_tracker (~> 0.0.1)
|
20
|
-
faraday (~> 0.8, < 0.10)
|
21
|
-
hashie (>= 1.2)
|
22
|
-
multi_json (>= 1.7.5, < 2.0)
|
23
|
-
nokogiri (~> 1.6.0)
|
24
|
-
oauth2
|
25
|
-
guard (2.4.0)
|
26
|
-
formatador (>= 0.2.4)
|
27
|
-
listen (~> 2.1)
|
28
|
-
lumberjack (~> 1.0)
|
29
|
-
pry (>= 0.9.12)
|
30
|
-
thor (>= 0.18.1)
|
31
|
-
guard-rspec (4.2.6)
|
32
|
-
guard (~> 2.1)
|
33
|
-
rspec (>= 2.14, < 4.0)
|
34
|
-
hashie (2.0.5)
|
35
|
-
highline (1.6.20)
|
36
|
-
inch (0.2.3)
|
37
|
-
sparkr (>= 0.2.0)
|
38
|
-
term-ansicolor
|
39
|
-
yard (~> 0.8.7)
|
40
|
-
jeweler (2.0.1)
|
41
|
-
builder
|
42
|
-
bundler (>= 1.0)
|
43
|
-
git (>= 1.2.5)
|
44
|
-
github_api
|
45
|
-
highline (>= 1.6.15)
|
46
|
-
nokogiri (>= 1.5.10)
|
47
|
-
rake
|
48
|
-
rdoc
|
49
|
-
json (1.8.1)
|
50
|
-
jwt (0.1.11)
|
51
|
-
multi_json (>= 1.5)
|
52
|
-
listen (2.4.1)
|
53
|
-
celluloid (>= 0.15.2)
|
54
|
-
rb-fsevent (>= 0.9.3)
|
55
|
-
rb-inotify (>= 0.9)
|
56
|
-
lumberjack (1.0.4)
|
57
|
-
method_source (0.8.2)
|
58
|
-
mini_portile (0.5.2)
|
59
|
-
multi_json (1.8.4)
|
60
|
-
multi_xml (0.5.5)
|
61
|
-
multipart-post (2.0.0)
|
62
|
-
nokogiri (1.6.1)
|
63
|
-
mini_portile (~> 0.5.0)
|
64
|
-
oauth2 (0.9.3)
|
65
|
-
faraday (>= 0.8, < 0.10)
|
66
|
-
jwt (~> 0.1.8)
|
67
|
-
multi_json (~> 1.3)
|
68
|
-
multi_xml (~> 0.5)
|
69
|
-
rack (~> 1.2)
|
70
|
-
pry (0.9.12.6)
|
71
|
-
coderay (~> 1.0)
|
72
|
-
method_source (~> 0.8)
|
73
|
-
slop (~> 3.4)
|
74
|
-
rack (1.5.2)
|
75
|
-
rake (10.1.1)
|
76
|
-
rb-fsevent (0.9.4)
|
77
|
-
rb-inotify (0.9.3)
|
78
|
-
ffi (>= 0.5.0)
|
79
|
-
rdoc (3.12.2)
|
80
|
-
json (~> 1.4)
|
81
|
-
rspec (3.0.0.beta1)
|
82
|
-
rspec-core (= 3.0.0.beta1)
|
83
|
-
rspec-expectations (= 3.0.0.beta1)
|
84
|
-
rspec-mocks (= 3.0.0.beta1)
|
85
|
-
rspec-core (3.0.0.beta1)
|
86
|
-
rspec-expectations (3.0.0.beta1)
|
87
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
88
|
-
rspec-support (= 3.0.0.beta1)
|
89
|
-
rspec-mocks (3.0.0.beta1)
|
90
|
-
rspec-support (3.0.0.beta1)
|
91
|
-
simplecov (0.8.2)
|
92
|
-
docile (~> 1.1.0)
|
93
|
-
multi_json
|
94
|
-
simplecov-html (~> 0.8.0)
|
95
|
-
simplecov-html (0.8.0)
|
96
|
-
slop (3.4.7)
|
97
|
-
sparkr (0.4.1)
|
98
|
-
term-ansicolor (1.3.0)
|
99
|
-
tins (~> 1.0)
|
100
|
-
thor (0.18.1)
|
101
|
-
timers (1.1.0)
|
102
|
-
tins (1.0.0)
|
103
|
-
yard (0.8.7.3)
|
104
|
-
|
105
|
-
PLATFORMS
|
106
|
-
ruby
|
107
|
-
|
108
|
-
DEPENDENCIES
|
109
|
-
bundler (~> 1.0)
|
110
|
-
guard-rspec (~> 4.2.6)
|
111
|
-
inch (~> 0.2.3)
|
112
|
-
jeweler (~> 2.0.1)
|
113
|
-
pry (~> 0.9.12.6)
|
114
|
-
rdoc (~> 3.12)
|
115
|
-
rspec (~> 3.0.0.beta1)
|
116
|
-
simplecov
|
117
|
-
yard (~> 0.7)
|