dpickett-clinical 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Rakefile +18 -2
- data/clinical.gemspec +5 -1
- data/lib/clinical/agency.rb +6 -0
- data/lib/clinical/collaborator.rb +6 -0
- data/lib/clinical/lead_sponsor.rb +6 -0
- data/lib/clinical/sponsor.rb +27 -0
- metadata +5 -1
data/.gitignore
CHANGED
data/Rakefile
CHANGED
@@ -29,12 +29,27 @@ Rake::TestTask.new(:test) do |test|
|
|
29
29
|
test.verbose = true
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
namespace :rcov do
|
33
33
|
require 'rcov/rcovtask'
|
34
|
-
Rcov::RcovTask.new do |test|
|
34
|
+
Rcov::RcovTask.new(:tests) do |test|
|
35
35
|
test.libs << 'test'
|
36
36
|
test.pattern = 'test/**/*_test.rb'
|
37
|
+
test.rcov_opts = %w{--aggregate coverage.data --exclude osx\/objc,gems\/,spec\/}
|
37
38
|
test.verbose = true
|
39
|
+
end
|
40
|
+
|
41
|
+
require 'cucumber/rake/task'
|
42
|
+
Cucumber::Rake::Task.new(:cucumber) do |t|
|
43
|
+
t.rcov = true
|
44
|
+
t.rcov_opts = %w{--aggregate coverage.data --exclude osx\/objc,gems\/,features\/,spec\/ -o "features_rcov"}
|
45
|
+
end
|
46
|
+
end
|
47
|
+
begin
|
48
|
+
desc "Run both specs and features to generate aggregated coverage"
|
49
|
+
task :rcov do |t|
|
50
|
+
rm "coverage.data" if File.exist?("coverage.data")
|
51
|
+
Rake::Task["rcov:cucumber"].invoke
|
52
|
+
Rake::Task["rcov:tests"].invoke
|
38
53
|
end
|
39
54
|
rescue LoadError
|
40
55
|
task :rcov do
|
@@ -45,6 +60,7 @@ end
|
|
45
60
|
begin
|
46
61
|
require 'cucumber/rake/task'
|
47
62
|
Cucumber::Rake::Task.new(:features)
|
63
|
+
|
48
64
|
rescue LoadError
|
49
65
|
task :features do
|
50
66
|
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
|
data/clinical.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{clinical}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.5"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Dan Pickett"]
|
@@ -25,15 +25,19 @@ Gem::Specification.new do |s|
|
|
25
25
|
"features/support/env.rb",
|
26
26
|
"lib/clinical.rb",
|
27
27
|
"lib/clinical/address.rb",
|
28
|
+
"lib/clinical/agency.rb",
|
29
|
+
"lib/clinical/collaborator.rb",
|
28
30
|
"lib/clinical/collection.rb",
|
29
31
|
"lib/clinical/condition.rb",
|
30
32
|
"lib/clinical/contact.rb",
|
31
33
|
"lib/clinical/extensions.rb",
|
32
34
|
"lib/clinical/intervention.rb",
|
35
|
+
"lib/clinical/lead_sponsor.rb",
|
33
36
|
"lib/clinical/location.rb",
|
34
37
|
"lib/clinical/outcome.rb",
|
35
38
|
"lib/clinical/primary_outcome.rb",
|
36
39
|
"lib/clinical/secondary_outcome.rb",
|
40
|
+
"lib/clinical/sponsor.rb",
|
37
41
|
"lib/clinical/status.rb",
|
38
42
|
"lib/clinical/trial.rb",
|
39
43
|
"test/clinical/trial_test.rb",
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Clinical
|
2
|
+
module Sponsor
|
3
|
+
def self.included(base)
|
4
|
+
base.class_eval do
|
5
|
+
attr_accessor :name
|
6
|
+
include HappyMapper
|
7
|
+
end
|
8
|
+
base.extend(ClassMethods)
|
9
|
+
base.send(:include, InstanceMethods)
|
10
|
+
end
|
11
|
+
|
12
|
+
module InstanceMethods
|
13
|
+
def to_s
|
14
|
+
name
|
15
|
+
end
|
16
|
+
end
|
17
|
+
module ClassMethods
|
18
|
+
def parse(xml, options = {})
|
19
|
+
xml.find(tag_name).collect do |n|
|
20
|
+
item = new
|
21
|
+
item.name = n.content.chomp.strip
|
22
|
+
item
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dpickett-clinical
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Pickett
|
@@ -64,15 +64,19 @@ files:
|
|
64
64
|
- features/support/env.rb
|
65
65
|
- lib/clinical.rb
|
66
66
|
- lib/clinical/address.rb
|
67
|
+
- lib/clinical/agency.rb
|
68
|
+
- lib/clinical/collaborator.rb
|
67
69
|
- lib/clinical/collection.rb
|
68
70
|
- lib/clinical/condition.rb
|
69
71
|
- lib/clinical/contact.rb
|
70
72
|
- lib/clinical/extensions.rb
|
71
73
|
- lib/clinical/intervention.rb
|
74
|
+
- lib/clinical/lead_sponsor.rb
|
72
75
|
- lib/clinical/location.rb
|
73
76
|
- lib/clinical/outcome.rb
|
74
77
|
- lib/clinical/primary_outcome.rb
|
75
78
|
- lib/clinical/secondary_outcome.rb
|
79
|
+
- lib/clinical/sponsor.rb
|
76
80
|
- lib/clinical/status.rb
|
77
81
|
- lib/clinical/trial.rb
|
78
82
|
- test/clinical/trial_test.rb
|