rundaneum 0.0.0a
Sign up to get free protection for your applications and to get access to all the features.
- data/C:/Users/JRGWMI~1/Downloads/repos/rundaneum/spec/tag_spec.rb +65 -0
- data/Rakefile.rb +4 -0
- data/lib/tag.rb +22 -0
- data/nbproject/private/config.properties +0 -0
- data/nbproject/private/private.properties +4 -0
- data/nbproject/project.properties +10 -0
- data/nbproject/project.xml +16 -0
- data/rundaneum.gemspec +28 -0
- data/spec/spec.opts +3 -0
- data/spec/tag_spec.rb +65 -0
- data/tasks/default.rake +4 -0
- data/tasks/gem.rake +14 -0
- data/tasks/spec.rake +12 -0
- data/tasks/test.rake +4 -0
- metadata +86 -0
@@ -0,0 +1,65 @@
|
|
1
|
+
#!/usr/bin/env spec
|
2
|
+
|
3
|
+
libdir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
4
|
+
$LOAD_PATH.unshift libdir unless $LOAD_PATH.include? libdir
|
5
|
+
|
6
|
+
begin require 'rubygems'; rescue LoadError
|
7
|
+
else begin gem 'rspec', '~> 1.1.4'; rescue Gem::LoadError; end end
|
8
|
+
require 'spec'
|
9
|
+
|
10
|
+
require 'tag'
|
11
|
+
|
12
|
+
describe Tag do
|
13
|
+
|
14
|
+
it 'should not be valid without a name' do
|
15
|
+
lambda { Tag.new }.should raise_error(ArgumentError)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should be valid with a name' do
|
19
|
+
lambda { Tag.new :name }.should_not raise_error
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should have the name it was initialized with' do
|
23
|
+
Tag.new(:name).name.should == :name
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should return a symbol for the name, even if initialized differently' do
|
27
|
+
Tag.new('name').name.should == :name
|
28
|
+
Tag.new(42).name.should == :'42'
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should create different Tag objects, if initialized with different names' do
|
32
|
+
Tag.new(:name).should_not == Tag.new(:bar)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should return the same Tag object, if initialized with identical names' do
|
36
|
+
(tag = Tag.new :name).should == Tag.new(:name)
|
37
|
+
tag.should == Tag.new('name')
|
38
|
+
tag.should == Tag.new('name', 'Baz')
|
39
|
+
Tag.new(:bar, 'Blah').should == Tag.new('bar', 'Blub')
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'should not have a description' do
|
43
|
+
Tag.new(:name).description.should be_nil
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'should allow setting a description' do
|
47
|
+
lambda { Tag.new(:name).description = 'Description' }.should_not raise_error
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'should have a description after one is set' do
|
51
|
+
(tag = Tag.new(:name)).description = 'Description'
|
52
|
+
tag.description.should == 'Description'
|
53
|
+
end
|
54
|
+
|
55
|
+
describe 'with a description' do
|
56
|
+
|
57
|
+
it 'should have a description' do
|
58
|
+
Tag.new(:name, 'Description').description.should_not be_nil
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'should have the description it was initialized with' do
|
62
|
+
Tag.new(:name, 'Description').description.should == 'Description'
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
data/Rakefile.rb
ADDED
data/lib/tag.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
begin require 'rubygems'; rescue LoadError
|
2
|
+
else begin gem 'facets', '~> 2.4.1'; rescue Gem::LoadError; end end
|
3
|
+
require 'facets/multiton'
|
4
|
+
class Tag
|
5
|
+
include Multiton
|
6
|
+
|
7
|
+
attr_reader :name
|
8
|
+
attr_accessor :description
|
9
|
+
|
10
|
+
def initialize name, description = nil
|
11
|
+
self.name = :"#{name}"
|
12
|
+
self.description = description unless description.nil?
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
attr_writer :name
|
18
|
+
|
19
|
+
def self.multiton_id name, description = nil
|
20
|
+
return :"#{name}"
|
21
|
+
end
|
22
|
+
end
|
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
file.reference.rundaneum-lib=lib
|
2
|
+
file.reference.rundaneum-spec=spec
|
3
|
+
file.reference.rundaneum-tasks=tasks
|
4
|
+
javac.classpath=
|
5
|
+
main.file=
|
6
|
+
platform.active=Ruby
|
7
|
+
source.encoding=UTF-8
|
8
|
+
src.dir=${file.reference.rundaneum-lib}
|
9
|
+
tasks.dir=${file.reference.rundaneum-tasks}
|
10
|
+
test.src.dir=${file.reference.rundaneum-spec}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project xmlns="http://www.netbeans.org/ns/project/1">
|
3
|
+
<type>org.netbeans.modules.ruby.rubyproject</type>
|
4
|
+
<configuration>
|
5
|
+
<data xmlns="http://www.netbeans.org/ns/ruby-project/1">
|
6
|
+
<name>Rundaneum</name>
|
7
|
+
<source-roots>
|
8
|
+
<root id="src.dir"/>
|
9
|
+
<root id="tasks.dir" name="Rake Tasks"/>
|
10
|
+
</source-roots>
|
11
|
+
<test-roots>
|
12
|
+
<root id="test.src.dir"/>
|
13
|
+
</test-roots>
|
14
|
+
</data>
|
15
|
+
</configuration>
|
16
|
+
</project>
|
data/rundaneum.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# vim: fileencoding=UTF-8 ft=ruby syn=ruby ts=2 sw=2 ai eol et si
|
3
|
+
|
4
|
+
# Copyright (c) 2009 Jörg W Mittag <mailto:JoergWMittag+Rundaneum@GoogleMail.Com>
|
5
|
+
|
6
|
+
projdir = File.dirname __FILE__
|
7
|
+
|
8
|
+
require 'rubygems'
|
9
|
+
require 'date'
|
10
|
+
|
11
|
+
SPEC = Gem::Specification.new do |s|
|
12
|
+
s.name = 'rundaneum'
|
13
|
+
s.version = '0.0.0a'
|
14
|
+
s.summary = 'A Knowledge Management System'
|
15
|
+
s.email = 'Jörg W Mittag <JoergWMittag+Rundaneum@GoogleMail.Com>'
|
16
|
+
s.homepage = 'http://JoergWMittag.GitHub.Com/rundaneum/'
|
17
|
+
s.description = s.summary
|
18
|
+
s.author = 'Jörg W Mittag'
|
19
|
+
s.files = Dir[File.join(projdir, '**', '*.*')].reject { |file| file =~ /pkg/ }.collect { |file| file.gsub projdir, '.'}
|
20
|
+
s.test_files = Dir[File.join(projdir, 'spec', '**', '*_spec.rb')]
|
21
|
+
s.add_dependency 'facets', '~> 2.8.0'
|
22
|
+
s.add_development_dependency 'rspec', '~> 1.2.9'
|
23
|
+
end
|
24
|
+
|
25
|
+
if __FILE__ == $0
|
26
|
+
Gem::manage_gems
|
27
|
+
Gem::Builder.new(SPEC).build
|
28
|
+
end
|
data/spec/spec.opts
ADDED
data/spec/tag_spec.rb
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
#!/usr/bin/env spec
|
2
|
+
|
3
|
+
libdir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
4
|
+
$LOAD_PATH.unshift libdir unless $LOAD_PATH.include? libdir
|
5
|
+
|
6
|
+
begin require 'rubygems'; rescue LoadError
|
7
|
+
else begin gem 'rspec', '~> 1.1.4'; rescue Gem::LoadError; end end
|
8
|
+
require 'spec'
|
9
|
+
|
10
|
+
require 'tag'
|
11
|
+
|
12
|
+
describe Tag do
|
13
|
+
|
14
|
+
it 'should not be valid without a name' do
|
15
|
+
lambda { Tag.new }.should raise_error(ArgumentError)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should be valid with a name' do
|
19
|
+
lambda { Tag.new :name }.should_not raise_error
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should have the name it was initialized with' do
|
23
|
+
Tag.new(:name).name.should == :name
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should return a symbol for the name, even if initialized differently' do
|
27
|
+
Tag.new('name').name.should == :name
|
28
|
+
Tag.new(42).name.should == :'42'
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should create different Tag objects, if initialized with different names' do
|
32
|
+
Tag.new(:name).should_not == Tag.new(:bar)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should return the same Tag object, if initialized with identical names' do
|
36
|
+
(tag = Tag.new :name).should == Tag.new(:name)
|
37
|
+
tag.should == Tag.new('name')
|
38
|
+
tag.should == Tag.new('name', 'Baz')
|
39
|
+
Tag.new(:bar, 'Blah').should == Tag.new('bar', 'Blub')
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'should not have a description' do
|
43
|
+
Tag.new(:name).description.should be_nil
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'should allow setting a description' do
|
47
|
+
lambda { Tag.new(:name).description = 'Description' }.should_not raise_error
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'should have a description after one is set' do
|
51
|
+
(tag = Tag.new(:name)).description = 'Description'
|
52
|
+
tag.description.should == 'Description'
|
53
|
+
end
|
54
|
+
|
55
|
+
describe 'with a description' do
|
56
|
+
|
57
|
+
it 'should have a description' do
|
58
|
+
Tag.new(:name, 'Description').description.should_not be_nil
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'should have the description it was initialized with' do
|
62
|
+
Tag.new(:name, 'Description').description.should == 'Description'
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
data/tasks/default.rake
ADDED
data/tasks/gem.rake
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
|
3
|
+
projdir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
4
|
+
$LOAD_PATH.unshift projdir unless $LOAD_PATH.include? projdir
|
5
|
+
|
6
|
+
require 'rake/gempackagetask'
|
7
|
+
|
8
|
+
load 'rundaneum.gemspec'
|
9
|
+
|
10
|
+
Rake::GemPackageTask.new(SPEC) do |pkg|
|
11
|
+
pkg.need_zip = true
|
12
|
+
pkg.need_tar_gz = true
|
13
|
+
pkg.need_tar_bz2 = true
|
14
|
+
end
|
data/tasks/spec.rake
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
|
3
|
+
specdir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec'))
|
4
|
+
|
5
|
+
begin require 'rubygems'; rescue LoadError
|
6
|
+
else begin gem 'rspec', '~> 1.1.4'; rescue Gem::LoadError; end end
|
7
|
+
require 'spec/rake/spectask'
|
8
|
+
desc 'Run the Specs.'
|
9
|
+
Spec::Rake::SpecTask.new do |t|
|
10
|
+
t.spec_opts = ['--options', File.join(specdir, 'spec.opts')]
|
11
|
+
t.spec_files = FileList[File.join(specdir, '*_spec.rb')]
|
12
|
+
end
|
data/tasks/test.rake
ADDED
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rundaneum
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0a
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- "J\xC3\xB6rg W Mittag"
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-11-18 00:00:00 +01:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: facets
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.8.0
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rspec
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.2.9
|
34
|
+
version:
|
35
|
+
description: A Knowledge Management System
|
36
|
+
email: "J\xC3\xB6rg W Mittag <JoergWMittag+Rundaneum@GoogleMail.Com>"
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files: []
|
42
|
+
|
43
|
+
files:
|
44
|
+
- ./lib/tag.rb
|
45
|
+
- ./nbproject/private/config.properties
|
46
|
+
- ./nbproject/private/private.properties
|
47
|
+
- ./nbproject/project.properties
|
48
|
+
- ./nbproject/project.xml
|
49
|
+
- ./Rakefile.rb
|
50
|
+
- ./rundaneum.gemspec
|
51
|
+
- ./spec/spec.opts
|
52
|
+
- ./spec/tag_spec.rb
|
53
|
+
- ./tasks/default.rake
|
54
|
+
- ./tasks/gem.rake
|
55
|
+
- ./tasks/spec.rake
|
56
|
+
- ./tasks/test.rake
|
57
|
+
has_rdoc: true
|
58
|
+
homepage: http://JoergWMittag.GitHub.Com/rundaneum/
|
59
|
+
licenses: []
|
60
|
+
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options: []
|
63
|
+
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: "0"
|
71
|
+
version:
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 1.3.1
|
77
|
+
version:
|
78
|
+
requirements: []
|
79
|
+
|
80
|
+
rubyforge_project:
|
81
|
+
rubygems_version: 1.3.5
|
82
|
+
signing_key:
|
83
|
+
specification_version: 3
|
84
|
+
summary: A Knowledge Management System
|
85
|
+
test_files:
|
86
|
+
- C:/Users/JRGWMI~1/Downloads/repos/rundaneum/spec/tag_spec.rb
|