swissparser 0.8.0 → 0.8.1
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/CHANGELOG.rdoc +5 -0
- data/README.rdoc +12 -3
- data/lib/swissparser.rb +21 -18
- metadata +1 -1
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -20,10 +20,17 @@ be stable enough to be used for bioinformatics research.
|
|
20
20
|
|
21
21
|
See tutorials: http://wiki.github.com/paradigmatic/SwissParser
|
22
22
|
|
23
|
-
|
24
23
|
== REQUIREMENTS:
|
25
24
|
|
26
|
-
|
25
|
+
SwissParser uses only pure standard ruby.
|
26
|
+
|
27
|
+
Thanks to multiruby it was successfuly tested with
|
28
|
+
versions:
|
29
|
+
|
30
|
+
* 1.9.1-p243
|
31
|
+
* 1.8.7-p174
|
32
|
+
* 1.8.6-p383
|
33
|
+
* jruby-bin-1.3.1
|
27
34
|
|
28
35
|
If you want to participate in SwissParser developpement, you will need the gem *bones*.
|
29
36
|
|
@@ -53,5 +60,7 @@ version you can clone the project with git:
|
|
53
60
|
|
54
61
|
== LICENSE:
|
55
62
|
|
56
|
-
|
63
|
+
Free and open software distributed under GPLv3.
|
64
|
+
|
65
|
+
See the included LICENSE file for details.
|
57
66
|
|
data/lib/swissparser.rb
CHANGED
@@ -19,7 +19,7 @@ along with SwissParser. If not, see <http://www.gnu.org/licenses/>.
|
|
19
19
|
|
20
20
|
module Swiss
|
21
21
|
|
22
|
-
VERSION = "0.8.
|
22
|
+
VERSION = "0.8.1"
|
23
23
|
|
24
24
|
# This class defines parsing rules. Its methods
|
25
25
|
# are accessible within the +rules+ section of
|
@@ -77,24 +77,27 @@ module Swiss
|
|
77
77
|
|
78
78
|
include InstanceExecHelper
|
79
79
|
|
80
|
-
#
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
80
|
+
#Method instance_exec exists since version 1.9
|
81
|
+
if RUBY_VERSION < "1.9"
|
82
|
+
#Used to execute rules and action using the ParsingContext as context
|
83
|
+
#Stolen from http://eigenclass.org/hiki/bounded+space+instance_exec
|
84
|
+
def instance_exec(*args, &block)
|
85
|
+
begin
|
86
|
+
old_critical, Thread.critical = Thread.critical, true
|
87
|
+
n = 0
|
88
|
+
n += 1 while respond_to?(mname="__instance_exec#{n}")
|
89
|
+
InstanceExecHelper.module_eval{ define_method(mname, &block) }
|
90
|
+
ensure
|
91
|
+
Thread.critical = old_critical
|
92
|
+
end
|
93
|
+
begin
|
94
|
+
ret = send(mname, *args)
|
95
|
+
ensure
|
96
|
+
InstanceExecHelper.module_eval{ remove_method(mname) } rescue nil
|
97
|
+
end
|
98
|
+
ret
|
95
99
|
end
|
96
|
-
|
97
|
-
end
|
100
|
+
end
|
98
101
|
|
99
102
|
end
|
100
103
|
|