RedAdmiral 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/.rvmrc +27 -0
- data/Gemfile +40 -0
- data/Gemfile.lock +40 -0
- data/HISTORY +12 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +97 -0
- data/RedAdmiral.gemspec +83 -0
- data/VERSION +1 -0
- data/lib/brick.rb +38 -0
- data/spec/RedAdmiral_spec.rb +7 -0
- data/spec/spec_helper.rb +12 -0
- data/test/data/data_test.rb +49 -0
- data/test/init_test.rb +26 -0
- data/test/marshall/create_object_test.rb +33 -0
- metadata +185 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.rvmrc
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
ruby_string="ruby-1.9.2-p180"
|
2
|
+
gemset_name="redadmiral"
|
3
|
+
|
4
|
+
if rvm list strings | grep -q "${ruby_string}" ; then
|
5
|
+
|
6
|
+
# Load or create the specified environment
|
7
|
+
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
|
8
|
+
&& -s "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}" ]] ; then
|
9
|
+
\. "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}"
|
10
|
+
else
|
11
|
+
rvm --create "${ruby_string}@${gemset_name}"
|
12
|
+
fi
|
13
|
+
|
14
|
+
# Ensure that Bundler is installed, install it if it is not.
|
15
|
+
if ! command -v bundle ; then
|
16
|
+
gem install bundler
|
17
|
+
fi
|
18
|
+
|
19
|
+
# Bundle while reducing excess noise.
|
20
|
+
bundle | grep -v 'Using' | grep -v 'complete' | sed '/^$/d'
|
21
|
+
|
22
|
+
else
|
23
|
+
|
24
|
+
# Notify the user to install the desired interpreter before proceeding.
|
25
|
+
echo "${ruby_string} was not found, please run 'rvm install ${ruby_string}' and then cd back into the project directory."
|
26
|
+
|
27
|
+
fi
|
data/Gemfile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
###
|
2
|
+
### Sources
|
3
|
+
###
|
4
|
+
|
5
|
+
# Main Ruby Gems site
|
6
|
+
source "http://rubygems.org"
|
7
|
+
|
8
|
+
|
9
|
+
###
|
10
|
+
### Core Gems. These are required in _all_ environments (additional environments
|
11
|
+
### follow).
|
12
|
+
###
|
13
|
+
|
14
|
+
# Gem required for linking to the Redis server
|
15
|
+
gem "hiredis", "~> 0.3.1"
|
16
|
+
gem "em-synchrony"
|
17
|
+
gem "redis", "~> 2.2.0", :require => ["redis/connection/synchrony", "redis"]
|
18
|
+
|
19
|
+
# JSON Parser
|
20
|
+
gem "json"
|
21
|
+
|
22
|
+
###
|
23
|
+
### Development Gems. All _additional_ gems required by development (as apposed to
|
24
|
+
### production environments). If it is required at run-time, it
|
25
|
+
### belongs above.
|
26
|
+
group :development do
|
27
|
+
|
28
|
+
# Gem management tools
|
29
|
+
gem "bundler", "~> 1.0.0"
|
30
|
+
gem "jeweler", "~> 1.6.0"
|
31
|
+
|
32
|
+
# Documentation Tools
|
33
|
+
gem "yard", "~> 0.6.0"
|
34
|
+
gem "vclog"
|
35
|
+
|
36
|
+
# Testing Tools
|
37
|
+
gem "minitest", ">= 0"
|
38
|
+
gem "riot"
|
39
|
+
|
40
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
ansi (1.2.4)
|
5
|
+
em-synchrony (0.2.0)
|
6
|
+
eventmachine (>= 0.12.9)
|
7
|
+
eventmachine (0.12.10)
|
8
|
+
facets (2.9.1)
|
9
|
+
git (1.2.5)
|
10
|
+
hiredis (0.3.1)
|
11
|
+
jeweler (1.6.0)
|
12
|
+
bundler (~> 1.0.0)
|
13
|
+
git (>= 1.2.5)
|
14
|
+
rake
|
15
|
+
json (1.5.1)
|
16
|
+
minitest (2.1.0)
|
17
|
+
rake (0.8.7)
|
18
|
+
redis (2.2.0)
|
19
|
+
riot (0.12.3)
|
20
|
+
rr
|
21
|
+
rr (1.0.2)
|
22
|
+
vclog (1.8.1)
|
23
|
+
ansi (>= 1.2)
|
24
|
+
facets (>= 2.4)
|
25
|
+
yard (0.6.8)
|
26
|
+
|
27
|
+
PLATFORMS
|
28
|
+
ruby
|
29
|
+
|
30
|
+
DEPENDENCIES
|
31
|
+
bundler (~> 1.0.0)
|
32
|
+
em-synchrony
|
33
|
+
hiredis (~> 0.3.1)
|
34
|
+
jeweler (~> 1.6.0)
|
35
|
+
json
|
36
|
+
minitest
|
37
|
+
redis (~> 2.2.0)
|
38
|
+
riot
|
39
|
+
vclog
|
40
|
+
yard (~> 0.6.0)
|
data/HISTORY
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 David Love
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= RedAdmiral
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Contributing to RedAdmiral
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
9
|
+
* Fork the project
|
10
|
+
* Start a feature/bugfix branch
|
11
|
+
* Commit and push until you are happy with your contribution
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2011 David Love. See LICENSE.txt for
|
18
|
+
further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
# Copyright (c) 2011 David Love
|
2
|
+
#
|
3
|
+
# Permission to use, copy, modify, and/or distribute this software for
|
4
|
+
# any purpose with or without fee is hereby granted, provided that the
|
5
|
+
# above copyright notice and this permission notice appear in all copies.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
8
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
9
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
10
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
11
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
12
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
|
+
#
|
15
|
+
# encoding: utf-8
|
16
|
+
|
17
|
+
###
|
18
|
+
### Set-up. Actions to run before all tasks
|
19
|
+
###
|
20
|
+
|
21
|
+
## Use Bundler to make sure the gem environment is up-to-date
|
22
|
+
require 'rubygems'
|
23
|
+
require 'bundler'
|
24
|
+
begin
|
25
|
+
Bundler.setup(:default, :development)
|
26
|
+
rescue Bundler::BundlerError => e
|
27
|
+
$stderr.puts e.message
|
28
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
29
|
+
exit e.status_code
|
30
|
+
end
|
31
|
+
require 'rake'
|
32
|
+
|
33
|
+
###
|
34
|
+
### Gemspec. Mangage the creation of the relevant gem and gemspec files. Most of this
|
35
|
+
### is delegated to Jeweler
|
36
|
+
###
|
37
|
+
|
38
|
+
require 'jeweler'
|
39
|
+
Jeweler::Tasks.new do |gem|
|
40
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
41
|
+
gem.name = "RedAdmiral"
|
42
|
+
gem.homepage = "http://github.com/dlove24/RedAdmiral"
|
43
|
+
gem.license = "ISC"
|
44
|
+
gem.summary = "%Low-level routines for Mercury clients, abstracting the interaction with the Redis server (cluster)"
|
45
|
+
gem.description = "Prepares hosts/networks/etc to become part of a stated Mercury environment"
|
46
|
+
gem.email = "david@homeunix.org.uk"
|
47
|
+
gem.authors = ["David Love"]
|
48
|
+
# dependencies defined in Gemfile
|
49
|
+
end
|
50
|
+
Jeweler::RubygemsDotOrgTasks.new
|
51
|
+
|
52
|
+
###
|
53
|
+
### Testing. Run the unit/system/integration tests
|
54
|
+
###
|
55
|
+
|
56
|
+
require 'rake/testtask'
|
57
|
+
|
58
|
+
desc "Run all our tests"
|
59
|
+
task :test do
|
60
|
+
Rake::TestTask.new do |t|
|
61
|
+
t.libs << "test"
|
62
|
+
t.verbose = false
|
63
|
+
|
64
|
+
# List of files. We need to specifiy these explicity so they
|
65
|
+
# are loaded in the correct order: init, data, then the tests
|
66
|
+
# themselves
|
67
|
+
t.test_files = ["test/init_test.rb",
|
68
|
+
|
69
|
+
"test/data/data_test.rb",
|
70
|
+
|
71
|
+
"test/marshall/create_object_test.rb"]
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
## Set testing as the default action
|
76
|
+
task :default => :test
|
77
|
+
|
78
|
+
###
|
79
|
+
### Documentation. Generate/update the project documentation
|
80
|
+
###
|
81
|
+
|
82
|
+
## Use Yard to generate the documentations
|
83
|
+
require 'yard'
|
84
|
+
YARD::Rake::YardocTask.new
|
85
|
+
|
86
|
+
###
|
87
|
+
### Release. Additional actions to take when releasing the gem
|
88
|
+
###
|
89
|
+
|
90
|
+
## Additional actions for the release task
|
91
|
+
task :before_release do
|
92
|
+
# Update the HISTORY file
|
93
|
+
`vclog history -f gnu > HISTORY`
|
94
|
+
end
|
95
|
+
|
96
|
+
## Extend the default (Jeweler) 'release' task
|
97
|
+
Rake::Task[:release].enhance([:before_release])
|
data/RedAdmiral.gemspec
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{RedAdmiral}
|
8
|
+
s.version = "0.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["David Love"]
|
12
|
+
s.date = %q{2011-05-05}
|
13
|
+
s.description = %q{Prepares hosts/networks/etc to become part of a stated Mercury environment}
|
14
|
+
s.email = %q{david@homeunix.org.uk}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rspec",
|
22
|
+
".rvmrc",
|
23
|
+
"Gemfile",
|
24
|
+
"Gemfile.lock",
|
25
|
+
"HISTORY",
|
26
|
+
"LICENSE.txt",
|
27
|
+
"README.rdoc",
|
28
|
+
"Rakefile",
|
29
|
+
"RedAdmiral.gemspec",
|
30
|
+
"VERSION",
|
31
|
+
"lib/brick.rb",
|
32
|
+
"spec/RedAdmiral_spec.rb",
|
33
|
+
"spec/spec_helper.rb",
|
34
|
+
"test/data/data_test.rb",
|
35
|
+
"test/init_test.rb",
|
36
|
+
"test/marshall/create_object_test.rb"
|
37
|
+
]
|
38
|
+
s.homepage = %q{http://github.com/dlove24/RedAdmiral}
|
39
|
+
s.licenses = ["ISC"]
|
40
|
+
s.require_paths = ["lib"]
|
41
|
+
s.rubygems_version = %q{1.6.2}
|
42
|
+
s.summary = %q{%Low-level routines for Mercury clients, abstracting the interaction with the Redis server (cluster)}
|
43
|
+
|
44
|
+
if s.respond_to? :specification_version then
|
45
|
+
s.specification_version = 3
|
46
|
+
|
47
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
48
|
+
s.add_runtime_dependency(%q<hiredis>, ["~> 0.3.1"])
|
49
|
+
s.add_runtime_dependency(%q<em-synchrony>, [">= 0"])
|
50
|
+
s.add_runtime_dependency(%q<redis>, ["~> 2.2.0"])
|
51
|
+
s.add_runtime_dependency(%q<json>, [">= 0"])
|
52
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
53
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.0"])
|
54
|
+
s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
|
55
|
+
s.add_development_dependency(%q<vclog>, [">= 0"])
|
56
|
+
s.add_development_dependency(%q<minitest>, [">= 0"])
|
57
|
+
s.add_development_dependency(%q<riot>, [">= 0"])
|
58
|
+
else
|
59
|
+
s.add_dependency(%q<hiredis>, ["~> 0.3.1"])
|
60
|
+
s.add_dependency(%q<em-synchrony>, [">= 0"])
|
61
|
+
s.add_dependency(%q<redis>, ["~> 2.2.0"])
|
62
|
+
s.add_dependency(%q<json>, [">= 0"])
|
63
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
64
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
|
65
|
+
s.add_dependency(%q<yard>, ["~> 0.6.0"])
|
66
|
+
s.add_dependency(%q<vclog>, [">= 0"])
|
67
|
+
s.add_dependency(%q<minitest>, [">= 0"])
|
68
|
+
s.add_dependency(%q<riot>, [">= 0"])
|
69
|
+
end
|
70
|
+
else
|
71
|
+
s.add_dependency(%q<hiredis>, ["~> 0.3.1"])
|
72
|
+
s.add_dependency(%q<em-synchrony>, [">= 0"])
|
73
|
+
s.add_dependency(%q<redis>, ["~> 2.2.0"])
|
74
|
+
s.add_dependency(%q<json>, [">= 0"])
|
75
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
76
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
|
77
|
+
s.add_dependency(%q<yard>, ["~> 0.6.0"])
|
78
|
+
s.add_dependency(%q<vclog>, [">= 0"])
|
79
|
+
s.add_dependency(%q<minitest>, [">= 0"])
|
80
|
+
s.add_dependency(%q<riot>, [">= 0"])
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
data/lib/brick.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# Copyright (c) 2009 Denis Defreyne, 2010-2011 David Love
|
2
|
+
#
|
3
|
+
# Permission to use, copy, modify, and/or distribute this software for
|
4
|
+
# any purpose with or without fee is hereby granted, provided that the
|
5
|
+
# above copyright notice and this permission notice appear in all copies.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
8
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
9
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
10
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
11
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
12
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
|
+
#
|
15
|
+
|
16
|
+
# @author David Love
|
17
|
+
#
|
18
|
+
# The +Wall+ module acts as the main interface between Mercury clients and the Redis
|
19
|
+
# server. All interaction with the Redis server is expected to pass through the methods
|
20
|
+
# of this module.
|
21
|
+
module Wall
|
22
|
+
|
23
|
+
# Connect to Redis
|
24
|
+
require "redis/connection/synchrony"
|
25
|
+
require "redis"
|
26
|
+
|
27
|
+
# Serialize objects using JSON
|
28
|
+
require "json"
|
29
|
+
|
30
|
+
# @author David Love
|
31
|
+
#
|
32
|
+
# Contains the low-level routines for finding, marshaling and otherwise manipulating
|
33
|
+
# the objects contained in the specified realms.
|
34
|
+
class Brick
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'RedAdmiral'
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# Copyright (c) 2009 Denis Defreyne, 2010-2011 David Love
|
2
|
+
#
|
3
|
+
# Permission to use, copy, modify, and/or distribute this software for
|
4
|
+
# any purpose with or without fee is hereby granted, provided that the
|
5
|
+
# above copyright notice and this permission notice appear in all copies.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
8
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
9
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
10
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
11
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
12
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
|
+
#
|
15
|
+
|
16
|
+
# @author David Love
|
17
|
+
|
18
|
+
#require "YAML"
|
19
|
+
|
20
|
+
#
|
21
|
+
# The {Test::Data} module does not contain any tests, as such, but instead
|
22
|
+
# collects together the classes that provide data to other tests. These may
|
23
|
+
# be 'boilerplate' classes containing pre-prepared data, or stub classes used
|
24
|
+
# for low-level testing
|
25
|
+
#
|
26
|
+
module Test::Data
|
27
|
+
|
28
|
+
# Returns the data related to a host record, either as a YAML string or
|
29
|
+
# or YAML object
|
30
|
+
class HostRecord
|
31
|
+
def self.raw_string
|
32
|
+
return_str = String.new
|
33
|
+
|
34
|
+
return_str << "description: \"DNS Server for the Homeunix LAN\"\n"
|
35
|
+
return_str << "\n"
|
36
|
+
return_str << "dns-name: whitehead-dns\n"
|
37
|
+
return_str << "\n"
|
38
|
+
return_str << "dns-aliases: [a.ns, b.ns, whitehead]\n"
|
39
|
+
|
40
|
+
return return_str
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.to_yaml
|
44
|
+
return YAML.parse(raw_string)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
data/test/init_test.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# Copyright (c) 2009 Denis Defreyne, 2010-2011 David Love
|
2
|
+
#
|
3
|
+
# Permission to use, copy, modify, and/or distribute this software for
|
4
|
+
# any purpose with or without fee is hereby granted, provided that the
|
5
|
+
# above copyright notice and this permission notice appear in all copies.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
8
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
9
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
10
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
11
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
12
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
|
+
#
|
15
|
+
|
16
|
+
# @author David Love
|
17
|
+
|
18
|
+
require "riot"
|
19
|
+
|
20
|
+
#
|
21
|
+
# All the tests for RedAdmiral live in the {Test} module, to make it easier
|
22
|
+
# to find them, and to establish the relationships between tests
|
23
|
+
#
|
24
|
+
module Test
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Copyright (c) 2009 Denis Defreyne, 2010-2011 David Love
|
2
|
+
#
|
3
|
+
# Permission to use, copy, modify, and/or distribute this software for
|
4
|
+
# any purpose with or without fee is hereby granted, provided that the
|
5
|
+
# above copyright notice and this permission notice appear in all copies.
|
6
|
+
#
|
7
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
8
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
9
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
10
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
11
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
12
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
|
+
#
|
15
|
+
|
16
|
+
# @author David Love
|
17
|
+
|
18
|
+
#
|
19
|
+
# This test suite checks for the correct instantiation of objects
|
20
|
+
# from strings: both those created from simple strings, and from
|
21
|
+
# the return of a lookup to a Redis database
|
22
|
+
#
|
23
|
+
module Test::Marshall
|
24
|
+
|
25
|
+
# Check that we can instantiate a string
|
26
|
+
context "A non-empty data string" do
|
27
|
+
setup { Test::Data::HostRecord.raw_string }
|
28
|
+
asserts("it is a string") { topic.kind_of?(String) }
|
29
|
+
denies("it is empty") { topic.empty? }
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
metadata
ADDED
@@ -0,0 +1,185 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: RedAdmiral
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- David Love
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-05-05 00:00:00 +01:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: hiredis
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.3.1
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: em-synchrony
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0"
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: redis
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.2.0
|
46
|
+
type: :runtime
|
47
|
+
prerelease: false
|
48
|
+
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: json
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: "0"
|
57
|
+
type: :runtime
|
58
|
+
prerelease: false
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: bundler
|
62
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 1.0.0
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: *id005
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: jeweler
|
73
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ~>
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 1.6.0
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: *id006
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: yard
|
84
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.6.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: *id007
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: vclog
|
95
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: "0"
|
101
|
+
type: :development
|
102
|
+
prerelease: false
|
103
|
+
version_requirements: *id008
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
name: minitest
|
106
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: "0"
|
112
|
+
type: :development
|
113
|
+
prerelease: false
|
114
|
+
version_requirements: *id009
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: riot
|
117
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: "0"
|
123
|
+
type: :development
|
124
|
+
prerelease: false
|
125
|
+
version_requirements: *id010
|
126
|
+
description: Prepares hosts/networks/etc to become part of a stated Mercury environment
|
127
|
+
email: david@homeunix.org.uk
|
128
|
+
executables: []
|
129
|
+
|
130
|
+
extensions: []
|
131
|
+
|
132
|
+
extra_rdoc_files:
|
133
|
+
- LICENSE.txt
|
134
|
+
- README.rdoc
|
135
|
+
files:
|
136
|
+
- .document
|
137
|
+
- .rspec
|
138
|
+
- .rvmrc
|
139
|
+
- Gemfile
|
140
|
+
- Gemfile.lock
|
141
|
+
- HISTORY
|
142
|
+
- LICENSE.txt
|
143
|
+
- README.rdoc
|
144
|
+
- Rakefile
|
145
|
+
- RedAdmiral.gemspec
|
146
|
+
- VERSION
|
147
|
+
- lib/brick.rb
|
148
|
+
- spec/RedAdmiral_spec.rb
|
149
|
+
- spec/spec_helper.rb
|
150
|
+
- test/data/data_test.rb
|
151
|
+
- test/init_test.rb
|
152
|
+
- test/marshall/create_object_test.rb
|
153
|
+
has_rdoc: true
|
154
|
+
homepage: http://github.com/dlove24/RedAdmiral
|
155
|
+
licenses:
|
156
|
+
- ISC
|
157
|
+
post_install_message:
|
158
|
+
rdoc_options: []
|
159
|
+
|
160
|
+
require_paths:
|
161
|
+
- lib
|
162
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
163
|
+
none: false
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
hash: 1414862432447749551
|
168
|
+
segments:
|
169
|
+
- 0
|
170
|
+
version: "0"
|
171
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
|
+
none: false
|
173
|
+
requirements:
|
174
|
+
- - ">="
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: "0"
|
177
|
+
requirements: []
|
178
|
+
|
179
|
+
rubyforge_project:
|
180
|
+
rubygems_version: 1.6.2
|
181
|
+
signing_key:
|
182
|
+
specification_version: 3
|
183
|
+
summary: "%Low-level routines for Mercury clients, abstracting the interaction with the Redis server (cluster)"
|
184
|
+
test_files: []
|
185
|
+
|