Skip to content

Commit

Permalink
Add ignore list for fixtures broken upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
svoop committed Feb 9, 2024
1 parent 6985e59 commit 82de2dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
@@ -1,6 +1,7 @@
## Main

Nothing so far
#### Changes
* Add ignore list for fixtures broken upstream

## 1.1.5

Expand Down
13 changes: 9 additions & 4 deletions lib/tasks/fixtures.rake
Expand Up @@ -5,6 +5,9 @@ require_relative '../notam/translation'

namespace :fixtures do
DEFAULT_FIRS = 'ED,LF,LO,LS'
IGNORE = [
'LFBB_R0188_24' # broken - duplicate F item
]

desc "Fetch new NOTAM fixtures for comma separated informal two letter ICAO FIR codes (default: #{DEFAULT_FIRS})"
task :fetch, [:firs] do |_, args|
Expand All @@ -21,9 +24,11 @@ namespace :fixtures do
response.body.scan(/<pre>(.+?)<\/pre>/im) do |message|
message = message.first
if NOTAM::Message.supported_format? message
next unless message.match %r{^(\w+?)/(\w+?)\s+\w+\s+Q\)\s+(\w+?)/}
name = [$3, $1, $2].join('_')
next if IGNORE.include? name
counter += 1
id = message.split(/\s/, 2).first.sub(/\W+/, '_')
File.write(fixtures_path.join("#{id}.txt"), message)
File.write(fixtures_path.join(name + '.txt'), message)
end
end
puts "#{counter} fixtures downloaded"
Expand All @@ -46,8 +51,8 @@ namespace :fixtures do
end
end

desc "Clean current test NOTAM fixtures"
task :clean do
desc "Clear current test NOTAM fixtures"
task :clear do
fixtures_path.rmtree
end

Expand Down

0 comments on commit 82de2dc

Please sign in to comment.