dti_nitf 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -19,3 +19,4 @@ rdoc
19
19
  pkg
20
20
 
21
21
  ## PROJECT::SPECIFIC
22
+ dti_run.rb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dti_nitf}
8
- s.version = "0.2.4"
8
+ s.version = "0.2.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mark Turner"]
12
- s.date = %q{2010-02-25}
12
+ s.date = %q{2010-02-26}
13
13
  s.description = %q{Helps you processes the 'XML' (Quotes intentional) from DTI's XML export into valid NITF documents or Story & Media objects}
14
14
  s.email = %q{mark@amerine.net}
15
15
  s.extra_rdoc_files = [
@@ -28,6 +28,10 @@ Gem::Specification.new do |s|
28
28
  "lib/dti_nitf/lookup_table.yml",
29
29
  "lib/dti_nitf/nitf.rb",
30
30
  "lib/dti_nitf/story.rb",
31
+ "test/fixtures/basic-story-2.xml",
32
+ "test/fixtures/basic-story-no-p-tags.xml",
33
+ "test/fixtures/basic-story.xml",
34
+ "test/fixtures/correction.xml",
31
35
  "test/helper.rb",
32
36
  "test/test_dti_nitf.rb",
33
37
  "test/test_dti_nitf_correx.rb"
@@ -1,11 +1,4 @@
1
1
  dir = File.dirname(__FILE__)
2
2
  %w[rubygems crack].each { |x| require x}
3
3
  require File.join(dir, 'dti_nitf/nitf')
4
- require File.join(dir, 'dti_nitf/story')
5
-
6
- # require 'pp'
7
- #
8
- # file_contents = File.read('/tmp/02/a1oly-luge 021410.xml')
9
- # story = DTI::Story.new(file_contents)
10
- #
11
- # pp story.paper
4
+ require File.join(dir, 'dti_nitf/story')
@@ -10,8 +10,6 @@ module DTI
10
10
  self.correction = false
11
11
 
12
12
  cracked = Crack::XML.parse(self.raw_xml)
13
- cracked.default =""
14
-
15
13
  if cracked["nitf"]['head']['original_storyid']
16
14
  self.correction = true
17
15
  self.original_story_id = cracked["nitf"]['head']['original_storyid'].to_i
@@ -26,18 +24,27 @@ module DTI
26
24
  self.copyright_holder = doc_data["doc.copyright"]["holder"]
27
25
  self.doc_name = doc_data["doc_name"]["name_string"]
28
26
 
29
- self.publication = pub_data["name"].rstrip
30
- self.section = pub_data["position.section"].rstrip
31
- self.pub_date = pub_data["date.publication"].rstrip
32
- self.page = pub_data["position.sequence"].rstrip.to_i
27
+ if !pub_data.nil?
28
+ self.section = pub_data["position.section"].strip
29
+ self.pub_date = pub_data["date.publication"].strip
30
+ self.page = pub_data["position.sequence"].strip.to_i
31
+ self.publication = pub_data["name"].strip
32
+ end
33
33
 
34
- self.body = doc_body["body.content"]["p"].collect{|d| "<p>#{d}</p>"}.join
35
- self.body = fix_escaped_elements(self.body)
34
+ if !doc_body["body.content"].nil? and !doc_body["body.content"]["p"].nil?
35
+ self.body = doc_body["body.content"]["p"].collect{|d| "<p>#{d.to_s.strip}</p>"}.join
36
+ if self.body.length < 30
37
+ self.body = doc_body["body.content"].collect{|d| "<p>#{d.to_s.strip}</p>"}.join
38
+ end
39
+ self.body = fix_escaped_elements(self.body)
40
+ end
36
41
 
37
42
  if !self.correction?
38
- self.byline = doc_body["body.head"]["byline"]["person"].rstrip.gsub(/^By\s/, '') if doc_body["body.head"]["byline"]
39
- self.paper = doc_body["body.head"]["byline"]["byttl"].rstrip if doc_body["body.head"]["byline"]["byttl"]
40
- self.hl1 = doc_body["body.head"]["hedline"]["hl1"].to_s.rstrip if doc_body["body.head"]["hedline"]
43
+ self.byline = doc_body["body.head"]["byline"]["person"].to_s.rstrip.gsub(/^By\s/, '') if doc_body["body.head"]["byline"]
44
+ if !doc_body["body.head"]["byline"].nil?
45
+ self.paper = doc_body["body.head"]["byline"]["byttl"].to_s.strip if doc_body["body.head"]["byline"]["byttl"]
46
+ end
47
+ self.hl1 = doc_body["body.head"]["hedline"]["hl1"].to_s.chomp.strip.gsub(/\n/,'') if doc_body["body.head"]["hedline"]
41
48
  if doc_body["body.head"]["hedline"] && doc_body["body.head"]["hedline"]["hl2"]
42
49
  self.hl2 = doc_body["body.head"]["hedline"]["hl2"].to_s.lstrip.rstrip
43
50
  end
@@ -53,6 +60,7 @@ module DTI
53
60
  return_string = string
54
61
  return_string.gsub! /\342\200[\230\231]/, "'"
55
62
  return_string.gsub! /\342\200[\234\235]/, '"'
63
+ return_string
56
64
  end
57
65
  end
58
66
  end
@@ -0,0 +1,47 @@
1
+ <?xml-stylesheet type="text/css" href="bulletin.css"?>
2
+ <!DOCTYPE nitf SYSTEM "nitf-3-2.dtd">
3
+ <nitf>
4
+ <head>
5
+ <tobject tobject.type="news">
6
+ <Keyword name = 'HNS'/><Keyword name = 'LUGE'/><Keyword name = 'OLY'/>
7
+ </tobject>
8
+ <docdata>
9
+ <doc.copyright holder="Western Communications, Inc."/>
10
+ <doc-id id-string="14032641"/>
11
+ <doc-name name-string="a1oly-luge 021410"/>
12
+ </docdata>
13
+ <pubdata name="The Bulletin " position.sequence="8 " position.section="A " date.publication="2010-02-14 "/>
14
+ </head>
15
+ <body>
16
+ <body.head>
17
+ <hedline>
18
+ <hl1><p> Luge: fast, risky and drawing red flags</p></hl1>
19
+ </hedline>
20
+ <byline>
21
+ <person>Houston Chronicle </person>
22
+ </byline>
23
+ </body.head>
24
+ <body.content>
25
+ <p> WHISTLER, British Columbia <!-- 2014(unknown) --> When the sliders gathered Saturday morning at the Whistler Sliding Centre <!-- 2014(unknown) --> ready to take to an Olympic luge run that, not 24 hours earlier, took the life of one of their competitors <!-- 2014(unknown) --> they encountered a course that was shorter, slower, and presumably safer than it had been a day earlier. They sat in a nearly silent starting area, mulling both competition and camaraderie, before launching themselves down the track again. </p><p> On other days, racing would have seemed routine, even at the Olympics. But over the course of an emotional day here, what emerged was the clear idea that athletes who participate in luge do so in part to go fast, risks be damned. Now, racing on a track that caused significant concern even prior to Friday<!-- 2019(unknown) -->s death of 21-year-old Nodar Kumaritashvili, the risks clearly can be fatal, a notion that was inescapable even in the midst of the sport<!-- 2019(unknown) -->s highest level of competition. </p><p> A stunning pall fell over the 2010 Winter Olympics after the Georgian luger was killed in a training run here, and calls are increasing for Olympic officials to ensure it doesn<!-- 2019(unknown) -->t happen again <!-- 2014(unknown) --> even if canceling the competition was the only way to do so. </p><p> But officials announced the competition would continue Saturday, though they shortened the run and made the course wall higher at the point where Kumaritashvili flew off the ice. </p><p> Officials from the International Luge Federation said Saturday they had considered postponing competition or canceling it altogether, but instead they announced they had erected a higher wall in the turn where Kumaritashvili lost control and sailed off the track, crashing into a metal pole. They altered the ice in that same area, another measure aimed at keeping sliders within the confines of the track. And they announced the men<!-- 2019(unknown) -->s event <!-- 2014(unknown) --> which includes two runs Saturday night and the final two runs today <!-- 2014(unknown) --> would begin from the women<!-- 2019(unknown) -->s starting area, shortening the course by more than 500 feet, a move that dropped speeds significantly. </p><p> Even before Friday<!-- 2019(unknown) -->s deadly crash, much of the talk about the luge centered on the threat to sliders presented by the fastest track in the world. </p><p> Safety is the dominant issue, with sliders twisting down the mountain at speeds of more than 90 mph on a 50-pound sled. (Manuel Pfister of Austria was clocked at what would be a world record 95 mph Thursday.) </p><p> The pre-games discussion of whether the $100 million track was safe swelled as sliders arrived. Once they got a taste of the track, lugers thought Curve 11 presented an especially treacherous challenge. That is where the majority of the crashes <!-- 2014(unknown) --> nearly 20 in just a few days of practice runs <!-- 2014(unknown) --> this week have occurred. </p><p> Kumaritashvili lost his life after losing control entering the final straightaway. </p><p> All but a few sliders decided to race, yet each dealt with the death of Kumaritashvili in whatever way he could. The day<!-- 2019(unknown) -->s events <!-- 2014(unknown) --> two training runs followed by the first two runs of competition in the evening <!-- 2014(unknown) --> carried on under a discernible pall, the memories of Friday<!-- 2019(unknown) -->s terrifying accident, shown repeatedly on television, still fresh. </p><p> V, a French-language Canadian television network, showed video of the Friday crash. Kumaritashvili came in high on the final turn, was thrown off his sled, and flew backward and over the left wall where he crashed with amazing force into a steel beam. </p><p> American Tony Benshoof tested the track just before the accident. He struggled through that curve too, but walked off with only a badly bruised toe. He was fortunate. </p><p> <!-- 201c(unknown) -->Because of the physics of the curves, and going at 95 miles per hour, there<!-- 2019(unknown) -->s a really small margin for error,<!-- 201d(unknown) --> Benshoof said. <!-- 201c(unknown) -->You really need to get it right from Curve 9 to get as far as Curve 13, because once you get to Curve 11 and 12, you<!-- 2019(unknown) -->re going too fast to correct yourself.<!-- 201d(unknown) --> </p><p> Many sliders might say anyone who has been anywhere near a luge track would know why it is one of the scariest and most exciting spectator sports at the games. It feeds the nature of those who participate the sport. They love the speed and overcome the fear. </p><p> Mark Grimmette, five-time Olympian and U.S. flag bearer at the opening ceremonies, said he and current luge doubles partner Brian Martin have crashed <!-- 201c(unknown) -->only three or four times<!-- 201d(unknown) --> in some 4,000 runs in training and competition over the past 13 years. </p><p> But after running down the track at Whistler, Grimmette, who says he loves pushing 3-4 Gs at 90 mph, questioned whether the sport had gone too far. <!-- 201c(unknown) -->I think we<!-- 2019(unknown) -->re probably getting close, too close to the edge,<!-- 201d(unknown) --> Grimmette said. <!-- 201c(unknown) -->The track is fast, it certainly is. You have to be on your game from (Curve) 11 down. It<!-- 2019(unknown) -->s something they definitely have to take into account when they design future tracks. </p><p> <!-- 201c(unknown) -->(A track) doesn<!-- 2019(unknown) -->t have to be faster to be tricky.<!-- 201d(unknown) --> </p><p> Luge was held out of the games until 1964 because many considered it too dangerous. Just before that first Olympic luge competition, Polish-born British slider Kazimierz Kay-Skrzypeski was killed in a crash on the Olympic course in Austria. </p><p> The games went on. So did luge. That unfortunate incident happened two weeks before the games began. </p><p> Kumaritashvili, who died while the Olympic torch was being carried through the streets of Vancouver Friday, wasn<!-- 2019(unknown) -->t among the top sliders in the world. He finished 44th in the World Cup standings and has almost no chance of winning a medal here. </p><p> The sport<!-- 2019(unknown) -->s international governing body released a statement late Friday night, about 10 hours after Kumaritashvili died, publicly blaming the 21-year-old for his own death. Athletes were attaining speeds at the Whistler Sliding Centre far exceeding what the track was designed for, but the track was not the problem. It was a user error, the statement implied. Kumaritashvili failed to compensate properly as he entered Curve 16 before he crashed at nearly 90 mph, the federation<!-- 2019(unknown) -->s statement said. It added, <!-- 201c(unknown) -->There was no indication that the accident was caused by deficiencies in the track.<!-- 201d(unknown) --> </p><p> But is inexperience the lone reason for the tragedy? </p><p> Italy<!-- 2019(unknown) -->s Armin Zoeggler, a five-time Olympian who won the gold medal at the last two Olympics, also crashed on Friday. </p><p> The province<!-- 2019(unknown) -->s coroner, the Royal Canadian Mounted Police and federation are all investigating Kumaritashvili<!-- 2019(unknown) -->s death. </p><p> <!-- 201c(unknown) -->It is a nervous situation,<!-- 201d(unknown) --> Atis Strenga, president of the Latvia Luge Federation, said. <!-- 201c(unknown) -->It<!-- 2019(unknown) -->s a big tragedy for all luge. I hope, we all hope, it<!-- 2019(unknown) -->s the first accident and the last accident in this race.<!-- 201d(unknown) --> </p><p> </p>
26
+
27
+
28
+ <media media-type="image">
29
+ <media-id>1939423</media-id>
30
+ <media-name>a1oly-luge-p2 021410</media-name>
31
+ <media-reference height="280" width="420" mime-type="image/jpeg" source="1939423.jpg"/>
32
+ <media-printcaption>Candles and flowers memorialize Nodar Kumaritashvili at Olympic Rings Park in Whistler, British Columbia. The Georgian luger was killed Friday when he lost control of his sled near the end of his training run while traveling about 89.7 mph.</media-printcaption>
33
+ <media-printproducer> New York Times News Service</media-printproducer>
34
+ <media-originalcaption>Candles and flowers comprise a memorial to luge athlete Nodar Kumaritashvili of the Republic of Georgia at Olympic Rings Park in Whistler, British Columbia, on Friday night, Feb. 12, 2010. Kumaritashvili was killed when he lost control of his luge sled near the end of his training run while traveling 144.3 kilometers per hour, or about 89.7 miles an hour. (Doug Mills/The New York Times)
35
+ </media-originalcaption>
36
+ <media-source>NYTNS</media-source>
37
+ <media-byline>DOUG MILLS</media-byline>
38
+ <media-job> </media-job>
39
+ <media-notes>26.19% 3col DWRAY</media-notes>
40
+ <media-status>Worked</media-status>
41
+ </media>
42
+ </body.content>
43
+ <body.end>
44
+ <tagline>The New York Times and The Washington Post contributed to this report. </tagline>
45
+ </body.end>
46
+ </body>
47
+ </nitf>
@@ -0,0 +1,43 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <!DOCTYPE nitf SYSTEM "nitf-3-2.dtd">
3
+ <nitf>
4
+ <head>
5
+ <meta name="project_group" content="WWX 010408"/>
6
+ <tobject tobject.type="news">
7
+ <Keyword name = '4015003'/> <Keyword name = '17000'/> <Keyword name = '41220'/>
8
+ </tobject>
9
+ <docdata>
10
+ <doc.copyright holder="Western Communications, Inc."/>
11
+ <doc-id id-string="4130342"/>
12
+ <doc-name name-string="WWX 010408"/>
13
+ </docdata>
14
+ </head>
15
+ <body>
16
+ <body.head>
17
+ <hedline>
18
+ <hl1>
19
+ High winds, snow prompt road closures, travel restrictions
20
+ </hl1><hl2></hl2>
21
+ </hedline>
22
+ <byline>
23
+ </byline>
24
+ </body.head>
25
+ <body.content>
26
+ High winds in the east and snow in the south made driving difficult on Oregon<!-- 2019(unknown) -->s two interstate highways this morning, according to the Oregon Department of Transportation.
27
+
28
+ High winds and low visibility forced the closure of sections of Interstate 84 in Northeast Oregon this morning, and heavy snow near the Oregon-California border prompted ODOT to require chains on all vehicles except those with four-wheel drive on Interstate 5 over the Siskiyous.
29
+
30
+ Officials closed an 82-mile stretch of I-84 between Hermiston and La Grande this morning, although the westbound lanes were reopened by about 10:30 a.m., according to the agency<!-- 2019(unknown) -->s Web site. Low visibility, blowing dust and debris also caused ODOT to close state Highway 11 between Pendleton and Milton-Freewater, the agency reported in a news release. Several crashes occurred in the area.
31
+
32
+ The National Weather Service has issued high-wind warnings for much of Southern Oregon - from the coast to the western portions of Lake County. Gusts could reach 90 mph in the southern Cascade and Siskiyou mountains. The warnings are in effect until 4 p.m., according to the weather service.
33
+
34
+ A blizzard warning has also been issued for the Cascades and Siskiyous in Southern Oregon and Northern California. The weather service expects very heavy snow above 4,000 feet.
35
+
36
+ In the central and north-central parts of the state, ODOT was requiring chains on Willamette Pass only. Rain was falling on Santiam Pass, Government Camp and Blue Box Pass late this morning. However, the weather service predicted the snow level in those areas would drop to 2,500 feet after midnight, and they could receive from 6-12 inches of new snow by Saturday morning.
37
+
38
+
39
+ </body.content>
40
+ <body.end>
41
+ </body.end>
42
+ </body>
43
+ </nitf>
@@ -0,0 +1,48 @@
1
+ <?xml-stylesheet type="text/css" href="bulletin.css"?>
2
+ <!DOCTYPE nitf SYSTEM "nitf-3-2.dtd">
3
+ <nitf>
4
+ <head>
5
+ <meta name="project_group" content="AIRPORT 021010"/>
6
+ <tobject tobject.type="news">
7
+ <Keyword name = '19000'/><Keyword name = '334630'/><Keyword name = '4004'/><Keyword name = '4015001'/><Keyword name = '41220'/>
8
+ </tobject>
9
+ <docdata>
10
+ <doc.copyright holder="Western Communications, Inc."/>
11
+ <doc-id id-string="13973764"/>
12
+ <doc-name name-string="AIRPORT 021010"/>
13
+ </docdata>
14
+ <pubdata name="The Bulletin " position.sequence="1 " position.section="LOCAL " date.publication="2010-02-10 "/>
15
+ </head>
16
+ <body>
17
+ <body.head>
18
+ <hedline>
19
+ <hl1><p> Master plan to focus<b> on</b> attracting <x>new </x>tenants</p></hl1><hl2><p> Optimistic <x></x>about funding, officials hope to start work on plan in April</p></hl2>
20
+ </hedline>
21
+ <byline>
22
+ <person>By Hillary Borrud </person>
23
+ <byttl>The Bulletin </byttl>
24
+ </byline>
25
+ </body.head>
26
+ <body.content>
27
+ <p> Local officials hope a new plan for the Bend Municipal Airport will encourage economic development and help resolve neighbors<!-- 2019(unknown) --> concerns, including noise from low-flying aircraft. </p><p> Bend officials hope to start work in April on a new airport master plan, which lays out where and how the city<!-- 2019(unknown) -->s airport will develop in the future. </p><p> Airport Manager Gary Judd said officials wanted to begin work on the airport master plan a year ago, but the city has struggled to find the money to pay for the project. </p><p> A consultant will likely provide a cost estimate to the city before next Wednesday<!-- 2019(unknown) -->s City Council meeting, and Judd said the cost will probably exceed the $150,000 in Federal Aviation Administration money the city will receive this year. </p><p> Officials were optimistic that the city can make up the shortfall. Bend Finance Director Sonia Andrews said the city could get money to cover the remaining cost from grants, airport revenue or the city<!-- 2019(unknown) -->s general fund. </p><p> The city also is trying to find another agency that receives FAA money and cannot use all of the money it will receive this year. Bend Municipal Airport could borrow that money this year and pay it back with Bend<!-- 2019(unknown) -->s 2011 FAA money, Andrews said. </p><p> An up-to-date plan could make it easier for the city to do development projects at the airport. The airport sits on 415 acres northeast of Bend, on unincorporated land under Deschutes County<!-- 2019(unknown) -->s jurisdiction. </p><p> In September 2009, Deschutes County Commissioners Dennis Luke and Tammy Baney said they could not support the city<!-- 2019(unknown) -->s proposal to form a 526-acre urban renewal district, which would have redirected a portion of property taxes to fund the district. </p><p> The district would have raised money for runway extensions, a new traffic control tower, highway improvements and other development. </p><p> The plan died before making it to an official vote, and Baney said at the time she would not be ready to vote on the issue until the city updated its airport master plan. </p><p> Baney said Tuesday that it would not have been appropriate to allow development at the airport based on an old plan, and the process of drafting a new plan will provide an opportunity for neighbors and others to give input on the airport<!-- 2019(unknown) -->s future. </p><p> Luke said Tuesday that without a more up-to-date airport master plan, he could not determine whether the city needed the renewal district. </p><p> The current airport master plan was completed in 1999, updated in 2002 and covers about 20 years. The process of drafting a new 20-year plan will take about a year and will include public meetings. </p><p> The FAA will give the city input throughout the process, and the city needs the federal agency to sign off on the city<!-- 2019(unknown) -->s final vision of how the airport will develop in the future, Judd said. </p><p> Councilor Jim Clinton said the new airport master plan could help resolve questions about what type of businesses belong at the airport and how closely they should be tied to aviation. </p><p> <!-- 201c(unknown) -->I personally like having a place where small businesses are doing some stuff that<!-- 2019(unknown) -->s not 100 percent aviation-related,<!-- 201d(unknown) --> Clinton said. The new plan also could set rules for how low aircraft can fly in areas around the airport, and other activities that impact neighbors. </p><p> Councilor Mark Capell said the document is important because the city needs an updated plan to receive federal grants for the airport and because it helps the city prepare for the airport<!-- 2019(unknown) -->s future. </p><p> <!-- 201c(unknown) -->The airport is one of the economic engines for our community,<!-- 201d(unknown) --> Capell said. </p><p> </p>
28
+
29
+
30
+ <media media-type="image">
31
+ <media-id>1932102</media-id>
32
+ <media-name>airport-g1 021010</media-name>
33
+ <media-reference height="100" width="205" mime-type="application/postscript" source="1932102.eps"/>
34
+ <media-printcaption></media-printcaption>
35
+ <media-printproducer> </media-printproducer>
36
+ <media-originalcaption>Locator map of Bend Airport. Ramberg </media-originalcaption>
37
+ <media-source> </media-source>
38
+ <media-byline> </media-byline>
39
+ <media-job>airport 021010</media-job>
40
+ <media-notes> </media-notes>
41
+ <media-status>Worked</media-status>
42
+ </media>
43
+ </body.content>
44
+ <body.end>
45
+ <tagline>Hillary Borrud can be reached at 541-617-7829 or at hborrud@bendbulletin.com. </tagline>
46
+ </body.end>
47
+ </body>
48
+ </nitf>
@@ -0,0 +1,30 @@
1
+ <?xml-stylesheet type="text/css" href="bulletin.css"?>
2
+ <!DOCTYPE nitf SYSTEM "nitf-3-2.dtd">
3
+ <nitf>
4
+ <head>
5
+
6
+ <docdata>
7
+ <doc.copyright holder="Western Communications, Inc."/>
8
+ <doc-id id-string="14022204"/>
9
+ <doc-name name-string="CORREX 021410"/>
10
+ </docdata>
11
+ <pubdata name="The Bulletin " position.sequence="1 " position.section="A " date.publication="2010-02-14 "/>
12
+ <original-storyid>14015998</original-storyid>
13
+ </head>
14
+ <body>
15
+ <body.head>
16
+ <hedline>
17
+ <hl1></hl1><hl2></hl2>
18
+ </hedline>
19
+ <byline>
20
+ </byline>
21
+ </body.head>
22
+ <body.content>
23
+ <hl2><p> Correction </p></hl2><p> In a column titled <!-- 201c(unknown) -->The power and joy of libraries,<!-- 201d(unknown) --> which appears today on Page F1, Deschutes Public Library Director Todd Dunkelberg<!-- 2019(unknown) -->s name is incorrect. </p><p> The Bulletin regrets the error.</p>
24
+
25
+
26
+ </body.content>
27
+ <body.end>
28
+ </body.end>
29
+ </body>
30
+ </nitf>
@@ -1,106 +1,12 @@
1
1
  require 'helper'
2
+ require 'pp'
2
3
 
3
4
  class TestDtiNitf < Test::Unit::TestCase
4
- @@xml = <<-EOT
5
- <?xml-stylesheet type="text/css" href="bulletin.css"?>
6
- <!DOCTYPE nitf SYSTEM "nitf-3-2.dtd">
7
- <nitf>
8
- <head>
9
- <meta name="project_group" content="AIRPORT 021010"/>
10
- <tobject tobject.type="news">
11
- <Keyword name = '19000'/><Keyword name = '334630'/><Keyword name = '4004'/><Keyword name = '4015001'/><Keyword name = '41220'/>
12
- </tobject>
13
- <docdata>
14
- <doc.copyright holder="Western Communications, Inc."/>
15
- <doc-id id-string="13973764"/>
16
- <doc-name name-string="AIRPORT 021010"/>
17
- </docdata>
18
- <pubdata name="The Bulletin " position.sequence="1 " position.section="LOCAL " date.publication="2010-02-10 "/>
19
- </head>
20
- <body>
21
- <body.head>
22
- <hedline>
23
- <hl1><p> Master plan to focus<b> on</b> attracting <x>new </x>tenants</p></hl1><hl2><p> Optimistic <x></x>about funding, officials hope to start work on plan in April</p></hl2>
24
- </hedline>
25
- <byline>
26
- <person>By Hillary Borrud </person>
27
- <byttl>The Bulletin </byttl>
28
- </byline>
29
- </body.head>
30
- <body.content>
31
- <p> Local officials hope a new plan for the Bend Municipal Airport will encourage economic development and help resolve neighbors<!-- 2019(unknown) --> concerns, including noise from low-flying aircraft. </p><p> Bend officials hope to start work in April on a new airport master plan, which lays out where and how the city<!-- 2019(unknown) -->s airport will develop in the future. </p><p> Airport Manager Gary Judd said officials wanted to begin work on the airport master plan a year ago, but the city has struggled to find the money to pay for the project. </p><p> A consultant will likely provide a cost estimate to the city before next Wednesday<!-- 2019(unknown) -->s City Council meeting, and Judd said the cost will probably exceed the $150,000 in Federal Aviation Administration money the city will receive this year. </p><p> Officials were optimistic that the city can make up the shortfall. Bend Finance Director Sonia Andrews said the city could get money to cover the remaining cost from grants, airport revenue or the city<!-- 2019(unknown) -->s general fund. </p><p> The city also is trying to find another agency that receives FAA money and cannot use all of the money it will receive this year. Bend Municipal Airport could borrow that money this year and pay it back with Bend<!-- 2019(unknown) -->s 2011 FAA money, Andrews said. </p><p> An up-to-date plan could make it easier for the city to do development projects at the airport. The airport sits on 415 acres northeast of Bend, on unincorporated land under Deschutes County<!-- 2019(unknown) -->s jurisdiction. </p><p> In September 2009, Deschutes County Commissioners Dennis Luke and Tammy Baney said they could not support the city<!-- 2019(unknown) -->s proposal to form a 526-acre urban renewal district, which would have redirected a portion of property taxes to fund the district. </p><p> The district would have raised money for runway extensions, a new traffic control tower, highway improvements and other development. </p><p> The plan died before making it to an official vote, and Baney said at the time she would not be ready to vote on the issue until the city updated its airport master plan. </p><p> Baney said Tuesday that it would not have been appropriate to allow development at the airport based on an old plan, and the process of drafting a new plan will provide an opportunity for neighbors and others to give input on the airport<!-- 2019(unknown) -->s future. </p><p> Luke said Tuesday that without a more up-to-date airport master plan, he could not determine whether the city needed the renewal district. </p><p> The current airport master plan was completed in 1999, updated in 2002 and covers about 20 years. The process of drafting a new 20-year plan will take about a year and will include public meetings. </p><p> The FAA will give the city input throughout the process, and the city needs the federal agency to sign off on the city<!-- 2019(unknown) -->s final vision of how the airport will develop in the future, Judd said. </p><p> Councilor Jim Clinton said the new airport master plan could help resolve questions about what type of businesses belong at the airport and how closely they should be tied to aviation. </p><p> <!-- 201c(unknown) -->I personally like having a place where small businesses are doing some stuff that<!-- 2019(unknown) -->s not 100 percent aviation-related,<!-- 201d(unknown) --> Clinton said. The new plan also could set rules for how low aircraft can fly in areas around the airport, and other activities that impact neighbors. </p><p> Councilor Mark Capell said the document is important because the city needs an updated plan to receive federal grants for the airport and because it helps the city prepare for the airport<!-- 2019(unknown) -->s future. </p><p> <!-- 201c(unknown) -->The airport is one of the economic engines for our community,<!-- 201d(unknown) --> Capell said. </p><p> </p>
32
-
33
-
34
- <media media-type="image">
35
- <media-id>1932102</media-id>
36
- <media-name>airport-g1 021010</media-name>
37
- <media-reference height="100" width="205" mime-type="application/postscript" source="1932102.eps"/>
38
- <media-printcaption></media-printcaption>
39
- <media-printproducer> </media-printproducer>
40
- <media-originalcaption>Locator map of Bend Airport. Ramberg </media-originalcaption>
41
- <media-source> </media-source>
42
- <media-byline> </media-byline>
43
- <media-job>airport 021010</media-job>
44
- <media-notes> </media-notes>
45
- <media-status>Worked</media-status>
46
- </media>
47
- </body.content>
48
- <body.end>
49
- <tagline>Hillary Borrud can be reached at 541-617-7829 or at hborrud@bendbulletin.com. </tagline>
50
- </body.end>
51
- </body>
52
- </nitf>
53
- EOT
5
+ @@xml = File.read('fixtures/basic-story.xml')
6
+ @@xml2 = File.read('fixtures/basic-story-2.xml')
7
+ @@xml_no_p_tags = File.read('fixtures/basic-story-no-p-tags.xml')
8
+
54
9
 
55
- @@xml2 = <<-EOT
56
- <?xml-stylesheet type="text/css" href="bulletin.css"?>
57
- <!DOCTYPE nitf SYSTEM "nitf-3-2.dtd">
58
- <nitf>
59
- <head>
60
- <tobject tobject.type="news">
61
- <Keyword name = 'HNS'/><Keyword name = 'LUGE'/><Keyword name = 'OLY'/>
62
- </tobject>
63
- <docdata>
64
- <doc.copyright holder="Western Communications, Inc."/>
65
- <doc-id id-string="14032641"/>
66
- <doc-name name-string="a1oly-luge 021410"/>
67
- </docdata>
68
- <pubdata name="The Bulletin " position.sequence="8 " position.section="A " date.publication="2010-02-14 "/>
69
- </head>
70
- <body>
71
- <body.head>
72
- <hedline>
73
- <hl1><p> Luge: fast, risky and drawing red flags</p></hl1>
74
- </hedline>
75
- <byline>
76
- <person>Houston Chronicle </person>
77
- </byline>
78
- </body.head>
79
- <body.content>
80
- <p> WHISTLER, British Columbia <!-- 2014(unknown) --> When the sliders gathered Saturday morning at the Whistler Sliding Centre <!-- 2014(unknown) --> ready to take to an Olympic luge run that, not 24 hours earlier, took the life of one of their competitors <!-- 2014(unknown) --> they encountered a course that was shorter, slower, and presumably safer than it had been a day earlier. They sat in a nearly silent starting area, mulling both competition and camaraderie, before launching themselves down the track again. </p><p> On other days, racing would have seemed routine, even at the Olympics. But over the course of an emotional day here, what emerged was the clear idea that athletes who participate in luge do so in part to go fast, risks be damned. Now, racing on a track that caused significant concern even prior to Friday<!-- 2019(unknown) -->s death of 21-year-old Nodar Kumaritashvili, the risks clearly can be fatal, a notion that was inescapable even in the midst of the sport<!-- 2019(unknown) -->s highest level of competition. </p><p> A stunning pall fell over the 2010 Winter Olympics after the Georgian luger was killed in a training run here, and calls are increasing for Olympic officials to ensure it doesn<!-- 2019(unknown) -->t happen again <!-- 2014(unknown) --> even if canceling the competition was the only way to do so. </p><p> But officials announced the competition would continue Saturday, though they shortened the run and made the course wall higher at the point where Kumaritashvili flew off the ice. </p><p> Officials from the International Luge Federation said Saturday they had considered postponing competition or canceling it altogether, but instead they announced they had erected a higher wall in the turn where Kumaritashvili lost control and sailed off the track, crashing into a metal pole. They altered the ice in that same area, another measure aimed at keeping sliders within the confines of the track. And they announced the men<!-- 2019(unknown) -->s event <!-- 2014(unknown) --> which includes two runs Saturday night and the final two runs today <!-- 2014(unknown) --> would begin from the women<!-- 2019(unknown) -->s starting area, shortening the course by more than 500 feet, a move that dropped speeds significantly. </p><p> Even before Friday<!-- 2019(unknown) -->s deadly crash, much of the talk about the luge centered on the threat to sliders presented by the fastest track in the world. </p><p> Safety is the dominant issue, with sliders twisting down the mountain at speeds of more than 90 mph on a 50-pound sled. (Manuel Pfister of Austria was clocked at what would be a world record 95 mph Thursday.) </p><p> The pre-games discussion of whether the $100 million track was safe swelled as sliders arrived. Once they got a taste of the track, lugers thought Curve 11 presented an especially treacherous challenge. That is where the majority of the crashes <!-- 2014(unknown) --> nearly 20 in just a few days of practice runs <!-- 2014(unknown) --> this week have occurred. </p><p> Kumaritashvili lost his life after losing control entering the final straightaway. </p><p> All but a few sliders decided to race, yet each dealt with the death of Kumaritashvili in whatever way he could. The day<!-- 2019(unknown) -->s events <!-- 2014(unknown) --> two training runs followed by the first two runs of competition in the evening <!-- 2014(unknown) --> carried on under a discernible pall, the memories of Friday<!-- 2019(unknown) -->s terrifying accident, shown repeatedly on television, still fresh. </p><p> V, a French-language Canadian television network, showed video of the Friday crash. Kumaritashvili came in high on the final turn, was thrown off his sled, and flew backward and over the left wall where he crashed with amazing force into a steel beam. </p><p> American Tony Benshoof tested the track just before the accident. He struggled through that curve too, but walked off with only a badly bruised toe. He was fortunate. </p><p> <!-- 201c(unknown) -->Because of the physics of the curves, and going at 95 miles per hour, there<!-- 2019(unknown) -->s a really small margin for error,<!-- 201d(unknown) --> Benshoof said. <!-- 201c(unknown) -->You really need to get it right from Curve 9 to get as far as Curve 13, because once you get to Curve 11 and 12, you<!-- 2019(unknown) -->re going too fast to correct yourself.<!-- 201d(unknown) --> </p><p> Many sliders might say anyone who has been anywhere near a luge track would know why it is one of the scariest and most exciting spectator sports at the games. It feeds the nature of those who participate the sport. They love the speed and overcome the fear. </p><p> Mark Grimmette, five-time Olympian and U.S. flag bearer at the opening ceremonies, said he and current luge doubles partner Brian Martin have crashed <!-- 201c(unknown) -->only three or four times<!-- 201d(unknown) --> in some 4,000 runs in training and competition over the past 13 years. </p><p> But after running down the track at Whistler, Grimmette, who says he loves pushing 3-4 Gs at 90 mph, questioned whether the sport had gone too far. <!-- 201c(unknown) -->I think we<!-- 2019(unknown) -->re probably getting close, too close to the edge,<!-- 201d(unknown) --> Grimmette said. <!-- 201c(unknown) -->The track is fast, it certainly is. You have to be on your game from (Curve) 11 down. It<!-- 2019(unknown) -->s something they definitely have to take into account when they design future tracks. </p><p> <!-- 201c(unknown) -->(A track) doesn<!-- 2019(unknown) -->t have to be faster to be tricky.<!-- 201d(unknown) --> </p><p> Luge was held out of the games until 1964 because many considered it too dangerous. Just before that first Olympic luge competition, Polish-born British slider Kazimierz Kay-Skrzypeski was killed in a crash on the Olympic course in Austria. </p><p> The games went on. So did luge. That unfortunate incident happened two weeks before the games began. </p><p> Kumaritashvili, who died while the Olympic torch was being carried through the streets of Vancouver Friday, wasn<!-- 2019(unknown) -->t among the top sliders in the world. He finished 44th in the World Cup standings and has almost no chance of winning a medal here. </p><p> The sport<!-- 2019(unknown) -->s international governing body released a statement late Friday night, about 10 hours after Kumaritashvili died, publicly blaming the 21-year-old for his own death. Athletes were attaining speeds at the Whistler Sliding Centre far exceeding what the track was designed for, but the track was not the problem. It was a user error, the statement implied. Kumaritashvili failed to compensate properly as he entered Curve 16 before he crashed at nearly 90 mph, the federation<!-- 2019(unknown) -->s statement said. It added, <!-- 201c(unknown) -->There was no indication that the accident was caused by deficiencies in the track.<!-- 201d(unknown) --> </p><p> But is inexperience the lone reason for the tragedy? </p><p> Italy<!-- 2019(unknown) -->s Armin Zoeggler, a five-time Olympian who won the gold medal at the last two Olympics, also crashed on Friday. </p><p> The province<!-- 2019(unknown) -->s coroner, the Royal Canadian Mounted Police and federation are all investigating Kumaritashvili<!-- 2019(unknown) -->s death. </p><p> <!-- 201c(unknown) -->It is a nervous situation,<!-- 201d(unknown) --> Atis Strenga, president of the Latvia Luge Federation, said. <!-- 201c(unknown) -->It<!-- 2019(unknown) -->s a big tragedy for all luge. I hope, we all hope, it<!-- 2019(unknown) -->s the first accident and the last accident in this race.<!-- 201d(unknown) --> </p><p> </p>
81
-
82
-
83
- <media media-type="image">
84
- <media-id>1939423</media-id>
85
- <media-name>a1oly-luge-p2 021410</media-name>
86
- <media-reference height="280" width="420" mime-type="image/jpeg" source="1939423.jpg"/>
87
- <media-printcaption>Candles and flowers memorialize Nodar Kumaritashvili at Olympic Rings Park in Whistler, British Columbia. The Georgian luger was killed Friday when he lost control of his sled near the end of his training run while traveling about 89.7 mph.</media-printcaption>
88
- <media-printproducer> New York Times News Service</media-printproducer>
89
- <media-originalcaption>Candles and flowers comprise a memorial to luge athlete Nodar Kumaritashvili of the Republic of Georgia at Olympic Rings Park in Whistler, British Columbia, on Friday night, Feb. 12, 2010. Kumaritashvili was killed when he lost control of his luge sled near the end of his training run while traveling 144.3 kilometers per hour, or about 89.7 miles an hour. (Doug Mills/The New York Times)
90
- </media-originalcaption>
91
- <media-source>NYTNS</media-source>
92
- <media-byline>DOUG MILLS</media-byline>
93
- <media-job> </media-job>
94
- <media-notes>26.19% 3col DWRAY</media-notes>
95
- <media-status>Worked</media-status>
96
- </media>
97
- </body.content>
98
- <body.end>
99
- <tagline>The New York Times and The Washington Post contributed to this report. </tagline>
100
- </body.end>
101
- </body>
102
- </nitf>
103
- EOT
104
10
  context "An NITF Parser instance" do
105
11
  setup do
106
12
  @story = DTI::Story.new(@@xml)
@@ -154,6 +60,7 @@ class TestDtiNitf < Test::Unit::TestCase
154
60
  setup do
155
61
  @story = DTI::Story.new(@@xml)
156
62
  @story2 = DTI::Story.new(@@xml2)
63
+ @story_with_no_p_tags = DTI::Story.new(@@xml_no_p_tags)
157
64
  end
158
65
 
159
66
  should "have a doc_id" do
@@ -168,15 +75,24 @@ class TestDtiNitf < Test::Unit::TestCase
168
75
  assert @story.doc_name == "AIRPORT 021010"
169
76
  end
170
77
 
171
- should "have a publication data" do
78
+ should "have a publication" do
172
79
  assert @story.publication == "The Bulletin"
80
+ end
81
+
82
+ should "have a section" do
173
83
  assert @story.section == "LOCAL"
84
+ end
85
+
86
+ should "have a pub date" do
174
87
  assert @story.pub_date == "2010-02-10"
88
+ end
89
+
90
+ should "have a page" do
175
91
  assert @story.page == 1
176
92
  end
177
93
 
178
94
  should "include all paragraphs" do
179
- assert @story.body == "<p> Local officials hope a new plan for the Bend Municipal Airport will encourage economic development and help resolve neighbors&#x2019 concerns, including noise from low-flying aircraft. </p><p> Bend officials hope to start work in April on a new airport master plan, which lays out where and how the city&#x2019s airport will develop in the future. </p><p> Airport Manager Gary Judd said officials wanted to begin work on the airport master plan a year ago, but the city has struggled to find the money to pay for the project. </p><p> A consultant will likely provide a cost estimate to the city before next Wednesday&#x2019s City Council meeting, and Judd said the cost will probably exceed the $150,000 in Federal Aviation Administration money the city will receive this year. </p><p> Officials were optimistic that the city can make up the shortfall. Bend Finance Director Sonia Andrews said the city could get money to cover the remaining cost from grants, airport revenue or the city&#x2019s general fund. </p><p> The city also is trying to find another agency that receives FAA money and cannot use all of the money it will receive this year. Bend Municipal Airport could borrow that money this year and pay it back with Bend&#x2019s 2011 FAA money, Andrews said. </p><p> An up-to-date plan could make it easier for the city to do development projects at the airport. The airport sits on 415 acres northeast of Bend, on unincorporated land under Deschutes County&#x2019s jurisdiction. </p><p> In September 2009, Deschutes County Commissioners Dennis Luke and Tammy Baney said they could not support the city&#x2019s proposal to form a 526-acre urban renewal district, which would have redirected a portion of property taxes to fund the district. </p><p> The district would have raised money for runway extensions, a new traffic control tower, highway improvements and other development. </p><p> The plan died before making it to an official vote, and Baney said at the time she would not be ready to vote on the issue until the city updated its airport master plan. </p><p> Baney said Tuesday that it would not have been appropriate to allow development at the airport based on an old plan, and the process of drafting a new plan will provide an opportunity for neighbors and others to give input on the airport&#x2019s future. </p><p> Luke said Tuesday that without a more up-to-date airport master plan, he could not determine whether the city needed the renewal district. </p><p> The current airport master plan was completed in 1999, updated in 2002 and covers about 20 years. The process of drafting a new 20-year plan will take about a year and will include public meetings. </p><p> The FAA will give the city input throughout the process, and the city needs the federal agency to sign off on the city&#x2019s final vision of how the airport will develop in the future, Judd said. </p><p> Councilor Jim Clinton said the new airport master plan could help resolve questions about what type of businesses belong at the airport and how closely they should be tied to aviation. </p><p> \"I personally like having a place where small businesses are doing some stuff that&#x2019s not 100 percent aviation-related,\" Clinton said. The new plan also could set rules for how low aircraft can fly in areas around the airport, and other activities that impact neighbors. </p><p> Councilor Mark Capell said the document is important because the city needs an updated plan to receive federal grants for the airport and because it helps the city prepare for the airport&#x2019s future. </p><p> \"The airport is one of the economic engines for our community,\" Capell said. </p><p></p>"
95
+ assert @story.body == '<p>Local officials hope a new plan for the Bend Municipal Airport will encourage economic development and help resolve neighbors&#x2019 concerns, including noise from low-flying aircraft.</p><p>Bend officials hope to start work in April on a new airport master plan, which lays out where and how the city&#x2019s airport will develop in the future.</p><p>Airport Manager Gary Judd said officials wanted to begin work on the airport master plan a year ago, but the city has struggled to find the money to pay for the project.</p><p>A consultant will likely provide a cost estimate to the city before next Wednesday&#x2019s City Council meeting, and Judd said the cost will probably exceed the $150,000 in Federal Aviation Administration money the city will receive this year.</p><p>Officials were optimistic that the city can make up the shortfall. Bend Finance Director Sonia Andrews said the city could get money to cover the remaining cost from grants, airport revenue or the city&#x2019s general fund.</p><p>The city also is trying to find another agency that receives FAA money and cannot use all of the money it will receive this year. Bend Municipal Airport could borrow that money this year and pay it back with Bend&#x2019s 2011 FAA money, Andrews said.</p><p>An up-to-date plan could make it easier for the city to do development projects at the airport. The airport sits on 415 acres northeast of Bend, on unincorporated land under Deschutes County&#x2019s jurisdiction.</p><p>In September 2009, Deschutes County Commissioners Dennis Luke and Tammy Baney said they could not support the city&#x2019s proposal to form a 526-acre urban renewal district, which would have redirected a portion of property taxes to fund the district.</p><p>The district would have raised money for runway extensions, a new traffic control tower, highway improvements and other development.</p><p>The plan died before making it to an official vote, and Baney said at the time she would not be ready to vote on the issue until the city updated its airport master plan.</p><p>Baney said Tuesday that it would not have been appropriate to allow development at the airport based on an old plan, and the process of drafting a new plan will provide an opportunity for neighbors and others to give input on the airport&#x2019s future.</p><p>Luke said Tuesday that without a more up-to-date airport master plan, he could not determine whether the city needed the renewal district.</p><p>The current airport master plan was completed in 1999, updated in 2002 and covers about 20 years. The process of drafting a new 20-year plan will take about a year and will include public meetings.</p><p>The FAA will give the city input throughout the process, and the city needs the federal agency to sign off on the city&#x2019s final vision of how the airport will develop in the future, Judd said.</p><p>Councilor Jim Clinton said the new airport master plan could help resolve questions about what type of businesses belong at the airport and how closely they should be tied to aviation.</p><p>"I personally like having a place where small businesses are doing some stuff that&#x2019s not 100 percent aviation-related," Clinton said. The new plan also could set rules for how low aircraft can fly in areas around the airport, and other activities that impact neighbors.</p><p>Councilor Mark Capell said the document is important because the city needs an updated plan to receive federal grants for the airport and because it helps the city prepare for the airport&#x2019s future.</p><p>"The airport is one of the economic engines for our community," Capell said.</p><p></p>'
180
96
  end
181
97
 
182
98
  should "have a byline" do
@@ -199,5 +115,9 @@ class TestDtiNitf < Test::Unit::TestCase
199
115
  should "process correcly if there is no byttl tag" do
200
116
  assert_nil @story2.paper
201
117
  end
118
+
119
+ should "still have a body if there are not <p></p> tags" do
120
+ assert @story_with_no_p_tags.body == '<p></p><p>High winds in the east and snow in the south made driving difficult on Oregon&#x2019s two interstate highways this morning, according to the Oregon Department of Transportation.</p><p></p><p>High winds and low visibility forced the closure of sections of Interstate 84 in Northeast Oregon this morning, and heavy snow near the Oregon-California border prompted ODOT to require chains on all vehicles except those with four-wheel drive on Interstate 5 over the Siskiyous.</p><p></p><p>Officials closed an 82-mile stretch of I-84 between Hermiston and La Grande this morning, although the westbound lanes were reopened by about 10:30 a.m., according to the agency&#x2019s Web site. Low visibility, blowing dust and debris also caused ODOT to close state Highway 11 between Pendleton and Milton-Freewater, the agency reported in a news release. Several crashes occurred in the area.</p><p></p><p>The National Weather Service has issued high-wind warnings for much of Southern Oregon - from the coast to the western portions of Lake County. Gusts could reach 90 mph in the southern Cascade and Siskiyou mountains. The warnings are in effect until 4 p.m., according to the weather service.</p><p></p><p>A blizzard warning has also been issued for the Cascades and Siskiyous in Southern Oregon and Northern California. The weather service expects very heavy snow above 4,000 feet.</p><p></p><p>In the central and north-central parts of the state, ODOT was requiring chains on Willamette Pass only. Rain was falling on Santiam Pass, Government Camp and Blue Box Pass late this morning. However, the weather service predicted the snow level in those areas would drop to 2,500 feet after midnight, and they could receive from 6-12 inches of new snow by Saturday morning.</p><p></p><p></p><p></p>'
121
+ end
202
122
  end
203
123
  end
@@ -1,38 +1,7 @@
1
1
  require 'helper'
2
2
 
3
3
  class TestDtiNitfCorrex < Test::Unit::TestCase
4
- @@xml = <<-EOT
5
- <?xml-stylesheet type="text/css" href="bulletin.css"?>
6
- <!DOCTYPE nitf SYSTEM "nitf-3-2.dtd">
7
- <nitf>
8
- <head>
9
-
10
- <docdata>
11
- <doc.copyright holder="Western Communications, Inc."/>
12
- <doc-id id-string="14022204"/>
13
- <doc-name name-string="CORREX 021410"/>
14
- </docdata>
15
- <pubdata name="The Bulletin " position.sequence="1 " position.section="A " date.publication="2010-02-14 "/>
16
- <original-storyid>14015998</original-storyid>
17
- </head>
18
- <body>
19
- <body.head>
20
- <hedline>
21
- <hl1></hl1><hl2></hl2>
22
- </hedline>
23
- <byline>
24
- </byline>
25
- </body.head>
26
- <body.content>
27
- <hl2><p> Correction </p></hl2><p> In a column titled <!-- 201c(unknown) -->The power and joy of libraries,<!-- 201d(unknown) --> which appears today on Page F1, Deschutes Public Library Director Todd Dunkelberg<!-- 2019(unknown) -->s name is incorrect. </p><p> The Bulletin regrets the error.</p>
28
-
29
-
30
- </body.content>
31
- <body.end>
32
- </body.end>
33
- </body>
34
- </nitf>
35
- EOT
4
+ @@xml = File.read('fixtures/correction.xml')
36
5
 
37
6
  context "A Story Correction" do
38
7
  setup do
@@ -45,7 +14,8 @@ class TestDtiNitfCorrex < Test::Unit::TestCase
45
14
  end
46
15
 
47
16
  should "have a body" do
48
- assert @story.body == "<p> In a column titled \"The power and joy of libraries,\" which appears today on Page F1, Deschutes Public Library Director Todd Dunkelberg&#x2019s name is incorrect. </p><p> The Bulletin regrets the error.</p>"
17
+ puts @story.body
18
+ assert @story.body == '<p>In a column titled "The power and joy of libraries," which appears today on Page F1, Deschutes Public Library Director Todd Dunkelberg&#x2019s name is incorrect.</p><p>The Bulletin regrets the error.</p>'
49
19
  end
50
20
 
51
21
  should "have a hl1" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 4
9
- version: 0.2.4
8
+ - 5
9
+ version: 0.2.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mark Turner
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-02-25 00:00:00 -08:00
17
+ date: 2010-02-26 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -64,6 +64,10 @@ files:
64
64
  - lib/dti_nitf/lookup_table.yml
65
65
  - lib/dti_nitf/nitf.rb
66
66
  - lib/dti_nitf/story.rb
67
+ - test/fixtures/basic-story-2.xml
68
+ - test/fixtures/basic-story-no-p-tags.xml
69
+ - test/fixtures/basic-story.xml
70
+ - test/fixtures/correction.xml
67
71
  - test/helper.rb
68
72
  - test/test_dti_nitf.rb
69
73
  - test/test_dti_nitf_correx.rb