obo_parser 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/obo_parser.rb +17 -17
  3. data/obo_parser.gemspec +1 -1
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
data/lib/obo_parser.rb CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  # uses the PhyloTree parser/lexer engine by Krishna Dole which in turn was based on
3
2
  # Thomas Mailund's <mailund@birc.dk> 'newick-1.0.5' Python library
4
3
 
@@ -37,7 +36,7 @@ module OboParser
37
36
 
38
37
  class Stanza
39
38
  # Make special reference to several specific types of tags (:name, :id), subclasses will remove additional special typs from :other_tags
40
- attr_accessor :name, :id, :other_tags
39
+ attr_accessor :name, :id, :def, :other_tags
41
40
 
42
41
  def initialize(tags)
43
42
  @other_tags = []
@@ -56,6 +55,8 @@ module OboParser
56
55
  @id = new_tag
57
56
  when 'name'
58
57
  @name = new_tag
58
+ when 'def'
59
+ @def = new_tag
59
60
  else
60
61
  @other_tags.push(new_tag)
61
62
  end
@@ -75,24 +76,23 @@ module OboParser
75
76
 
76
77
  end
77
78
 
79
+ # TODO: likely deprecate and run with one model (Stanza)
78
80
  class Term < Stanza
79
- attr_accessor :def
81
+ # attr_accessor :some_term_specific_def
80
82
  def initialize(tags)
81
83
  super
82
-
83
- anonymous_tags = []
84
-
85
- # Loop through "unclaimed" tags and reference those specific to Term
86
- while @other_tags.size != 0
87
- t = @other_tags.shift
88
- case t.tag
89
- when 'def'
90
- @def = t
91
- else
92
- anonymous_tags.push(t)
93
- end
94
- end
95
- @other_tags = anonymous_tags
84
+ # anonymous_tags = []
85
+ # # Loop through "unclaimed" tags and reference those specific to Term
86
+ # while @other_tags.size != 0
87
+ # t = @other_tags.shift
88
+ # case t.tag
89
+ # when 'def'
90
+ # @def = t
91
+ # else
92
+ # anonymous_tags.push(t)
93
+ # end
94
+ # end
95
+ # @other_tags = anonymous_tags
96
96
  end
97
97
  end
98
98
 
data/obo_parser.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{obo_parser}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mjy"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obo_parser
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - mjy