daikon 0.0.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/.document +5 -0
- data/.rspec +1 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +10 -0
- data/Rakefile +36 -0
- data/VERSION +1 -0
- data/bin/daikon +5 -0
- data/daikon.gemspec +86 -0
- data/features/daikon.feature +9 -0
- data/features/step_definitions/daikon_steps.rb +0 -0
- data/features/support/env.rb +13 -0
- data/lib/daikon.rb +22 -0
- data/lib/daikon/client.rb +99 -0
- data/lib/daikon/configuration.rb +22 -0
- data/lib/daikon/daemon.rb +34 -0
- data/lib/daikon/namespace_tools.rb +122 -0
- data/spec/client_spec.rb +5 -0
- data/spec/configuration_spec.rb +36 -0
- data/spec/daikon_spec.rb +4 -0
- data/spec/spec_helper.rb +12 -0
- metadata +198 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Nick Quaranto
|
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
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'jeweler'
|
3
|
+
require 'lib/daikon'
|
4
|
+
|
5
|
+
Jeweler::Tasks.new do |gem|
|
6
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
7
|
+
gem.version = Daikon::VERSION
|
8
|
+
|
9
|
+
gem.name = "daikon"
|
10
|
+
gem.homepage = "http://github.com/qrush/daikon"
|
11
|
+
gem.license = "MIT"
|
12
|
+
gem.summary = gem.description = %Q{daikon, a radishapp.com client}
|
13
|
+
gem.email = "nick@quaran.to"
|
14
|
+
gem.authors = ["Nick Quaranto"]
|
15
|
+
|
16
|
+
gem.add_runtime_dependency "daemons", "~> 1.0.0"
|
17
|
+
gem.add_runtime_dependency "redis", "~> 2.1.1"
|
18
|
+
gem.add_runtime_dependency "system_timer", "= 1.0"
|
19
|
+
|
20
|
+
gem.add_development_dependency "rspec", "~> 2.1.0"
|
21
|
+
gem.add_development_dependency "cucumber", ">= 0"
|
22
|
+
gem.add_development_dependency "bundler", "~> 1.0.0"
|
23
|
+
gem.add_development_dependency "jeweler", "~> 1.5.1"
|
24
|
+
end
|
25
|
+
Jeweler::RubygemsDotOrgTasks.new
|
26
|
+
|
27
|
+
require 'rspec/core'
|
28
|
+
require 'rspec/core/rake_task'
|
29
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
30
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
31
|
+
end
|
32
|
+
|
33
|
+
require 'cucumber/rake/task'
|
34
|
+
Cucumber::Rake::Task.new(:features)
|
35
|
+
|
36
|
+
task :default => :spec
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
data/bin/daikon
ADDED
data/daikon.gemspec
ADDED
@@ -0,0 +1,86 @@
|
|
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{daikon}
|
8
|
+
s.version = "0.0.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Nick Quaranto"]
|
12
|
+
s.date = %q{2010-11-19}
|
13
|
+
s.default_executable = %q{daikon}
|
14
|
+
s.description = %q{daikon, a radishapp.com client}
|
15
|
+
s.email = %q{nick@quaran.to}
|
16
|
+
s.executables = ["daikon"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.rdoc"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
".rspec",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"bin/daikon",
|
29
|
+
"daikon.gemspec",
|
30
|
+
"features/daikon.feature",
|
31
|
+
"features/step_definitions/daikon_steps.rb",
|
32
|
+
"features/support/env.rb",
|
33
|
+
"lib/daikon.rb",
|
34
|
+
"lib/daikon/client.rb",
|
35
|
+
"lib/daikon/configuration.rb",
|
36
|
+
"lib/daikon/daemon.rb",
|
37
|
+
"lib/daikon/namespace_tools.rb",
|
38
|
+
"spec/client_spec.rb",
|
39
|
+
"spec/configuration_spec.rb",
|
40
|
+
"spec/daikon_spec.rb",
|
41
|
+
"spec/spec_helper.rb"
|
42
|
+
]
|
43
|
+
s.homepage = %q{http://github.com/qrush/daikon}
|
44
|
+
s.licenses = ["MIT"]
|
45
|
+
s.require_paths = ["lib"]
|
46
|
+
s.rubygems_version = %q{1.3.7}
|
47
|
+
s.summary = %q{daikon, a radishapp.com client}
|
48
|
+
s.test_files = [
|
49
|
+
"spec/client_spec.rb",
|
50
|
+
"spec/configuration_spec.rb",
|
51
|
+
"spec/daikon_spec.rb",
|
52
|
+
"spec/spec_helper.rb"
|
53
|
+
]
|
54
|
+
|
55
|
+
if s.respond_to? :specification_version then
|
56
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
57
|
+
s.specification_version = 3
|
58
|
+
|
59
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
60
|
+
s.add_runtime_dependency(%q<daemons>, ["~> 1.0.0"])
|
61
|
+
s.add_runtime_dependency(%q<redis>, ["~> 2.1.1"])
|
62
|
+
s.add_runtime_dependency(%q<system_timer>, ["= 1.0"])
|
63
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.1.0"])
|
64
|
+
s.add_development_dependency(%q<cucumber>, [">= 0"])
|
65
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
66
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
|
67
|
+
else
|
68
|
+
s.add_dependency(%q<daemons>, ["~> 1.0.0"])
|
69
|
+
s.add_dependency(%q<redis>, ["~> 2.1.1"])
|
70
|
+
s.add_dependency(%q<system_timer>, ["= 1.0"])
|
71
|
+
s.add_dependency(%q<rspec>, ["~> 2.1.0"])
|
72
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
73
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
74
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
75
|
+
end
|
76
|
+
else
|
77
|
+
s.add_dependency(%q<daemons>, ["~> 1.0.0"])
|
78
|
+
s.add_dependency(%q<redis>, ["~> 2.1.1"])
|
79
|
+
s.add_dependency(%q<system_timer>, ["= 1.0"])
|
80
|
+
s.add_dependency(%q<rspec>, ["~> 2.1.0"])
|
81
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
82
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
83
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
begin
|
3
|
+
Bundler.setup(:default, :development)
|
4
|
+
rescue Bundler::BundlerError => e
|
5
|
+
$stderr.puts e.message
|
6
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
7
|
+
exit e.status_code
|
8
|
+
end
|
9
|
+
|
10
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
|
11
|
+
require 'daikon'
|
12
|
+
|
13
|
+
require 'rspec/expectations'
|
data/lib/daikon.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'logger'
|
3
|
+
require 'shellwords'
|
4
|
+
require 'socket'
|
5
|
+
|
6
|
+
require 'daemons'
|
7
|
+
require 'redis'
|
8
|
+
|
9
|
+
__DIR__ = File.dirname(__FILE__)
|
10
|
+
|
11
|
+
$LOAD_PATH.unshift __DIR__ unless
|
12
|
+
$LOAD_PATH.include?(__DIR__) ||
|
13
|
+
$LOAD_PATH.include?(File.expand_path(__DIR__))
|
14
|
+
|
15
|
+
require 'daikon/namespace_tools'
|
16
|
+
require 'daikon/configuration'
|
17
|
+
require 'daikon/client'
|
18
|
+
require 'daikon/daemon'
|
19
|
+
|
20
|
+
module Daikon
|
21
|
+
VERSION = "0.0.0"
|
22
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
module Daikon
|
2
|
+
class Client
|
3
|
+
include NamespaceTools
|
4
|
+
|
5
|
+
attr_accessor :redis, :logger, :config
|
6
|
+
|
7
|
+
def initialize(config, logger)
|
8
|
+
@config = config
|
9
|
+
@logger = logger
|
10
|
+
@redis = Redis.new
|
11
|
+
|
12
|
+
logger.info "Started Daikon v#{VERSION}"
|
13
|
+
end
|
14
|
+
|
15
|
+
def fetch_commands
|
16
|
+
logger.info "fetch commands and run them"
|
17
|
+
end
|
18
|
+
|
19
|
+
def send_info
|
20
|
+
logger.info "sending INFO"
|
21
|
+
end
|
22
|
+
|
23
|
+
def rotate_monitor
|
24
|
+
logger.info "wrap up and truncate monitor log"
|
25
|
+
end
|
26
|
+
|
27
|
+
def evaluate_redis(command)
|
28
|
+
# Attempt to parse the given command string.
|
29
|
+
argv =
|
30
|
+
begin
|
31
|
+
Shellwords.shellwords(command.to_s)
|
32
|
+
rescue Exception => e
|
33
|
+
STDERR.puts e.message
|
34
|
+
e.backtrace.each {|bt| STDERR.puts bt}
|
35
|
+
return { "error" => e.message }
|
36
|
+
end
|
37
|
+
return { "error" => "No command received." } unless argv[0]
|
38
|
+
|
39
|
+
begin
|
40
|
+
{ "response" => execute_redis(argv) }
|
41
|
+
rescue Exception => e
|
42
|
+
STDERR.puts e.message
|
43
|
+
e.backtrace.each {|bt| STDERR.puts bt}
|
44
|
+
{ "error" => e.message }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def namespace
|
49
|
+
nil
|
50
|
+
end
|
51
|
+
|
52
|
+
def execute_redis(argv)
|
53
|
+
# Apply the current namespace to any fields that need it.
|
54
|
+
argv = namespace_input(namespace, *argv)
|
55
|
+
|
56
|
+
# Issue the default help text if the command was not recognized.
|
57
|
+
raise "I'm sorry, I don't recognize that command. #{help}" unless argv.kind_of? Array
|
58
|
+
|
59
|
+
if result = bypass(argv)
|
60
|
+
result
|
61
|
+
else
|
62
|
+
# Send the command to Redis.
|
63
|
+
result = redis.send(*argv)
|
64
|
+
|
65
|
+
# Remove the namespace from any commands that return a key.
|
66
|
+
denamespace_output namespace, argv.first, result
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def bypass(argv)
|
71
|
+
queue = "transactions-#{namespace}"
|
72
|
+
|
73
|
+
if argv.first == "multi"
|
74
|
+
redis.del queue
|
75
|
+
redis.rpush queue, argv.to_json
|
76
|
+
return "OK"
|
77
|
+
elsif redis.llen(queue).to_i >= 1
|
78
|
+
redis.rpush queue, argv.to_json
|
79
|
+
|
80
|
+
if %w( discard exec ).include? argv.first
|
81
|
+
commands = redis.lrange(queue, 0, -1)
|
82
|
+
redis.del queue
|
83
|
+
|
84
|
+
return commands.map do |c|
|
85
|
+
cmd = JSON.parse(c)
|
86
|
+
|
87
|
+
# Send the command to Redis.
|
88
|
+
result = redis.send(*cmd)
|
89
|
+
|
90
|
+
# Remove the namespace from any commands that return a key.
|
91
|
+
denamespace_output namespace, cmd.first, result
|
92
|
+
end.last
|
93
|
+
end
|
94
|
+
|
95
|
+
return "QUEUED"
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Daikon
|
2
|
+
class Configuration
|
3
|
+
FLAGS = %w[-p -k -f -s]
|
4
|
+
OPTIONS = %w[redis_port api_key field_id server_prefix]
|
5
|
+
DEFAULTS = %w[6379 1234567890 1 radishapp.com]
|
6
|
+
|
7
|
+
attr_accessor *OPTIONS
|
8
|
+
|
9
|
+
def initialize(argv)
|
10
|
+
FLAGS.each_with_index do |flag, flag_index|
|
11
|
+
argv_index = argv.index(flag)
|
12
|
+
value = if argv_index
|
13
|
+
argv[argv_index + 1]
|
14
|
+
else
|
15
|
+
DEFAULTS[flag_index]
|
16
|
+
end
|
17
|
+
|
18
|
+
send "#{OPTIONS[flag_index]}=", value
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Daikon
|
2
|
+
class Daemon
|
3
|
+
def self.start
|
4
|
+
Daemons.run_proc('daikon') do
|
5
|
+
if ARGV.include?("run")
|
6
|
+
logger = Logger.new(STDOUT)
|
7
|
+
else
|
8
|
+
logger = Logger.new("/tmp/radish.log")
|
9
|
+
end
|
10
|
+
|
11
|
+
config = Daikon::Configuration.new(ARGV)
|
12
|
+
client = Daikon::Client.new(config, logger)
|
13
|
+
count = 0
|
14
|
+
|
15
|
+
logger.info "spawn monitor watcher"
|
16
|
+
|
17
|
+
loop do
|
18
|
+
client.fetch_commands
|
19
|
+
|
20
|
+
if count % 5 == 4
|
21
|
+
client.send_info
|
22
|
+
end
|
23
|
+
|
24
|
+
if count % 10 == 9
|
25
|
+
client.rotate_monitor
|
26
|
+
end
|
27
|
+
|
28
|
+
count += 1
|
29
|
+
sleep 1
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,122 @@
|
|
1
|
+
module Daikon
|
2
|
+
module NamespaceTools
|
3
|
+
def namespace_input(ns, command, *args)
|
4
|
+
command = command.to_s.downcase
|
5
|
+
|
6
|
+
case command
|
7
|
+
|
8
|
+
when "multi", "exec", "discard"
|
9
|
+
|
10
|
+
# No arguments.
|
11
|
+
|
12
|
+
[ command ]
|
13
|
+
|
14
|
+
when "exists", "del", "type", "keys", "ttl", "set", "get", "getset",
|
15
|
+
"setnx", "incr", "incrby", "decr", "decrby", "rpush", "lpush",
|
16
|
+
"llen", "lrange", "ltrim", "lindex", "lset", "lrem", "lpop", "rpop",
|
17
|
+
"sadd", "srem", "spop", "scard", "sismember", "smembers", "srandmember",
|
18
|
+
"zadd", "zrem", "zincrby", "zrange", "zrevrange", "zrangebyscore",
|
19
|
+
"zcard", "zscore", "zremrangebyscore", "expire", "expireat", "hlen",
|
20
|
+
"hkeys", "hvals", "hgetall", "hset", "hget", "hincrby", "hexists",
|
21
|
+
"hdel", "hmset"
|
22
|
+
|
23
|
+
# Only the first argument is a key.
|
24
|
+
|
25
|
+
head = add_namespace(ns, args.first)
|
26
|
+
tail = args[1, args.length - 1] || []
|
27
|
+
|
28
|
+
[ command, head, *tail ]
|
29
|
+
|
30
|
+
when "smove"
|
31
|
+
|
32
|
+
# The first two parmeters are keys.
|
33
|
+
|
34
|
+
result = [ command ]
|
35
|
+
|
36
|
+
args.each_with_index do |arg, i|
|
37
|
+
result << ((i == 0 || i == 1) ? add_namespace(ns, arg) : arg)
|
38
|
+
end
|
39
|
+
|
40
|
+
result
|
41
|
+
|
42
|
+
when "mget", "rpoplpush", "sinter", "sunion", "sdiff", "info",
|
43
|
+
"sinterstore", "sunionstore", "sdiffstore"
|
44
|
+
|
45
|
+
# All arguments are keys.
|
46
|
+
|
47
|
+
keys = add_namespace(ns, args)
|
48
|
+
|
49
|
+
[ command, *keys ]
|
50
|
+
|
51
|
+
when "mset", "msetnx"
|
52
|
+
|
53
|
+
# Every other argument is a key, starting with the first.
|
54
|
+
|
55
|
+
hash1 = Hash[*args]
|
56
|
+
hash2 = {}
|
57
|
+
|
58
|
+
hash1.each do |k, v|
|
59
|
+
hash2[add_namespace(ns, k)] = hash1.delete(k)
|
60
|
+
end
|
61
|
+
|
62
|
+
[ command, hash2 ]
|
63
|
+
|
64
|
+
when "sort"
|
65
|
+
|
66
|
+
return [] if args.count == 0
|
67
|
+
|
68
|
+
key = add_namespace(ns, args.shift)
|
69
|
+
parms = {}
|
70
|
+
|
71
|
+
while keyword = args.shift.andand.downcase
|
72
|
+
case keyword
|
73
|
+
when "by", "get", "store"
|
74
|
+
k = keyword.intern
|
75
|
+
v = add_namespace(ns, args.shift)
|
76
|
+
|
77
|
+
parms[k] = v
|
78
|
+
when "limit"
|
79
|
+
parms[:limit] = [ args.shift.to_i, args.shift.to_i ]
|
80
|
+
when "asc", "desc", "alpha"
|
81
|
+
parms[:order].andand << " "
|
82
|
+
parms[:order] ||= ""
|
83
|
+
parms[:order] << keyword
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
[ command, key, parms ]
|
88
|
+
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def denamespace_output(namespace, command, result)
|
93
|
+
case command.to_s.downcase
|
94
|
+
|
95
|
+
when "keys"
|
96
|
+
remove_namespace namespace, result
|
97
|
+
|
98
|
+
else
|
99
|
+
result
|
100
|
+
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def add_namespace(namespace, key)
|
105
|
+
return key unless namespace
|
106
|
+
|
107
|
+
case key
|
108
|
+
when String then "#{namespace}:#{key}"
|
109
|
+
when Array then key.map {|k| add_namespace(namespace, k)}
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def remove_namespace(namespace, key)
|
114
|
+
return key unless namespace
|
115
|
+
|
116
|
+
case key
|
117
|
+
when String then key.gsub(/^#{namespace}:/, "")
|
118
|
+
when Array then key.map {|k| remove_namespace(namespace, k)}
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
data/spec/client_spec.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Daikon::Configuration do
|
4
|
+
subject { Daikon::Configuration.new(flags) }
|
5
|
+
let(:flags) { %w[-p 9001 -k deadbeef -s localhost:9337 -f 1337] }
|
6
|
+
|
7
|
+
it "parses the given flags" do
|
8
|
+
subject.redis_port.should == "9001"
|
9
|
+
subject.api_key.should == "deadbeef"
|
10
|
+
subject.field_id.should == "1337"
|
11
|
+
subject.server_prefix == "localhost:9337"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe Daikon::Configuration do
|
16
|
+
subject { Daikon::Configuration.new([]) }
|
17
|
+
|
18
|
+
it "uses the default keys" do
|
19
|
+
subject.redis_port.should == "6379"
|
20
|
+
subject.api_key.should == "1234567890"
|
21
|
+
subject.field_id.should == "1"
|
22
|
+
subject.server_prefix == "radishapp.com"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe Daikon::Configuration do
|
27
|
+
subject { Daikon::Configuration.new(flags) }
|
28
|
+
let(:flags) { %w[-p 9001 -k deadbeef] }
|
29
|
+
|
30
|
+
it "can handle defaults and given options" do
|
31
|
+
subject.redis_port.should == "9001"
|
32
|
+
subject.api_key.should == "deadbeef"
|
33
|
+
subject.field_id.should == "1"
|
34
|
+
subject.server_prefix == "radishapp.com"
|
35
|
+
end
|
36
|
+
end
|
data/spec/daikon_spec.rb
ADDED
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 'daikon'
|
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
|
metadata
ADDED
@@ -0,0 +1,198 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: daikon
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 31
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 0.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Nick Quaranto
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-11-19 00:00:00 -05:00
|
19
|
+
default_executable: daikon
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: daemons
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 23
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 0
|
33
|
+
- 0
|
34
|
+
version: 1.0.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: redis
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 9
|
46
|
+
segments:
|
47
|
+
- 2
|
48
|
+
- 1
|
49
|
+
- 1
|
50
|
+
version: 2.1.1
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: system_timer
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - "="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 15
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 0
|
65
|
+
version: "1.0"
|
66
|
+
type: :runtime
|
67
|
+
version_requirements: *id003
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: rspec
|
70
|
+
prerelease: false
|
71
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 11
|
77
|
+
segments:
|
78
|
+
- 2
|
79
|
+
- 1
|
80
|
+
- 0
|
81
|
+
version: 2.1.0
|
82
|
+
type: :development
|
83
|
+
version_requirements: *id004
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: cucumber
|
86
|
+
prerelease: false
|
87
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
hash: 3
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
version: "0"
|
96
|
+
type: :development
|
97
|
+
version_requirements: *id005
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: bundler
|
100
|
+
prerelease: false
|
101
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - ~>
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
hash: 23
|
107
|
+
segments:
|
108
|
+
- 1
|
109
|
+
- 0
|
110
|
+
- 0
|
111
|
+
version: 1.0.0
|
112
|
+
type: :development
|
113
|
+
version_requirements: *id006
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: jeweler
|
116
|
+
prerelease: false
|
117
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ~>
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
hash: 1
|
123
|
+
segments:
|
124
|
+
- 1
|
125
|
+
- 5
|
126
|
+
- 1
|
127
|
+
version: 1.5.1
|
128
|
+
type: :development
|
129
|
+
version_requirements: *id007
|
130
|
+
description: daikon, a radishapp.com client
|
131
|
+
email: nick@quaran.to
|
132
|
+
executables:
|
133
|
+
- daikon
|
134
|
+
extensions: []
|
135
|
+
|
136
|
+
extra_rdoc_files:
|
137
|
+
- LICENSE.txt
|
138
|
+
- README.rdoc
|
139
|
+
files:
|
140
|
+
- .document
|
141
|
+
- .rspec
|
142
|
+
- LICENSE.txt
|
143
|
+
- README.rdoc
|
144
|
+
- Rakefile
|
145
|
+
- VERSION
|
146
|
+
- bin/daikon
|
147
|
+
- daikon.gemspec
|
148
|
+
- features/daikon.feature
|
149
|
+
- features/step_definitions/daikon_steps.rb
|
150
|
+
- features/support/env.rb
|
151
|
+
- lib/daikon.rb
|
152
|
+
- lib/daikon/client.rb
|
153
|
+
- lib/daikon/configuration.rb
|
154
|
+
- lib/daikon/daemon.rb
|
155
|
+
- lib/daikon/namespace_tools.rb
|
156
|
+
- spec/client_spec.rb
|
157
|
+
- spec/configuration_spec.rb
|
158
|
+
- spec/daikon_spec.rb
|
159
|
+
- spec/spec_helper.rb
|
160
|
+
has_rdoc: true
|
161
|
+
homepage: http://github.com/qrush/daikon
|
162
|
+
licenses:
|
163
|
+
- MIT
|
164
|
+
post_install_message:
|
165
|
+
rdoc_options: []
|
166
|
+
|
167
|
+
require_paths:
|
168
|
+
- lib
|
169
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
170
|
+
none: false
|
171
|
+
requirements:
|
172
|
+
- - ">="
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
hash: 3
|
175
|
+
segments:
|
176
|
+
- 0
|
177
|
+
version: "0"
|
178
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
|
+
none: false
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
hash: 3
|
184
|
+
segments:
|
185
|
+
- 0
|
186
|
+
version: "0"
|
187
|
+
requirements: []
|
188
|
+
|
189
|
+
rubyforge_project:
|
190
|
+
rubygems_version: 1.3.7
|
191
|
+
signing_key:
|
192
|
+
specification_version: 3
|
193
|
+
summary: daikon, a radishapp.com client
|
194
|
+
test_files:
|
195
|
+
- spec/client_spec.rb
|
196
|
+
- spec/configuration_spec.rb
|
197
|
+
- spec/daikon_spec.rb
|
198
|
+
- spec/spec_helper.rb
|