linkage-viewer 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/Gemfile +16 -0
- data/Gemfile.lock +41 -0
- data/Guardfile +8 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/lib/linkage/viewer.rb +16 -0
- data/lib/linkage/viewer/cli.rb +8 -0
- data/lib/linkage/viewer/ui.rb +13 -0
- data/lib/linkage/viewer/ui/base.rb +97 -0
- data/lib/linkage/viewer/ui/console.rb +88 -0
- data/linkage-viewer.gemspec +81 -0
- data/test/helper.rb +18 -0
- data/test/unit/test_cli.rb +4 -0
- data/test/unit/test_console.rb +27 -0
- data/test/unit/test_viewer.rb +10 -0
- metadata +212 -0
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gem "highline"
|
4
|
+
gem "terminal-table"
|
5
|
+
gem "linkage", "> 0.0.3"
|
6
|
+
|
7
|
+
# Add dependencies to develop your gem here.
|
8
|
+
# Include everything needed to run rake, tests, features, etc.
|
9
|
+
group :development do
|
10
|
+
gem "bundler"
|
11
|
+
gem "jeweler", "~> 1.6.4"
|
12
|
+
gem "guard-test"
|
13
|
+
gem "test-unit"
|
14
|
+
gem "mocha"
|
15
|
+
gem "sqlite3"
|
16
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
ffi (1.0.11)
|
5
|
+
git (1.2.5)
|
6
|
+
guard (1.0.1)
|
7
|
+
ffi (>= 0.5.0)
|
8
|
+
thor (~> 0.14.6)
|
9
|
+
guard-test (0.4.3)
|
10
|
+
guard (>= 0.4)
|
11
|
+
test-unit (~> 2.2)
|
12
|
+
highline (1.6.11)
|
13
|
+
jeweler (1.6.4)
|
14
|
+
bundler (~> 1.0)
|
15
|
+
git (>= 1.2.5)
|
16
|
+
rake
|
17
|
+
linkage (0.0.4)
|
18
|
+
sequel
|
19
|
+
metaclass (0.0.1)
|
20
|
+
mocha (0.10.5)
|
21
|
+
metaclass (~> 0.0.1)
|
22
|
+
rake (0.9.2.2)
|
23
|
+
sequel (3.33.0)
|
24
|
+
sqlite3 (1.3.5)
|
25
|
+
terminal-table (1.4.5)
|
26
|
+
test-unit (2.4.8)
|
27
|
+
thor (0.14.6)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
ruby
|
31
|
+
|
32
|
+
DEPENDENCIES
|
33
|
+
bundler
|
34
|
+
guard-test
|
35
|
+
highline
|
36
|
+
jeweler (~> 1.6.4)
|
37
|
+
linkage (> 0.0.3)
|
38
|
+
mocha
|
39
|
+
sqlite3
|
40
|
+
terminal-table
|
41
|
+
test-unit
|
data/Guardfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 Jeremy Stephens
|
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
|
+
= linkage-viewer
|
2
|
+
|
3
|
+
Visualization tool for examining Linkage results.
|
4
|
+
|
5
|
+
== Contributing to linkage-viewer
|
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) 2012 Vanderbilt University. See LICENSE.txt for
|
18
|
+
further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "linkage-viewer"
|
18
|
+
gem.homepage = "http://github.com/coupler/linkage-viewer"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Addon for viewing results from the Linkage library}
|
21
|
+
gem.description = %Q{Visualization tool for viewing results from the Linkage library}
|
22
|
+
gem.email = "jeremy.f.stephens@vanderbilt.edu"
|
23
|
+
gem.authors = ["Jeremy Stephens"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rake/testtask'
|
29
|
+
Rake::TestTask.new(:test) do |test|
|
30
|
+
test.libs << 'lib' << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
|
35
|
+
#require 'rcov/rcovtask'
|
36
|
+
#Rcov::RcovTask.new do |test|
|
37
|
+
#test.libs << 'test'
|
38
|
+
#test.pattern = 'test/**/test_*.rb'
|
39
|
+
#test.verbose = true
|
40
|
+
#test.rcov_opts << '--exclude "gems/*"'
|
41
|
+
#end
|
42
|
+
|
43
|
+
task :default => :test
|
44
|
+
|
45
|
+
require 'rdoc/task'
|
46
|
+
Rake::RDocTask.new do |rdoc|
|
47
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
+
|
49
|
+
rdoc.rdoc_dir = 'rdoc'
|
50
|
+
rdoc.title = "linkage-viewer #{version}"
|
51
|
+
rdoc.rdoc_files.include('README*')
|
52
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'linkage'
|
2
|
+
require 'highline'
|
3
|
+
require 'terminal-table'
|
4
|
+
require 'erb'
|
5
|
+
|
6
|
+
module Linkage
|
7
|
+
module Viewer
|
8
|
+
def self.inspect(config, ui = :console)
|
9
|
+
UI.get(ui).new(config)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
path = Pathname.new(File.dirname(__FILE__)) + 'viewer'
|
15
|
+
require path + 'cli'
|
16
|
+
require path + 'ui'
|
@@ -0,0 +1,97 @@
|
|
1
|
+
module Linkage
|
2
|
+
module Viewer
|
3
|
+
module UI
|
4
|
+
class Base
|
5
|
+
def initialize(config)
|
6
|
+
@config = config
|
7
|
+
@result_set = @config.result_set
|
8
|
+
@groups_dataset = @result_set.groups_dataset
|
9
|
+
@group_count = @groups_dataset.count
|
10
|
+
@groups_records_dataset = @result_set.groups_records_dataset
|
11
|
+
@dataset_1 = @config.dataset_1
|
12
|
+
@dataset_2 = @config.dataset_2
|
13
|
+
|
14
|
+
common_fields = [[], []]
|
15
|
+
@config.expectations.each do |exp|
|
16
|
+
if exp.kind != :filter
|
17
|
+
lhs_data = exp.lhs.data
|
18
|
+
rhs_data = exp.rhs.data
|
19
|
+
if exp.lhs.side == :lhs
|
20
|
+
common_fields[0] << lhs_data
|
21
|
+
common_fields[1] << rhs_data
|
22
|
+
else
|
23
|
+
common_fields[1] << lhs_data
|
24
|
+
common_fields[0] << rhs_data
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
all_fields = if @config.visual_comparisons.empty?
|
30
|
+
[
|
31
|
+
common_fields[0] | @dataset_1.field_set.values,
|
32
|
+
common_fields[1] | @dataset_2.field_set.values
|
33
|
+
]
|
34
|
+
else
|
35
|
+
@config.visual_comparisons.inject(common_fields.dup) do |arr, vc|
|
36
|
+
if vc.lhs.side == :lhs
|
37
|
+
arr[0].push(vc.lhs.data)
|
38
|
+
arr[1].push(vc.rhs.data)
|
39
|
+
else
|
40
|
+
arr[1].push(vc.lhs.data)
|
41
|
+
arr[0].push(vc.rhs.data)
|
42
|
+
end
|
43
|
+
arr
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
@field_expressions = [[], []]
|
48
|
+
@field_names = [[], []]
|
49
|
+
all_fields.each_with_index do |fields, i|
|
50
|
+
fields.each do |field|
|
51
|
+
expr = field.to_expr
|
52
|
+
if expr.is_a?(Sequel::SQL::Function)
|
53
|
+
name = field.name
|
54
|
+
expr = expr.as(name)
|
55
|
+
else
|
56
|
+
name = expr
|
57
|
+
end
|
58
|
+
@field_expressions[i] << expr
|
59
|
+
@field_names[i] << name
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def start
|
65
|
+
raise NotImplementedError
|
66
|
+
end
|
67
|
+
|
68
|
+
private
|
69
|
+
|
70
|
+
def set_group_index(index)
|
71
|
+
@group_index = index
|
72
|
+
@group = @groups_dataset.order(:id).limit(1, index).first
|
73
|
+
@records = []
|
74
|
+
@records_index = [0, 0]
|
75
|
+
|
76
|
+
if @config.linkage_type == :self
|
77
|
+
expressions = @field_expressions[0] | @field_expressions[1]
|
78
|
+
@records << get_records(@group[:id], 1, expressions)
|
79
|
+
@records << @records[0]
|
80
|
+
@records_index[1] = 1
|
81
|
+
else
|
82
|
+
@records << get_records(@group[:id], 1, @field_expressions[0])
|
83
|
+
@records << get_records(@group[:id], 2, @field_expressions[1])
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def get_records(group_id, dataset_id, record_expressions)
|
88
|
+
record_ids = @groups_records_dataset.filter(:group_id => group_id, :dataset => dataset_id).select_map(:record_id)
|
89
|
+
dataset = dataset_id == 1 ? @dataset_1 : @dataset_2
|
90
|
+
primary_key = dataset.field_set.primary_key.to_expr
|
91
|
+
|
92
|
+
dataset.select(*record_expressions).filter(primary_key => record_ids).all
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
module Linkage
|
2
|
+
module Viewer
|
3
|
+
module UI
|
4
|
+
class Console < Base
|
5
|
+
def initialize(*args)
|
6
|
+
super
|
7
|
+
@console = HighLine.new
|
8
|
+
@menu_template = ERB.new(MENU, nil, "-")
|
9
|
+
end
|
10
|
+
|
11
|
+
def start
|
12
|
+
set_group_index(0)
|
13
|
+
menu
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def menu
|
19
|
+
@console.say(@menu_template.result(binding))
|
20
|
+
result = @console.ask("? ") { |q| q.in = %w{1 2 3 4 p n q} }
|
21
|
+
case result
|
22
|
+
when "1"
|
23
|
+
@records_index[0] -= 1 if @records_index[0] != 0
|
24
|
+
when "2"
|
25
|
+
@records_index[0] += 1 if @records_index[0] != (@records[0].length - 1)
|
26
|
+
when "3"
|
27
|
+
@records_index[1] -= 1 if @records_index[1] != 0
|
28
|
+
when "4"
|
29
|
+
@records_index[1] += 1 if @records_index[1] != (@records[1].length - 1)
|
30
|
+
when "p"
|
31
|
+
set_group_index(@group_index - 1) if @group_index != 0
|
32
|
+
when "n"
|
33
|
+
set_group_index(@group_index + 1) if @group_index != (@group_count - 1)
|
34
|
+
when "q"
|
35
|
+
return
|
36
|
+
end
|
37
|
+
menu
|
38
|
+
end
|
39
|
+
|
40
|
+
def get_table
|
41
|
+
field_expressions_1 = @field_expressions[0]
|
42
|
+
field_expressions_2 = @field_expressions[1]
|
43
|
+
field_names_1 = @field_names[0]
|
44
|
+
field_names_2 = @field_names[1]
|
45
|
+
record_1 = @records[0][@records_index[0]]
|
46
|
+
record_2 = @records[1][@records_index[1]]
|
47
|
+
|
48
|
+
Terminal::Table.new do |t|
|
49
|
+
t.title = "Group #{@group_index + 1} of #{@group_count}"
|
50
|
+
t.headings = [
|
51
|
+
{:value => "Record #{@records_index[0] + 1} of #{@records[0].length}", :colspan => 2, :alignment => :center},
|
52
|
+
{:value => "Record #{@records_index[1] + 1} of #{@records[1].length}", :colspan => 2, :alignment => :center}
|
53
|
+
]
|
54
|
+
|
55
|
+
num = [field_expressions_1.length, field_expressions_2.length].max
|
56
|
+
num.times do |i|
|
57
|
+
field_name_1 = field_names_1[i]
|
58
|
+
field_name_2 = field_names_2[i]
|
59
|
+
row = []
|
60
|
+
if field_name_1
|
61
|
+
row.push(field_name_1, record_1[field_name_1])
|
62
|
+
else
|
63
|
+
row.push("", "")
|
64
|
+
end
|
65
|
+
if field_name_2
|
66
|
+
row.push(record_2[field_name_2], field_name_2)
|
67
|
+
else
|
68
|
+
row.push("", "")
|
69
|
+
end
|
70
|
+
t << row
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
Linkage::Viewer::UI::Console::MENU = <<EOF
|
80
|
+
Dataset 1: <%= @dataset_1.table_name %> (<%= @dataset_1.adapter_scheme %>)
|
81
|
+
Dataset 2: <%= @dataset_2.table_name %> (<%= @dataset_2.adapter_scheme %>)
|
82
|
+
Groups: <%= @groups_dataset.count %>
|
83
|
+
|
84
|
+
<%= get_table %>
|
85
|
+
|
86
|
+
[1] prev left [2] next left [3] prev right [4] next right
|
87
|
+
[p]revious group [n]ext group [q]uit
|
88
|
+
EOF
|
@@ -0,0 +1,81 @@
|
|
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 = "linkage-viewer"
|
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 = ["Jeremy Stephens"]
|
12
|
+
s.date = "2012-03-20"
|
13
|
+
s.description = "Visualization tool for viewing results from the Linkage library"
|
14
|
+
s.email = "jeremy.f.stephens@vanderbilt.edu"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
"Gemfile",
|
22
|
+
"Gemfile.lock",
|
23
|
+
"Guardfile",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"lib/linkage/viewer.rb",
|
29
|
+
"lib/linkage/viewer/cli.rb",
|
30
|
+
"lib/linkage/viewer/ui.rb",
|
31
|
+
"lib/linkage/viewer/ui/base.rb",
|
32
|
+
"lib/linkage/viewer/ui/console.rb",
|
33
|
+
"linkage-viewer.gemspec",
|
34
|
+
"test/helper.rb",
|
35
|
+
"test/unit/test_cli.rb",
|
36
|
+
"test/unit/test_console.rb",
|
37
|
+
"test/unit/test_viewer.rb"
|
38
|
+
]
|
39
|
+
s.homepage = "http://github.com/coupler/linkage-viewer"
|
40
|
+
s.licenses = ["MIT"]
|
41
|
+
s.require_paths = ["lib"]
|
42
|
+
s.rubygems_version = "1.8.18"
|
43
|
+
s.summary = "Addon for viewing results from the Linkage library"
|
44
|
+
|
45
|
+
if s.respond_to? :specification_version then
|
46
|
+
s.specification_version = 3
|
47
|
+
|
48
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
49
|
+
s.add_runtime_dependency(%q<highline>, [">= 0"])
|
50
|
+
s.add_runtime_dependency(%q<terminal-table>, [">= 0"])
|
51
|
+
s.add_runtime_dependency(%q<linkage>, ["> 0.0.3"])
|
52
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
53
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
54
|
+
s.add_development_dependency(%q<guard-test>, [">= 0"])
|
55
|
+
s.add_development_dependency(%q<test-unit>, [">= 0"])
|
56
|
+
s.add_development_dependency(%q<mocha>, [">= 0"])
|
57
|
+
s.add_development_dependency(%q<sqlite3>, [">= 0"])
|
58
|
+
else
|
59
|
+
s.add_dependency(%q<highline>, [">= 0"])
|
60
|
+
s.add_dependency(%q<terminal-table>, [">= 0"])
|
61
|
+
s.add_dependency(%q<linkage>, ["> 0.0.3"])
|
62
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
63
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
64
|
+
s.add_dependency(%q<guard-test>, [">= 0"])
|
65
|
+
s.add_dependency(%q<test-unit>, [">= 0"])
|
66
|
+
s.add_dependency(%q<mocha>, [">= 0"])
|
67
|
+
s.add_dependency(%q<sqlite3>, [">= 0"])
|
68
|
+
end
|
69
|
+
else
|
70
|
+
s.add_dependency(%q<highline>, [">= 0"])
|
71
|
+
s.add_dependency(%q<terminal-table>, [">= 0"])
|
72
|
+
s.add_dependency(%q<linkage>, ["> 0.0.3"])
|
73
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
74
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
75
|
+
s.add_dependency(%q<guard-test>, [">= 0"])
|
76
|
+
s.add_dependency(%q<test-unit>, [">= 0"])
|
77
|
+
s.add_dependency(%q<mocha>, [">= 0"])
|
78
|
+
s.add_dependency(%q<sqlite3>, [">= 0"])
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'mocha'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
14
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
15
|
+
require 'linkage/viewer'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestConsole < Test::Unit::TestCase
|
4
|
+
def new_console(*args)
|
5
|
+
Linkage::Viewer::UI::Console.new(*args)
|
6
|
+
end
|
7
|
+
|
8
|
+
def setup
|
9
|
+
super
|
10
|
+
@dataset_1 = stub('dataset 1', :table_name => :foo, :adapter_scheme => :mysql, :field_set => {:id => stub(:to_expr => :id), :foo => stub(:to_expr => :foo)})
|
11
|
+
@dataset_2 = stub('dataset 2', :table_name => :bar, :adapter_scheme => :sqlite, :field_set => {:id => stub(:to_expr => :id), :foo => stub(:to_expr => :bar)})
|
12
|
+
@groups_dataset = stub('groups dataset', :count => 5)
|
13
|
+
@groups_records_dataset = stub('groups_records dataset')
|
14
|
+
@result_set = stub('result set', :groups_dataset => @groups_dataset, :groups_records_dataset => @groups_records_dataset)
|
15
|
+
@lhs = stub('lhs', :side => :lhs, :data => stub(:to_expr => :foo))
|
16
|
+
@rhs = stub('rhs', :side => :rhs, :data => stub(:to_expr => :bar))
|
17
|
+
@expectation = stub('expectation', :kind => :self, :lhs => @lhs, :rhs => @rhs)
|
18
|
+
@config = stub('configuration', :dataset_1 => @dataset_1, :dataset_2 => @dataset_2, :result_set => @result_set, :expectations => [@expectation])
|
19
|
+
@highline = stub('highline', :say => nil)
|
20
|
+
HighLine.stubs(:new).returns(@highline)
|
21
|
+
end
|
22
|
+
|
23
|
+
#test "menu" do
|
24
|
+
#ui = new_console(@config)
|
25
|
+
#ui.menu
|
26
|
+
#end
|
27
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestViewer < Test::Unit::TestCase
|
4
|
+
test ".inspect takes a configuration and a ui mode" do
|
5
|
+
config = stub('config')
|
6
|
+
ui = stub('console ui')
|
7
|
+
Linkage::Viewer::UI::Console.expects(:new).with(config).returns(ui)
|
8
|
+
Linkage::Viewer.inspect(config, :console)
|
9
|
+
end
|
10
|
+
end
|
metadata
ADDED
@@ -0,0 +1,212 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: linkage-viewer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jeremy Stephens
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-03-20 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: highline
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: terminal-table
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: linkage
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>'
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.0.3
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>'
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.0.3
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: bundler
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: jeweler
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 1.6.4
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.6.4
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: guard-test
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: test-unit
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: mocha
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: sqlite3
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
description: Visualization tool for viewing results from the Linkage library
|
159
|
+
email: jeremy.f.stephens@vanderbilt.edu
|
160
|
+
executables: []
|
161
|
+
extensions: []
|
162
|
+
extra_rdoc_files:
|
163
|
+
- LICENSE.txt
|
164
|
+
- README.rdoc
|
165
|
+
files:
|
166
|
+
- .document
|
167
|
+
- Gemfile
|
168
|
+
- Gemfile.lock
|
169
|
+
- Guardfile
|
170
|
+
- LICENSE.txt
|
171
|
+
- README.rdoc
|
172
|
+
- Rakefile
|
173
|
+
- VERSION
|
174
|
+
- lib/linkage/viewer.rb
|
175
|
+
- lib/linkage/viewer/cli.rb
|
176
|
+
- lib/linkage/viewer/ui.rb
|
177
|
+
- lib/linkage/viewer/ui/base.rb
|
178
|
+
- lib/linkage/viewer/ui/console.rb
|
179
|
+
- linkage-viewer.gemspec
|
180
|
+
- test/helper.rb
|
181
|
+
- test/unit/test_cli.rb
|
182
|
+
- test/unit/test_console.rb
|
183
|
+
- test/unit/test_viewer.rb
|
184
|
+
homepage: http://github.com/coupler/linkage-viewer
|
185
|
+
licenses:
|
186
|
+
- MIT
|
187
|
+
post_install_message:
|
188
|
+
rdoc_options: []
|
189
|
+
require_paths:
|
190
|
+
- lib
|
191
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
192
|
+
none: false
|
193
|
+
requirements:
|
194
|
+
- - ! '>='
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: '0'
|
197
|
+
segments:
|
198
|
+
- 0
|
199
|
+
hash: 1289887407956206137
|
200
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
202
|
+
requirements:
|
203
|
+
- - ! '>='
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: '0'
|
206
|
+
requirements: []
|
207
|
+
rubyforge_project:
|
208
|
+
rubygems_version: 1.8.18
|
209
|
+
signing_key:
|
210
|
+
specification_version: 3
|
211
|
+
summary: Addon for viewing results from the Linkage library
|
212
|
+
test_files: []
|