ms-core 0.0.7 → 0.0.9

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 CHANGED
@@ -1 +1 @@
1
- 0.0.7
1
+ 0.0.9
File without changes
data/lib/openany.rb ADDED
@@ -0,0 +1,23 @@
1
+
2
+ # takes a filename or an io object, hands a rewinded io object to the
3
+ # reciever and then closes the file or places the io in the original
4
+ # position.
5
+ def openany(arg, &block)
6
+ io =
7
+ if arg.is_a?(String) # filename
8
+ File.open(arg)
9
+ else
10
+ orig_pos = arg.pos
11
+ arg.rewind
12
+ arg
13
+ end
14
+ reply = block.call(io)
15
+ if arg.is_a?(String) # filename
16
+ io.close
17
+ else
18
+ arg.pos = orig_pos
19
+ end
20
+ reply
21
+ end
22
+
23
+
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 7
9
- version: 0.0.7
8
+ - 9
9
+ version: 0.0.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Simon Chiang
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-09 00:00:00 -07:00
18
+ date: 2011-02-21 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -60,7 +60,7 @@ files:
60
60
  - README.rdoc
61
61
  - Rakefile
62
62
  - VERSION
63
- - lib/cv/cv.rb
63
+ - lib/cv.rb
64
64
  - lib/cv/description.rb
65
65
  - lib/cv/param.rb
66
66
  - lib/ms.rb
@@ -79,6 +79,7 @@ files:
79
79
  - lib/ms/mass/aa.rb
80
80
  - lib/ms/spectrum.rb
81
81
  - lib/ms/support/binary_search.rb
82
+ - lib/openany.rb
82
83
  - spec/ms/calc_spec.rb
83
84
  - spec/ms/data_spec.rb
84
85
  - spec/ms/support/binary_search_spec.rb