rpipe 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ require 'rubygems'
4
+ require 'optparse'
5
+ require 'logfile'
6
+
7
+ def summarize!
8
+ # Parse CLI Options and Spec File
9
+ cli_options = parse_options
10
+ begin
11
+ # Summarize a Directory of Logfiles
12
+ Logfile.write_summary(cli_options[:filename], cli_options[:directory], cli_options[:grouping])
13
+ rescue IOError => e
14
+ puts e
15
+ end
16
+ end
17
+
18
+ def parse_options
19
+ options = { :filename => nil, :directory => nil, :grouping => nil}
20
+ parser = OptionParser.new do |opts|
21
+ opts.banner = "Usage: #{File.basename(__FILE__)} [options]"
22
+
23
+ opts.on('-f', '--filename FILENAME', "Filename for summary (i.e. summary.csv") do |filename|
24
+ options[:filename] = filename
25
+ end
26
+
27
+ opts.on('-d', '--directory DIRECTORY', "Directory containing Button-press Response Logfiles") do |responses_dir|
28
+ options[:directory] = File.expand_path(responses_dir)
29
+ end
30
+
31
+ opts.on('-g', '--grouping', "Grouping variable for summary.") do |grouping|
32
+ options[:grouping] = grouping
33
+ end
34
+
35
+ opts.on_tail('-h', '--help', "Show this message") { puts(parser); exit }
36
+ opts.on_tail("Example: #{File.basename(__FILE__)} -f johnson.predict.visit1.response_summary.csv")
37
+ end
38
+ parser.parse!(ARGV)
39
+
40
+ return options
41
+ end
42
+
43
+ # All that for this.
44
+ summarize!
@@ -99,7 +99,14 @@ class Logfile
99
99
  File.stat(@textfile).mtime <=> File.stat(other_logfile.textfile).mtime
100
100
  end
101
101
 
102
- def self.write_summary(filename = 'tmp.csv', directory = Dir.pwd, grouping = 'version')
102
+ def self.write_summary(filename = nil, directory = nil, grouping = nil)
103
+ # One usage for this method is from the summarize_responses.rb executible,
104
+ # which doesn't allow for ordered arguments on the fly. Therefore,
105
+ # assign defaults within the method itself, not the signature.
106
+ filename ||= 'tmp.csv'
107
+ directory ||= Dir.pwd
108
+ grouping ||= 'version'
109
+
103
110
  table = self.summarize_directory(directory)
104
111
  File.open(filename, 'w') do |f|
105
112
  f.puts Ruport::Data::Grouping(table, :by => grouping).to_csv
@@ -5,14 +5,14 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rpipe}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristopher Kosmatka", "Erik Kastman"]
12
- s.date = %q{2011-03-07}
12
+ s.date = %q{2011-03-24}
13
13
  s.description = %q{Neuroimaging preprocessing the Ruby way}
14
14
  s.email = %q{kjkosmatka@gmail.com}
15
- s.executables = ["swallow_batch_run.rb", "rpipe", "create_driver.rb"]
15
+ s.executables = ["swallow_batch_run.rb", "rpipe", "summarize_responses.rb", "create_driver.rb"]
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE",
18
18
  "README",
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
28
28
  "VERSION",
29
29
  "bin/create_driver.rb",
30
30
  "bin/rpipe",
31
+ "bin/summarize_responses.rb",
31
32
  "bin/swallow_batch_run.rb",
32
33
  "lib/core_additions.rb",
33
34
  "lib/custom_methods/JohnsonMerit220Visit1Preproc.m",
@@ -155,6 +156,7 @@ Gem::Specification.new do |s|
155
156
  s.add_runtime_dependency(%q<rpipe>, [">= 0"])
156
157
  s.add_development_dependency(%q<shoulda>, [">= 0"])
157
158
  s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
159
+ s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
158
160
  s.add_runtime_dependency(%q<metamri>, [">= 0"])
