caruby-scat 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +25 -0
- data/Gemfile.lock +158 -0
- data/History.md +9 -0
- data/LEGAL +4 -0
- data/LICENSE +22 -0
- data/README.md +131 -0
- data/Rakefile +41 -0
- data/bin/scat +7 -0
- data/bin/scatseed +10 -0
- data/caruby-scat.gemspec +30 -0
- data/conf/fields.yaml +22 -0
- data/conf/redis.conf +492 -0
- data/config.ru +15 -0
- data/features/edit.feature +29 -0
- data/features/step_definitions/scat_steps.rb +50 -0
- data/features/support/env.rb +18 -0
- data/features/support/seed.rb +2 -0
- data/lib/scat.rb +56 -0
- data/lib/scat/autocomplete.rb +74 -0
- data/lib/scat/cache.rb +90 -0
- data/lib/scat/configuration.rb +79 -0
- data/lib/scat/edit.rb +160 -0
- data/lib/scat/field.rb +99 -0
- data/lib/scat/version.rb +3 -0
- data/public/images/apple-touch-icon-114x114.png +0 -0
- data/public/images/apple-touch-icon-72x72.png +0 -0
- data/public/images/apple-touch-icon.png +0 -0
- data/public/images/favicon.ico +0 -0
- data/public/images/help.png +0 -0
- data/public/javascripts/tabs.js +29 -0
- data/public/robots.txt +5 -0
- data/public/stylesheets/base.css +342 -0
- data/public/stylesheets/layout.css +58 -0
- data/public/stylesheets/scat.css +64 -0
- data/public/stylesheets/skeleton.css +242 -0
- data/redis.rdb +0 -0
- data/spec/autocomplete_spec.rb +17 -0
- data/spec/edit_spec.rb +60 -0
- data/spec/spec_helper.rb +13 -0
- data/test/fixtures/seed.rb +25 -0
- data/views/edit.haml +12 -0
- data/views/layout.haml +40 -0
- metadata +216 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
source :rubygems
|
2
|
+
gemspec
|
3
|
+
|
4
|
+
group :development do
|
5
|
+
gem 'ruby-debug'
|
6
|
+
# Uncomment the following lines if there are local gem changes. Change the path option
|
7
|
+
# to your workspace location. Commit the changed Gemfile and Gemfile.lock to a git branch
|
8
|
+
# named 'local' rather than to the master branch. Do not check in the local change.
|
9
|
+
gem 'caruby-core', :path => File.dirname(__FILE__) + '/../core'
|
10
|
+
gem 'caruby-tissue', :path => File.dirname(__FILE__) + '/../tissue'
|
11
|
+
gem 'caruby-small', :path => File.dirname(__FILE__) + '/../small'
|
12
|
+
gem 'jinx', :path => File.dirname(__FILE__) + '/../../jinx/core'
|
13
|
+
gem 'jinx-json', :path => File.dirname(__FILE__) + '/../../jinx/json'
|
14
|
+
gem 'caruby-scat', :path => File.dirname(__FILE__), :require => 'scat'
|
15
|
+
end
|
16
|
+
|
17
|
+
group :test do
|
18
|
+
gem 'rspec', '>= 2.6'
|
19
|
+
gem 'sinatra', '=1.2.6' # TODO - retry with 1.3 when it is available
|
20
|
+
gem 'shotgun'
|
21
|
+
gem 'cucumber'
|
22
|
+
gem 'capybara'
|
23
|
+
gem 'launchy'
|
24
|
+
gem 'rack-test', :require => 'rack/test'
|
25
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,158 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
caruby-scat (1.1.1)
|
5
|
+
bundler
|
6
|
+
caruby-tissue (>= 2.1.4)
|
7
|
+
haml
|
8
|
+
jruby-openssl
|
9
|
+
rack
|
10
|
+
redis
|
11
|
+
redis-store
|
12
|
+
sinatra
|
13
|
+
sinatra-authorization
|
14
|
+
|
15
|
+
PATH
|
16
|
+
remote: /Users/loneyf/workspace/caruby/core
|
17
|
+
specs:
|
18
|
+
caruby-core (2.1.3)
|
19
|
+
bundler
|
20
|
+
jinx (~> 2.1.1)
|
21
|
+
jinx-json (~> 2.1.1)
|
22
|
+
jinx-migrate (>= 2.1.1)
|
23
|
+
rdbi
|
24
|
+
|
25
|
+
PATH
|
26
|
+
remote: /Users/loneyf/workspace/caruby/tissue
|
27
|
+
specs:
|
28
|
+
caruby-tissue (2.1.5)
|
29
|
+
bundler
|
30
|
+
caruby-core (>= 2.1.1)
|
31
|
+
uom (>= 1.2.2)
|
32
|
+
|
33
|
+
PATH
|
34
|
+
remote: /Users/loneyf/workspace/jinx/core
|
35
|
+
specs:
|
36
|
+
jinx (2.1.3)
|
37
|
+
bundler
|
38
|
+
|
39
|
+
PATH
|
40
|
+
remote: /Users/loneyf/workspace/jinx/json
|
41
|
+
specs:
|
42
|
+
jinx-json (2.1.2)
|
43
|
+
bundler
|
44
|
+
jinx
|
45
|
+
json_pure
|
46
|
+
|
47
|
+
GEM
|
48
|
+
remote: http://rubygems.org/
|
49
|
+
specs:
|
50
|
+
addressable (2.2.8)
|
51
|
+
bouncy-castle-java (1.5.0146.1)
|
52
|
+
builder (3.0.0)
|
53
|
+
capybara (1.1.2)
|
54
|
+
mime-types (>= 1.16)
|
55
|
+
nokogiri (>= 1.3.3)
|
56
|
+
rack (>= 1.0.0)
|
57
|
+
rack-test (>= 0.5.4)
|
58
|
+
selenium-webdriver (~> 2.0)
|
59
|
+
xpath (~> 0.1.4)
|
60
|
+
childprocess (0.3.2)
|
61
|
+
ffi (~> 1.0.6)
|
62
|
+
columnize (0.3.6)
|
63
|
+
cucumber (1.2.1)
|
64
|
+
builder (>= 2.1.2)
|
65
|
+
diff-lcs (>= 1.1.3)
|
66
|
+
gherkin (~> 2.11.0)
|
67
|
+
json (>= 1.4.6)
|
68
|
+
diff-lcs (1.1.3)
|
69
|
+
epoxy (0.3.1)
|
70
|
+
extensional (1.3.1)
|
71
|
+
fastercsv (1.5.5)
|
72
|
+
ffi (1.0.11-java)
|
73
|
+
gherkin (2.11.0-java)
|
74
|
+
json (>= 1.4.6)
|
75
|
+
haml (3.1.6)
|
76
|
+
jinx-migrate (2.1.2)
|
77
|
+
bundler
|
78
|
+
fastercsv
|
79
|
+
rack
|
80
|
+
jruby-openssl (0.7.7)
|
81
|
+
bouncy-castle-java (>= 1.5.0146.1)
|
82
|
+
json (1.7.3-java)
|
83
|
+
json_pure (1.7.3)
|
84
|
+
launchy (2.1.0-java)
|
85
|
+
addressable (~> 2.2.6)
|
86
|
+
ffi (~> 1.0.9)
|
87
|
+
spoon (~> 0.0.1)
|
88
|
+
libwebsocket (0.1.3)
|
89
|
+
addressable
|
90
|
+
methlab (0.1.0)
|
91
|
+
mime-types (1.18)
|
92
|
+
multi_json (1.3.6)
|
93
|
+
nokogiri (1.5.4-java)
|
94
|
+
rack (1.4.1)
|
95
|
+
rack-test (0.6.1)
|
96
|
+
rack (>= 1.0)
|
97
|
+
rake (0.9.2.2)
|
98
|
+
rdbi (0.9.1)
|
99
|
+
epoxy (>= 0.3.1)
|
100
|
+
methlab (>= 0.0.9)
|
101
|
+
typelib
|
102
|
+
redis (3.0.1)
|
103
|
+
redis-store (1.1.1)
|
104
|
+
redis (>= 2.2.0)
|
105
|
+
rspec (2.10.0)
|
106
|
+
rspec-core (~> 2.10.0)
|
107
|
+
rspec-expectations (~> 2.10.0)
|
108
|
+
rspec-mocks (~> 2.10.0)
|
109
|
+
rspec-core (2.10.1)
|
110
|
+
rspec-expectations (2.10.0)
|
111
|
+
diff-lcs (~> 1.1.3)
|
112
|
+
rspec-mocks (2.10.1)
|
113
|
+
ruby-debug (0.10.4)
|
114
|
+
columnize (>= 0.1)
|
115
|
+
ruby-debug-base (~> 0.10.4.0)
|
116
|
+
ruby-debug-base (0.10.4-java)
|
117
|
+
rubyzip (0.9.9)
|
118
|
+
selenium-webdriver (2.22.2)
|
119
|
+
childprocess (>= 0.2.5)
|
120
|
+
ffi (~> 1.0)
|
121
|
+
libwebsocket (~> 0.1.3)
|
122
|
+
multi_json (~> 1.0)
|
123
|
+
rubyzip
|
124
|
+
shotgun (0.9)
|
125
|
+
rack (>= 1.0)
|
126
|
+
sinatra (1.2.6)
|
127
|
+
rack (~> 1.1)
|
128
|
+
tilt (>= 1.2.2, < 2.0)
|
129
|
+
sinatra-authorization (1.0.0)
|
130
|
+
sinatra (>= 0.9.1.1)
|
131
|
+
spoon (0.0.1)
|
132
|
+
tilt (1.3.3)
|
133
|
+
typelib (0.1.0)
|
134
|
+
uom (1.2.2)
|
135
|
+
extensional
|
136
|
+
xpath (0.1.4)
|
137
|
+
nokogiri (~> 1.3)
|
138
|
+
yard (0.8.2.1)
|
139
|
+
|
140
|
+
PLATFORMS
|
141
|
+
java
|
142
|
+
|
143
|
+
DEPENDENCIES
|
144
|
+
capybara
|
145
|
+
caruby-core!
|
146
|
+
caruby-scat!
|
147
|
+
caruby-tissue!
|
148
|
+
cucumber
|
149
|
+
jinx!
|
150
|
+
jinx-json!
|
151
|
+
launchy
|
152
|
+
rack-test
|
153
|
+
rake
|
154
|
+
rspec (>= 2.6)
|
155
|
+
ruby-debug
|
156
|
+
shotgun
|
157
|
+
sinatra (= 1.2.6)
|
158
|
+
yard
|
data/History.md
ADDED
data/LEGAL
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Oregon Health & Science University
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
4
|
+
obtaining a copy of this software and associated documentation
|
5
|
+
files (the "Software"), to deal in the Software without
|
6
|
+
restriction, including without limitation the rights to use,
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the
|
9
|
+
Software is furnished to do so, subject to the following
|
10
|
+
conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
Scat: a _S_imple _caT_issue application
|
2
|
+
=============================================
|
3
|
+
**Git**: [http://github.com/caruby/scat](http://github.com/caruby/scat)
|
4
|
+
**Author**: OHSU Knight Cancer Institute
|
5
|
+
**Copyright**: 2012
|
6
|
+
**License**: MIT License
|
7
|
+
|
8
|
+
Synopsis
|
9
|
+
--------
|
10
|
+
Scat is a light-weight [caRuby Tissue](http://caruby.rubyforge.org/tissue.html) web application.
|
11
|
+
|
12
|
+
Features
|
13
|
+
--------
|
14
|
+
1. Create tissue specimens in caTissue.
|
15
|
+
|
16
|
+
2. Create the specimen subject, registration and collection group as necessary.
|
17
|
+
|
18
|
+
3. Auto-complete the diagnosis and tissue site.
|
19
|
+
|
20
|
+
4. Authorize the user.
|
21
|
+
|
22
|
+
5. One small edit page to rule them all.
|
23
|
+
|
24
|
+
6. Dynamically responds to tablet and even smartphone devices.
|
25
|
+
|
26
|
+
7. Simple edit form configuration.
|
27
|
+
|
28
|
+
8. Leverage the [caRuby](http://caruby.rubyforge.org) declarative API.
|
29
|
+
|
30
|
+
Requirements
|
31
|
+
------------
|
32
|
+
The current Scat release requires the caTissue API client and Linux.
|
33
|
+
|
34
|
+
After installation, the supported caTissue versions are listed by the following command:
|
35
|
+
|
36
|
+
crtsmoke --version
|
37
|
+
|
38
|
+
Installation
|
39
|
+
------------
|
40
|
+
Scat is installed on a caTissue server as a JRuby gem:
|
41
|
+
|
42
|
+
sudo jgem install caruby-scat
|
43
|
+
|
44
|
+
The log file is +/var/log/scat.log+. Ensure that the +/var/log+ directory is writable.
|
45
|
+
|
46
|
+
Usage
|
47
|
+
-----
|
48
|
+
1. Execute +crtscat+ to start Scat.
|
49
|
+
|
50
|
+
2. Open a web browser on +http:://+_server_+:4567/+, where _server_ is the name of your server.
|
51
|
+
|
52
|
+
3. Scat starts on the specimen edit page. Hover over the edit form entry question mark to
|
53
|
+
describe the field. Enter values for each field.
|
54
|
+
|
55
|
+
4. Enter five or more letters in the Diagnosis or Tissue Site and wait briefly to
|
56
|
+
bring up a list of matching caTissue values.
|
57
|
+
|
58
|
+
5. Press the Submit button to create a new specimen.
|
59
|
+
|
60
|
+
The Diagnosis and Tissue Site term => controlled value matches are cached locally and
|
61
|
+
persistently. Subsequent term auto-completion is very fast.
|
62
|
+
|
63
|
+
Within a session, the first save takes a while to find the Collection Protocol, Site and
|
64
|
+
other information. Subsequent saves are faster. Successive creation of new specimens
|
65
|
+
for the same patient and pathology report are considerably faster.
|
66
|
+
|
67
|
+
Customization
|
68
|
+
-------------
|
69
|
+
Scat is a reference implementation which captures minimal specimen information. Adding
|
70
|
+
edit fields is done in a single simple text configuration file.
|
71
|
+
|
72
|
+
Enhance Scat for your own site as follows:
|
73
|
+
|
74
|
+
1. Install [git](http://git-scm.com/) on your workstation if necessary.
|
75
|
+
|
76
|
+
2. Install Scat as described in the Installation section above.
|
77
|
+
|
78
|
+
3. Make a workspace directory on your workstation.
|
79
|
+
|
80
|
+
4. From that directory, execute +git clone git://github.com/caruby/scat.git+
|
81
|
+
|
82
|
+
5. Modify the +conf/fields.yaml+ configuration file to add edit fields.
|
83
|
+
|
84
|
+
6. Modify the +scat/public/stylesheets/scat.css+ file to change the web display.
|
85
|
+
|
86
|
+
7. Add views and routes to this [Sinatra](http://www.sinatrarb.com/) application as you see fit.
|
87
|
+
|
88
|
+
8. Run Scat with your changes by executing the following in the workspace +scat+ directory:
|
89
|
+
|
90
|
+
rackup
|
91
|
+
|
92
|
+
9. See your changes by opening a web browser on +http://localhost:4567/+.
|
93
|
+
|
94
|
+
11. Change the version number in the +lib/scat/version.rb+ file by appending a branch number,
|
95
|
+
e.g. change the base version +1.2.2+ to +1.2.2.1+
|
96
|
+
|
97
|
+
10. Package your changes by executing the following:
|
98
|
+
|
99
|
+
rake gem
|
100
|
+
|
101
|
+
11. Copy the resulting gem file to your server.
|
102
|
+
|
103
|
+
12. On the server, install the new gem, e.g.:
|
104
|
+
|
105
|
+
gem install caruby-scat-1.2.2.1.gem
|
106
|
+
|
107
|
+
You can make your changes public by forking the Scat repository:
|
108
|
+
|
109
|
+
1. Register for a [GitHub](https://github.com) account, if you don't already have one.
|
110
|
+
|
111
|
+
2. Navigate to the Scat [repository](https://github.com/caruby/scat).
|
112
|
+
|
113
|
+
3. Press the Fork button in the upper right.
|
114
|
+
|
115
|
+
4. Fork the repository to your GitHub account.
|
116
|
+
|
117
|
+
5. Set the git origin in your workstation +scat+ directory, e.g.:
|
118
|
+
|
119
|
+
git config --replace-all remote.origin.url git@github.com:mygitaccount/scat.git
|
120
|
+
|
121
|
+
6. Commit the changes to your local git repository.
|
122
|
+
|
123
|
+
7. Push the changes to your fork with the command:
|
124
|
+
|
125
|
+
git push origin master
|
126
|
+
|
127
|
+
Your GitHub fork is publicly visible. You can see other Scat forks by searching on the
|
128
|
+
term +scat+ in GitHub.
|
129
|
+
|
130
|
+
|
131
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require File.expand_path('version', File.dirname(__FILE__) + '/lib/scat')
|
3
|
+
|
4
|
+
desc "Default: run all tests"
|
5
|
+
task :default => :test
|
6
|
+
|
7
|
+
desc "Launch Scat"
|
8
|
+
task :launch do
|
9
|
+
jruby "bin/scat"
|
10
|
+
end
|
11
|
+
|
12
|
+
# the gem name
|
13
|
+
GEM = 'caruby-scat'
|
14
|
+
GEM_VERSION = Scat::VERSION
|
15
|
+
|
16
|
+
WINDOWS = (Config::CONFIG['host_os'] =~ /mingw|win32|cygwin/ ? true : false) rescue false
|
17
|
+
SUDO = WINDOWS ? '' : 'sudo'
|
18
|
+
|
19
|
+
desc 'Builds the gem'
|
20
|
+
task :gem do
|
21
|
+
sh "jgem build #{GEM}.gemspec"
|
22
|
+
end
|
23
|
+
|
24
|
+
desc 'Installs the gem'
|
25
|
+
task :install => :gem do
|
26
|
+
sh "#{SUDO} jgem install #{GEM}-#{GEM_VERSION}.gem"
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'Documents the API'
|
30
|
+
task :doc do
|
31
|
+
FileUtils.rm_rf 'doc/api'
|
32
|
+
sh "yardoc"
|
33
|
+
end
|
34
|
+
|
35
|
+
desc 'Runs the specs'
|
36
|
+
task :spec do
|
37
|
+
Dir['spec/**/*_spec.rb'].each { |f| sh "rspec #{f}" rescue nil }
|
38
|
+
end
|
39
|
+
|
40
|
+
desc 'Runs the tests'
|
41
|
+
task :test => :spec
|
data/bin/scat
ADDED
data/bin/scatseed
ADDED
data/caruby-scat.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'date'
|
2
|
+
require File.dirname(__FILE__) + '/lib/scat/version'
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 'caruby-scat'
|
6
|
+
s.summary = 'Simple caTissue web application'
|
7
|
+
s.description = s.summary + '. See the home page for more information.'
|
8
|
+
s.version = Scat::VERSION
|
9
|
+
s.date = Date.today
|
10
|
+
s.author = "OHSU"
|
11
|
+
s.email = 'caruby.org@gmail.com'
|
12
|
+
s.homepage = 'https://github.com/caruby/scat'
|
13
|
+
s.require_path = 'lib'
|
14
|
+
s.bindir = 'bin'
|
15
|
+
s.files = `git ls-files`.split("\n") << 'ext/redis-server'
|
16
|
+
s.test_files = `git ls-files features spec test`.split("\n")
|
17
|
+
s.executables = `git ls-files bin`.split("\n").map { |f| File.basename(f) }
|
18
|
+
s.add_runtime_dependency 'bundler'
|
19
|
+
s.add_runtime_dependency 'rack'
|
20
|
+
s.add_runtime_dependency 'sinatra'
|
21
|
+
s.add_runtime_dependency 'haml'
|
22
|
+
s.add_runtime_dependency 'redis'
|
23
|
+
s.add_runtime_dependency 'redis-store'
|
24
|
+
s.add_runtime_dependency 'jruby-openssl'
|
25
|
+
s.add_runtime_dependency 'caruby-small'
|
26
|
+
s.add_development_dependency 'yard'
|
27
|
+
s.add_development_dependency 'rake'
|
28
|
+
s.has_rdoc = 'yard'
|
29
|
+
s.license = 'MIT'
|
30
|
+
end
|