dicom 0.9 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +6 -0
- data/lib/dicom/ruby_extensions.rb +33 -33
- data/lib/dicom/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.rdoc
CHANGED
@@ -12,6 +12,39 @@ class String
|
|
12
12
|
#
|
13
13
|
alias __original_unpack__ unpack
|
14
14
|
|
15
|
+
# Returns true for all values that LOOK like a DICOM name - they may not be valid.
|
16
|
+
#
|
17
|
+
def dicom_name?
|
18
|
+
self==self.dicom_titleize
|
19
|
+
end
|
20
|
+
|
21
|
+
# Returns true for all strings that LOOK like a DICOM method name - they may not be valid.
|
22
|
+
#
|
23
|
+
def dicom_method?
|
24
|
+
self == self.dicom_underscore
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns a proper DICOM method name string.
|
28
|
+
#
|
29
|
+
def dicom_methodize
|
30
|
+
self.gsub(/^3/,'three_').gsub(/[#*?!]/,' ').gsub(', ',' ').gsub('&','and').gsub(' - ','_').gsub(' / ','_').gsub(/[\s\-\.\,\/\\]/,'_').gsub(/[\(\)\']/,'').gsub(/\_+/, '_').downcase
|
31
|
+
end
|
32
|
+
|
33
|
+
# Capitalizes all the words and replaces some characters in the string to make a nicer looking title.
|
34
|
+
#
|
35
|
+
def dicom_titleize
|
36
|
+
self.dicom_underscore.gsub(/_/, " ").gsub(/\b('?[a-z])/) { $1.capitalize }
|
37
|
+
end
|
38
|
+
|
39
|
+
# Makes an underscored, lowercase form from the string expression.
|
40
|
+
#
|
41
|
+
def dicom_underscore
|
42
|
+
word = self.dup
|
43
|
+
word.tr!("-", "_")
|
44
|
+
word.downcase!
|
45
|
+
word
|
46
|
+
end
|
47
|
+
|
15
48
|
# Divides a string into a number of sub-strings of exactly equal length, and returns these in an array.
|
16
49
|
# The length of self must be a multiple of parts, or an error will be raised.
|
17
50
|
#
|
@@ -101,39 +134,6 @@ class String
|
|
101
134
|
end
|
102
135
|
end
|
103
136
|
|
104
|
-
# Returns true for all values that LOOK like a DICOM name - they may not be valid.
|
105
|
-
#
|
106
|
-
def dicom_name?
|
107
|
-
self==self.titleize
|
108
|
-
end
|
109
|
-
|
110
|
-
# Returns true for all strings that LOOK like a DICOM method name - they may not be valid.
|
111
|
-
#
|
112
|
-
def dicom_method?
|
113
|
-
self == self.underscore
|
114
|
-
end
|
115
|
-
|
116
|
-
# Returns a proper DICOM method name string.
|
117
|
-
#
|
118
|
-
def dicom_methodize
|
119
|
-
self.gsub(/^3/,'three_').gsub(/[#*?!]/,' ').gsub(', ',' ').gsub('&','and').gsub(' - ','_').gsub(' / ','_').gsub(/[\s\-\.\,\/\\]/,'_').gsub(/[\(\)\']/,'').gsub(/\_+/, '_').downcase
|
120
|
-
end
|
121
|
-
|
122
|
-
# Capitalizes all the words and replaces some characters in the string to make a nicer looking title.
|
123
|
-
#
|
124
|
-
def titleize
|
125
|
-
self.underscore.gsub(/_/, " ").gsub(/\b('?[a-z])/) { $1.capitalize }
|
126
|
-
end
|
127
|
-
|
128
|
-
# Makes an underscored, lowercase form from the string expression.
|
129
|
-
#
|
130
|
-
def underscore
|
131
|
-
word = self.dup
|
132
|
-
word.tr!("-", "_")
|
133
|
-
word.downcase!
|
134
|
-
word
|
135
|
-
end
|
136
|
-
|
137
137
|
end
|
138
138
|
|
139
139
|
|
data/lib/dicom/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: dicom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version:
|
5
|
+
version: 0.9.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Christoffer Lervag
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-27 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
requirements: []
|
139
139
|
|
140
140
|
rubyforge_project: dicom
|
141
|
-
rubygems_version: 1.8.
|
141
|
+
rubygems_version: 1.8.3
|
142
142
|
signing_key:
|
143
143
|
specification_version: 3
|
144
144
|
summary: Library for handling DICOM files and DICOM network communication.
|