159
161
  s.add_runtime_dependency(%q<log4r>, [">= 0"])
160
162
  s.add_runtime_dependency(%q<POpen4>, [">= 0"])
@@ -163,6 +165,7 @@ Gem::Specification.new do |s|
163
165
  s.add_dependency(%q<rpipe>, [">= 0"])
164
166
  s.add_dependency(%q<shoulda>, [">= 0"])
165
167
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
168
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
166
169
  s.add_dependency(%q<metamri>, [">= 0"])
167
170
  s.add_dependency(%q<log4r>, [">= 0"])
168
171
  s.add_dependency(%q<POpen4>, [">= 0"])
@@ -172,6 +175,7 @@ Gem::Specification.new do |s|
172
175
  s.add_dependency(%q<rpipe>, [">= 0"])
173
176
  s.add_dependency(%q<shoulda>, [">= 0"])
174
177
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
178
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
175
179
  s.add_dependency(%q<metamri>, [">= 0"])
176
180
  s.add_dependency(%q<log4r>, [">= 0"])
177
181
  s.add_dependency(%q<POpen4>, [">= 0"])
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpipe
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kristopher Kosmatka
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-03-07 00:00:00 -06:00
19
+ date: 2011-03-24 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -63,8 +63,8 @@ dependencies:
63
63
  requirement: *id003
64
64
  - !ruby/object:Gem::Dependency
65
65
  prerelease: false
66
- name: metamri
67
- type: :runtime
66
+ name: thoughtbot-shoulda
67
+ type: :development
68
68
  version_requirements: &id004 !ruby/object:Gem::Requirement
69
69
  none: false
70
70
  requirements:
@@ -77,7 +77,7 @@ dependencies:
77
77
  requirement: *id004
78
78
  - !ruby/object:Gem::Dependency
79
79
  prerelease: false
80
- name: log4r
80
+ name: metamri
81
81
  type: :runtime
82
82
  version_requirements: &id005 !ruby/object:Gem::Requirement
83
83
  none: false
@@ -91,7 +91,7 @@ dependencies:
91
91
  requirement: *id005
92
92
  - !ruby/object:Gem::Dependency
93
93
  prerelease: false
94
- name: POpen4
94
+ name: log4r
95
95
  type: :runtime
96
96
  version_requirements: &id006 !ruby/object:Gem::Requirement
97
97
  none: false
@@ -105,7 +105,7 @@ dependencies:
105
105
  requirement: *id006
106
106
  - !ruby/object:Gem::Dependency
107
107
  prerelease: false
108
- name: ruport
108
+ name: POpen4
109
109
  type: :runtime
110
110
  version_requirements: &id007 !ruby/object:Gem::Requirement
111
111
  none: false
@@ -117,11 +117,26 @@ dependencies:
117
117
  - 0
118
118
  version: "0"
119
119
  requirement: *id007
120
+ - !ruby/object:Gem::Dependency
121
+ prerelease: false
122
+ name: ruport
123
+ type: :runtime
124
+ version_requirements: &id008 !ruby/object:Gem::Requirement
125
+ none: false
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ hash: 3
130
+ segments:
131
+ - 0
132
+ version: "0"
133
+ requirement: *id008
120
134
  description: Neuroimaging preprocessing the Ruby way
121
135
  email: kjkosmatka@gmail.com
122
136
  executables:
123
137
  - swallow_batch_run.rb
124
138
  - rpipe
139
+ - summarize_responses.rb
125
140
  - create_driver.rb
126
141
  extensions: []
127
142
 
@@ -139,6 +154,7 @@ files:
139
154
  - VERSION
140
155
  - bin/create_driver.rb
141
156
  - bin/rpipe
157
+ - bin/summarize_responses.rb
142
158
  - bin/swallow_batch_run.rb
143
159
  - lib/core_additions.rb
144
160
  - lib/custom_methods/JohnsonMerit220Visit1Preproc.m