union 1.0.1 → 1.0.2
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/CHANGES +4 -0
- data/Rakefile +27 -0
- data/lib/union.rb +2 -2
- data/test/test_union.rb +1 -1
- data/union.gemspec +23 -0
- metadata +7 -5
data/CHANGES
CHANGED
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/testtask'
|
3
|
+
require 'rbconfig'
|
4
|
+
include Config
|
5
|
+
|
6
|
+
desc 'Install the union library (non-gem)'
|
7
|
+
task :install do
|
8
|
+
sitelibdir = CONFIG["sitelibdir"]
|
9
|
+
file = "lib/union.rb"
|
10
|
+
FileUtils.cp(file, sitelibdir, :verbose => true)
|
11
|
+
end
|
12
|
+
|
13
|
+
desc 'Build the union gem'
|
14
|
+
task :gem do
|
15
|
+
spec = eval(IO.read('union.gemspec'))
|
16
|
+
Gem::Builder.new(spec).build
|
17
|
+
end
|
18
|
+
|
19
|
+
task :install_gem => [:gem] do
|
20
|
+
file = Dir["*.gem"].first
|
21
|
+
sh "gem install #{file}"
|
22
|
+
end
|
23
|
+
|
24
|
+
Rake::TestTask.new do |t|
|
25
|
+
t.verbose = true
|
26
|
+
t.warning = true
|
27
|
+
end
|
data/lib/union.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# a Union object can be set to a non-nil value at a time.
|
3
3
|
#
|
4
4
|
class Union < Struct
|
5
|
-
# The version of
|
6
|
-
VERSION = '1.0.
|
5
|
+
# The version of the union library
|
6
|
+
VERSION = '1.0.2'
|
7
7
|
|
8
8
|
# Creates and returns a new Union. Unlike Struct::Class.new, this does not
|
9
9
|
# take any arguments. You must assign attributes individually.
|
data/test/test_union.rb
CHANGED
data/union.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = 'union'
|
5
|
+
gem.version = '1.0.2'
|
6
|
+
gem.author = 'Daniel J. Berger'
|
7
|
+
gem.license = 'Artistic 2.0'
|
8
|
+
gem.email = 'djberg96@gmail.com'
|
9
|
+
gem.homepage = 'http://www.rubyforge.org/projects/shards'
|
10
|
+
gem.summary = 'A struct-like C union for Ruby'
|
11
|
+
gem.test_file = 'test/test_union.rb'
|
12
|
+
gem.has_rdoc = true
|
13
|
+
gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
|
14
|
+
|
15
|
+
gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
|
16
|
+
|
17
|
+
gem.description = <<-EOF
|
18
|
+
The union library provides an analog to a C/C++ union for Ruby.
|
19
|
+
In this implementation a union is a kind of struct where multiple
|
20
|
+
members may be defined, but only one member ever contains a non-nil
|
21
|
+
value at any given time.
|
22
|
+
EOF
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: union
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-10-03 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -24,11 +24,13 @@ extra_rdoc_files:
|
|
24
24
|
- CHANGES
|
25
25
|
- MANIFEST
|
26
26
|
files:
|
27
|
-
- lib/union.rb
|
28
|
-
- test/test_union.rb
|
29
|
-
- README
|
30
27
|
- CHANGES
|
28
|
+
- lib/union.rb
|
31
29
|
- MANIFEST
|
30
|
+
- Rakefile
|
31
|
+
- README
|
32
|
+
- test/test_union.rb
|
33
|
+
- union.gemspec
|
32
34
|
has_rdoc: true
|
33
35
|
homepage: http://www.rubyforge.org/projects/shards
|
34
36
|
licenses:
|