metamri 0.1.19 → 0.1.20
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/VERSION +1 -1
- data/lib/metamri/core_additions.rb +6 -12
- data/metamri.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.20
|
@@ -1,13 +1,11 @@
|
|
1
1
|
require 'tmpdir'
|
2
2
|
class String
|
3
|
-
|
4
|
-
=begin rdoc
|
5
|
-
Does same basic string replacements to ensure valid filenames.
|
6
|
-
=end
|
3
|
+
# Does same basic string replacements to ensure valid filenames.
|
7
4
|
def escape_filename
|
8
5
|
mgsub([[/[\s\:\)\(\/\?\,]+/, "-"], [/\*/, "star"], [/\./,""]])
|
9
6
|
end
|
10
7
|
|
8
|
+
# gsub multiple pairs of regexp's
|
11
9
|
def mgsub(key_value_pairs=[].freeze)
|
12
10
|
regexp_fragments = key_value_pairs.collect { |k,v| k }
|
13
11
|
gsub(Regexp.union(*regexp_fragments)) do |match|
|
@@ -18,7 +16,7 @@ Does same basic string replacements to ensure valid filenames.
|
|
18
16
|
end
|
19
17
|
|
20
18
|
class Pathname
|
21
|
-
MIN_PFILE_SIZE = 10_000_000
|
19
|
+
MIN_PFILE_SIZE = 10_000_000 unless MIN_PFILE_SIZE
|
22
20
|
|
23
21
|
def each_subdirectory
|
24
22
|
each_entry do |leaf|
|
@@ -49,10 +47,6 @@ class Pathname
|
|
49
47
|
end
|
50
48
|
end
|
51
49
|
|
52
|
-
# def first_pfile(&block)
|
53
|
-
# Pathname.new(filename).local_copy { block }
|
54
|
-
# end
|
55
|
-
|
56
50
|
def first_dicom
|
57
51
|
entries.each do |leaf|
|
58
52
|
branch = self + leaf
|
@@ -96,10 +90,11 @@ class Pathname
|
|
96
90
|
tempdir = Dir.mktmpdir('local_orig')
|
97
91
|
|
98
92
|
entries.each do |leaf|
|
99
|
-
branch = self + leaf
|
93
|
+
puts branch = self + leaf
|
100
94
|
next if branch.directory?
|
101
|
-
|
95
|
+
ignore_patterns.collect { |pat| next if leaf.to_s =~ pattern }
|
102
96
|
next if branch.should_be_skipped
|
97
|
+
puts "Locally provisioning #{leaf}"
|
103
98
|
lc = branch.local_copy(tempdir)
|
104
99
|
lc.chmod(0444 | 0200 | 0020 )
|
105
100
|
end
|
@@ -117,7 +112,6 @@ class Pathname
|
|
117
112
|
passed a block. If it is passed a block, it will create the local copy
|
118
113
|
and ensure the local copy is deleted.
|
119
114
|
=end
|
120
|
-
|
121
115
|
def local_copy(tempdir = Dir.mktmpdir, &block)
|
122
116
|
tfbase = self.to_s =~ /\.bz2$/ ? self.basename.to_s.chomp(".bz2") : self.basename.to_s
|
123
117
|
tfbase.escape_filename
|
data/metamri.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{metamri}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.20"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristopher J. Kosmatka"]
|
12
|
-
s.date = %q{2010-07-
|
12
|
+
s.date = %q{2010-07-15}
|
13
13
|
s.description = %q{Extraction of MRI metadata and insertion into compatible sqlite3 databases.}
|
14
14
|
s.email = %q{kk4@medicine.wisc.edu}
|
15
15
|
s.executables = ["import_study.rb", "import_visit.rb", "import_respiratory_files.rb", "list_visit", "convert_visit.rb"]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metamri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 20
|
10
|
+
version: 0.1.20
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kristopher J. Kosmatka
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-15 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|