ms-ident 0.0.2 → 0.0.3

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.2
1
+ 0.0.3
@@ -18,6 +18,7 @@ end
18
18
  class Ms::Ident::Pepxml
19
19
  XML_STYLESHEET_LOCATION = '/tools/bin/TPP/tpp/schema/pepXML_std.xsl'
20
20
  DEFAULT_PEPXML_VERSION = MsmsPipelineAnalysis::PEPXML_VERSION
21
+ XML_ENCODING = 'UTF-8'
21
22
 
22
23
  attr_accessor :msms_pipeline_analysis
23
24
 
@@ -50,7 +51,7 @@ class Ms::Ident::Pepxml
50
51
  # if no outfile is given, an xml string is returned. summary_xml should
51
52
  # have already been set and is not influenced by the outfile given here.
52
53
  def to_xml(outfile=nil)
53
- builder = Nokogiri::XML::Builder.new
54
+ builder = Nokogiri::XML::Builder.new(:encoding => XML_ENCODING)
54
55
  msms_pipeline_analysis.to_xml(builder)
55
56
  add_stylesheet(builder.doc, Ms::Ident::Pepxml::XML_STYLESHEET_LOCATION)
56
57
  string = builder.doc.to_xml
@@ -13,6 +13,8 @@ describe "creating an Ms::Ident::Pepxml" do
13
13
  extend Ms::Ident
14
14
 
15
15
  it "can be creating in a nested fashion reflecting internal structure" do
16
+ tags_that_should_be_present = %w(msms_pipeline_analysis msms_run_summary sample_enzyme search_summary spectrum_query search_result search_hit modification_info mod_aminoacid_mass search_score)
17
+
16
18
  pepxml = Pepxml.new do |msms_pipeline_analysis|
17
19
  msms_pipeline_analysis.merge!(:summary_xml => "020.xml") do |msms_run_summary|
18
20
  # prep the sample enzyme and search_summary
@@ -84,8 +86,12 @@ describe "creating an Ms::Ident::Pepxml" do
84
86
  end
85
87
  end
86
88
  end
87
- puts pepxml.to_xml
88
- pepxml.to_xml.matches /<msms_pipeline_analysis /
89
+ xml = pepxml.to_xml
90
+ tags_that_should_be_present.each do |tag|
91
+ xml.matches /<#{tag} ?/
92
+ end
93
+ xml.matches /<\?xml version="1.0" encoding="UTF-8"\?>/
94
+ xml.matches %r{<\?xml-stylesheet type="text/xsl" href="/tools/bin/TPP/tpp/schema/pepXML_std.xsl"\?>}
89
95
  end
90
96
  end
91
97
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - John T. Prince
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-02-26 00:00:00 -07:00
17
+ date: 2011-02-28 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -169,7 +169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - ">="
171
171
  - !ruby/object:Gem::Version
172
- hash: 642659304812034666
172
+ hash: 3918611084548908133
173
173
  segments:
174
174
  - 0
175
175
  version: "0"