dropcaster 0.0.6 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +5 -5
  2. data/.gemnasium.yml +1 -0
  3. data/.gitignore +12 -14
  4. data/.rubocop.yml +34 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +20 -5
  7. data/CONTRIBUTING.md +18 -0
  8. data/Dockerfile +4 -0
  9. data/Gemfile +2 -0
  10. data/Gemfile.lock +309 -65
  11. data/Guardfile +8 -6
  12. data/LICENSE.txt +1 -1
  13. data/README.markdown +43 -37
  14. data/Rakefile +46 -2
  15. data/{TODO → TODO.markdown} +0 -0
  16. data/VISION.markdown +52 -18
  17. data/Vagrantfile +10 -0
  18. data/bin/dropcaster +57 -53
  19. data/bin/lstags +29 -28
  20. data/dropcaster.gemspec +31 -20
  21. data/lib/dropcaster.rb +2 -15
  22. data/lib/dropcaster/channel.rb +54 -43
  23. data/lib/dropcaster/channel_file_locator.rb +8 -5
  24. data/lib/dropcaster/contributors.rb +39 -0
  25. data/lib/dropcaster/errors.rb +6 -4
  26. data/lib/dropcaster/item.rb +20 -14
  27. data/lib/dropcaster/log_formatter.rb +10 -0
  28. data/lib/dropcaster/logging.rb +13 -0
  29. data/lib/dropcaster/version.rb +3 -1
  30. data/templates/channel.html.erb +3 -6
  31. data/templates/channel.rss.erb +6 -5
  32. data/test/Vagrantfile +3 -1
  33. data/test/bin/vagrant-status +37 -31
  34. data/test/extensions/windows.rb +3 -1
  35. data/test/fixtures/extension.MP3 +0 -0
  36. data/test/fixtures/special &.mp3 +0 -0
  37. data/test/fixtures/test_template.json.erb +3 -4
  38. data/test/helper.rb +4 -1
  39. data/test/unit/test_app.rb +29 -24
  40. data/test/unit/test_channel.rb +9 -5
  41. data/test/unit/test_channel_locator.rb +8 -5
  42. data/test/unit/test_channel_xml.rb +29 -9
  43. data/test/unit/{test_item.rb → test_itunes_item.rb} +5 -6
  44. data/website/.gitignore +2 -0
  45. data/website/README.markdown +8 -0
  46. data/website/_config.yml +14 -0
  47. data/website/_front_matter/contributing.yaml +5 -0
  48. data/website/_front_matter/index.yaml +3 -0
  49. data/website/_front_matter/vision.yaml +5 -0
  50. data/website/_includes/footer.html +55 -0
  51. data/website/_includes/head.html +11 -0
  52. data/website/_includes/header.html +27 -0
  53. data/website/_layouts/default.html +20 -0
  54. data/website/_layouts/page.html +14 -0
  55. data/website/_layouts/post.html +15 -0
  56. data/website/_sass/_base.scss +204 -0
  57. data/website/_sass/_layout.scss +236 -0
  58. data/website/_sass/_syntax-highlighting.scss +67 -0
  59. data/website/css/main.scss +49 -0
  60. data/website/deploy.sh +23 -0
  61. data/website/feed.xml +30 -0
  62. metadata +150 -23
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dropcaster
2
4
  class ConfigurationError < StandardError
3
5
  def initialize(msg)
@@ -6,14 +8,14 @@ module Dropcaster
6
8
  end
7
9
 
8
10
  class MissingAttributeError < ConfigurationError
9
- def initialize(missingAttribute)
10
- super("#{missingAttribute} is a mandatory channel attribute, but it is missing.")
11
+ def initialize(missing_attribute)
12
+ super("#{missing_attribute} is a mandatory channel attribute, but it is missing.")
11
13
  end
12
14
  end
13
15
 
14
16
  class AmbiguousSourcesError < ConfigurationError
15
- def initialize(ambiguousSources)
16
- super("The list of sources is ambiguous. Can't derive common directory from these: #{ambiguousSources.inspect}")
17
+ def initialize(ambiguous_sources)
18
+ super("The list of sources is ambiguous. Can't derive common directory from these: #{ambiguous_sources.inspect}")
17
19
  end
18
20
  end
19
21
 
@@ -1,31 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'pathname'
1
4
  require 'mp3info'
2
5
  require 'digest/sha1'
6
+ require 'dropcaster/logging'
3
7
 
4
8
  module Dropcaster
5
9
  class Item
6
- attr_reader :file_name, :tag, :tag2, :duration, :file_size, :uuid, :pub_date, :pub_date, :lyrics
7
- attr_accessor :artist, :image_url, :url, :keywords
10
+ include Logging
11
+
12
+ attr_reader :file_path, :tag, :tag2, :duration, :file_size, :uuid, :pub_date, :lyrics
13
+ attr_accessor :image_url, :url, :keywords
8
14
 
9
- def initialize(file_path, options = nil)
10
- Mp3Info.open(file_path){|mp3info|
11
- @file_name = Pathname.new(File.expand_path(file_path)).relative_path_from(Pathname.new(Dir.pwd)).cleanpath.to_s
15
+ def initialize(file_path, options=nil)
16
+ Mp3Info.open(file_path) { |mp3info|
17
+ @file_path = Pathname.new(File.expand_path(file_path)).relative_path_from(Pathname.new(Dir.pwd)).cleanpath
12
18
  @tag = mp3info.tag
13
19
  @tag2 = mp3info.tag2
14
20
  @duration = mp3info.length
15
- if @tag2["ULT"]
16
- @lyrics = {};
17
- @tag2["ULT"].split(/\x00/).drop(1).each_slice(2) { |k, v| @lyrics[k] = v }
21
+ if @tag2['ULT']
22
+ @lyrics = {}
23
+ @tag2['ULT'].split(/\x00/).drop(1).each_slice(2) { |k, v| @lyrics[k] = v }
18
24
  end
19
25
  }
20
26
 
21
- @file_size = File.new(@file_name).stat.size
22
- @uuid = Digest::SHA1.hexdigest(File.read(file_name))
27
+ @file_size = File.new(file_path).stat.size
28
+ @uuid = Digest::SHA1.hexdigest(File.read(file_path))
23
29
 
24
- unless tag2.TDR.blank?
25
- @pub_date = DateTime.parse(tag2.TDR)
30
+ if tag2.TRDA.blank?
31
+ logger.info("#{file_path} has no pub date set, using the file's modification time")
32
+ @pub_date = Time.parse(File.new(file_path).mtime.to_s)
26
33
  else
27
- Dropcaster.logger.info("#{file_path} has no pub date set, using the file's modification time")
28
- @pub_date = DateTime.parse(File.new(file_name).mtime.to_s)
34
+ @pub_date = Time.parse(tag2.TRDA)
29
35
  end
30
36
  end
31
37
  end
@@ -1,6 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'logger'
2
4
 
3
5
  module Dropcaster
6
+ module Logging
7
+ attr_writer :logger
8
+
9
+ def logger
10
+ @logger ||= NullLogger.new
11
+ end
12
+ end
13
+
4
14
  class LogFormatter < Logger::Formatter
5
15
  def call(severity, time, program_name, message)
6
16
  "#{severity}: #{message}\n"
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'null_logger'
4
+
5
+ module Dropcaster
6
+ module Logging
7
+ attr_writer :logger
8
+
9
+ def logger
10
+ @logger ||= NullLogger.new
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dropcaster
2
- VERSION = '0.0.6'
4
+ VERSION = '1.2.0'
3
5
  end
@@ -26,12 +26,9 @@
26
26
  <h1>Episodes</h1>
27
27
  <% items.each{|item| %>
28
28
  <div class="item" id="<%= h(item.uuid) %>">
29
- <h1><%= item.tag.title || item.tag2.TIT2%></h1>
30
- <% unless item.tag2.SUBTITLE.blank? %>
31
- <h2><%= h(item.tag2.SUBTITLE) %></h2>
32
- <% end %>
33
- <% unless item.tag2.TT3.blank? %>
34
- <p><%= h(item.tag2.TT3) %></p>
29
+ <h1><%= h(item.tag.title || item.file_path.to_s) %></h1>
30
+ <% unless item.tag2.TT3.blank? && item.tag2.TIT3.blank? %>
31
+ <p><%= h(item.tag2.TT3 || item.tag2.TIT3) %></p>
35
32
  <% end %>
36
33
  <img src="<%= item.image_url %>"/>
37
34
  <p>Download: <a href="<%= item.url %>">MP3</a> (<%= humanize_time(item.duration.to_i) %>, <%= humanize_size(item.file_size) %>)</p>
@@ -45,14 +45,15 @@
45
45
  <% end %>
46
46
  <% items.each{|item| %>
47
47
  <item>
48
- <title><%= item.tag.title || item.tag2.TIT2%></title>
49
- <itunes:author><%= h(item.tag2.TP1 || item.tag2.TPE1) %></itunes:author>
50
- <% unless item.tag2.TT3.blank? %>
51
- <itunes:subtitle><%= h(truncate(item.tag2.TT3, 50)) %></itunes:subtitle>
52
- <itunes:summary><%= h(item.tag2.TT3) %></itunes:summary>
48
+ <title><%= h(item.tag.title || item.file_path.to_s) %></title>
49
+ <itunes:author><%= h(item.tag.artist) %></itunes:author>
50
+ <% unless item.tag2.TT3.blank? && item.tag2.TIT3.blank? %>
51
+ <itunes:subtitle><%= h(truncate(item.tag2.TT3 || item.tag2.TIT3, 50)) %></itunes:subtitle>
52
+ <itunes:summary><%= h(item.tag2.TT3 || item.tag2.TIT3) %></itunes:summary>
53
53
  <% end %>
54
54
  <itunes:image href="<%= item.image_url %>"/>
55
55
  <enclosure url="<%= item.url %>" length="<%= item.file_size %>" type="audio/mp3"/>
56
+ <link><%= item.url %></link>
56
57
  <guid isPermaLink="false"><%= h(item.uuid) %></guid>
57
58
  <pubDate><%= h(item.pub_date.to_formatted_s(:rfc822)) %></pubDate>
58
59
  <itunes:duration><%= item.duration.to_i %></itunes:duration>
data/test/Vagrantfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- mode: ruby -*-
2
4
  # vi: set ft=ruby :
3
5
 
@@ -9,7 +11,7 @@ Vagrant.configure(2) do |config|
9
11
  vb.memory = '256'
10
12
  end
11
13
 
12
- %w(1.9.1 2.0 2.1 2.2).each do |version|
14
+ %w[1.9.1 2.0 2.1 2.2].each do |version|
13
15
  ruby = "ruby#{version}"
14
16
  name = "ruby-#{version.tr('.', '-')}"
15
17
 
@@ -1,15 +1,22 @@
1
1
  #!/usr/bin/env ruby
2
- #
2
+ # frozen_string_literal: true
3
+
3
4
  require 'csv'
4
5
 
5
- headers = [
6
- 'timestamp', # is a Unix timestamp in UTC of when the message was printed.
7
- 'target', # is the target of the following output. This is empty if the message is related to Vagrant globally. Otherwise, this is generally a machine name so you can relate output to a specific machine when multi-VM is in use.
8
- 'type', # is the type of machine-readable message being outputted. There are a set of standard types which are covered later.
9
- 'data', # is zero or more comma-separated values associated with the prior type. The exact amount and meaning of this data is type-dependent, so you must read the documentation associated with the type to understand fully.
10
- ]
6
+ HEADERS = [
7
+ # Unix timestamp in UTC of when the message was printed.
8
+ 'timestamp',
9
+ # is the target of the following output. This is empty if the message is related to Vagrant globally. Otherwise, this is generally a machine name so you can relate output to a
10
+ # specific machine when multi-VM is in use.
11
+ 'target',
12
+ # is the type of machine-readable message being outputted. There are a set of standard types which are covered later.
13
+ 'type',
14
+ # is zero or more comma-separated values associated with the prior type. The exact amount and meaning of this data is
15
+ # type-dependent, so you must read the documentation associated with the type to understand fully.
16
+ 'data'
17
+ ].freeze
11
18
 
12
- types = [
19
+ TYPES = [
13
20
  'box-name', # Name of a box installed into Vagrant.
14
21
  'box-provider', # Provider for an installed box.
15
22
  'cli-command', # A subcommand of vagrant that is available.
@@ -17,8 +24,8 @@ types = [
17
24
  'provider-name', # The provider name of the target machine. targeted
18
25
  'state', # The state ID of the target machine. targeted
19
26
  'state-human-long', # Human-readable description of the state of the machine. This is the long version, and may be a paragraph or longer. targeted
20
- 'state-human-short', # Human-readable description of the state of the machine. This is the short version, limited to at most a sentence. targeted
21
- ]
27
+ 'state-human-short' # Human-readable description of the state of the machine. This is the short version, limited to at most a sentence. targeted
28
+ ].freeze
22
29
 
23
30
  module Vagrant
24
31
  Box = Struct.new(:name, :provider)
@@ -40,31 +47,30 @@ virtual_machines = Hash.new do |vms, target|
40
47
  vms[target] = Vagrant::VM.new(target)
41
48
  end
42
49
 
43
- CSV.new(ARGF, headers: headers).each do |message|
50
+ CSV.new(ARGF, headers: HEADERS).each do |message|
44
51
  vm = virtual_machines[message['target']]
45
52
  data = message['data'].split('%!(VAGRANT_COMMA)')
46
53
 
47
54
  case message['type']
48
- when 'box-name'
49
- vm.box.name = data
50
- when 'box-provider'
51
- vm.box.provider = data
52
- when 'state'
53
- vm.state.id = data
54
- when 'state-human-long'
55
- vm.state.long = data
56
- when 'state-human-short'
57
- vm.state.short = data
58
- when 'cli-command'
59
- vm.command = data
60
- when 'error-exit'
61
- vm.error = Vagrant::Error.new(data[0], data[1])
62
- when 'provider-name'
63
- vm.provider = data
64
- else
65
- raise "Unknown type: #{message['type']}"
55
+ when 'box-name'
56
+ vm.box.name = data
57
+ when 'box-provider'
58
+ vm.box.provider = data
59
+ when 'state'
60
+ vm.state.id = data
61
+ when 'state-human-long'
62
+ vm.state.long = data
63
+ when 'state-human-short'
64
+ vm.state.short = data
65
+ when 'cli-command'
66
+ vm.command = data
67
+ when 'error-exit'
68
+ vm.error = Vagrant::Error.new(data[0], data[1])
69
+ when 'provider-name'
70
+ vm.provider = data
71
+ else
72
+ raise "Unknown type: #{message['type']}"
66
73
  end
67
74
  end
68
75
 
69
- puts virtual_machines.map{|name, vm| name}
70
- #puts virtual_machines.map{|name, vm| "#{name}: #{vm.state.short}"}
76
+ puts(virtual_machines.map { |name, _| name })
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Returns true if we run on a windows platform
2
4
  #
3
5
  # Sample:
@@ -7,6 +9,6 @@
7
9
  # http://snippets.dzone.com/posts/show/2112
8
10
  #
9
11
  def Kernel.is_windows?
10
- processor, platform, *rest = RUBY_PLATFORM.split("-")
12
+ _, platform, _ = RUBY_PLATFORM.split('-')
11
13
  platform == 'mingw32'
12
14
  end
Binary file
Binary file
@@ -19,10 +19,9 @@
19
19
  "categories": ["<% categories.join('\",\"') %>"],
20
20
  "explicit" : "<%= explicit %>",
21
21
  "items" : [<% items.collect{|item| %>{
22
- "title" : "<%= item.tag.title || item.tag2.TIT2 %>",
23
- "author" : "<%= item.tag2.TP1 || item.tag2.TPE1 %>",
24
- "subtitle" : "<%= item.tag2.SUBTITLE %>",
25
- "summary" : "<%= item.tag2.TT3 %>",
22
+ "title" : "<%= item.tag.title %>",
23
+ "author" : "<%= item.tag.artist %>",
24
+ "summary" : "<%= item.tag2.TT3 || item.tag2.TIT3 %>",
26
25
  "image" : "<%= item.image_url %>",
27
26
  "enclosure" : {
28
27
  "url" : "<%= item.url %>",
data/test/helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  gem 'minitest'
2
4
  require 'minitest/autorun'
3
5
  require 'dropcaster'
@@ -7,5 +9,6 @@ require_relative 'extensions/windows'
7
9
  module DropcasterTest
8
10
  FIXTURES_DIR = File.join(File.dirname(__FILE__), 'fixtures')
9
11
  FIXTURE_ITUNES_MP3 = File.join(FIXTURES_DIR, 'iTunes.mp3')
10
- NS_ITUNES = "itunes:http://www.itunes.com/dtds/podcast-1.0.dtd"
12
+ NUMBER_OF_MP3_FILES = 3
13
+ NS_ITUNES = 'itunes:http://www.itunes.com/dtds/podcast-1.0.dtd'
11
14
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'helper'
2
4
  require 'open3'
3
5
  require 'uri'
@@ -14,24 +16,24 @@ class TestApp < TestChannelXML
14
16
  APP_SCRIPT = 'ruby bin/dropcaster'
15
17
 
16
18
  def channel_rss
17
- %x[#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3}]
19
+ `#{APP_SCRIPT} #{FIXTURES_DIR}`
18
20
  end
19
21
 
20
22
  def test_overwrite_title
21
23
  test_title = 'Alice and Bob in Wonderland'
22
- channel = channel_node(%x[#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --title '#{test_title}'])
24
+ channel = channel_node(`#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --title '#{test_title}'`)
23
25
  assert_equal(test_title, channel.find('title').first.content)
24
26
  end
25
27
 
26
28
  def test_overwrite_subtitle
27
29
  test_subtitle = 'Tales from another world that is upside down'
28
- channel = channel_node(%x[#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --subtitle '#{test_subtitle}'])
30
+ channel = channel_node(`#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --subtitle '#{test_subtitle}'`)
29
31
  assert_equal(test_subtitle, channel.find('itunes:subtitle').first.content)
30
32
  end
31
33
 
32
34
  def test_overwrite_link
33
35
  test_link = 'http://www.example.com/foo/bar'
34
- channel = channel_node(%x[#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --url '#{test_link}'])
36
+ channel = channel_node(`#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --url '#{test_link}'`)
35
37
  assert_equal(test_link, channel.find('link').first.content)
36
38
  end
37
39
 
@@ -39,14 +41,14 @@ class TestApp < TestChannelXML
39
41
  test_link_base = 'http://www.dropbox.com/foo/bar/'
40
42
  test_link_file = 'index.html'
41
43
  test_link = "#{test_link_base}#{test_link_file}"
42
- channel = channel_node(%x[#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --url '#{test_link}'])
44
+ channel = channel_node(`#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --url '#{test_link}'`)
43
45
  assert_equal(test_link, channel.find('link').first.content)
44
46
 
45
47
  options = YAML.load_file(File.join(FIXTURES_DIR, Dropcaster::CHANNEL_YML))
46
48
  assert_equal(URI.join(test_link_base, options[:image_url]).to_s, channel.find('itunes:image').first['href'])
47
49
 
48
50
  # check that the item URLs are correct, too
49
- item = channel.find("item").first
51
+ item = channel.find('item').first
50
52
  assert(item)
51
53
 
52
54
  # enclosure
@@ -59,42 +61,43 @@ class TestApp < TestChannelXML
59
61
  end
60
62
 
61
63
  def test_dir_only
62
- channel = channel_node(%x[#{APP_SCRIPT} #{FIXTURES_DIR}])
63
- assert_equal(1, channel.find('item').size)
64
+ assert_equal(NUMBER_OF_MP3_FILES, @channel.find('item').size)
64
65
  end
65
66
 
66
67
  def test_overwrite_enclosures_url
67
68
  test_enclosures_url = 'http://www.example.com/foo/bar/episodes/'
68
- channel = channel_node(%x[#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --enclosures '#{test_enclosures_url}'])
69
- item = channel.find("item").first
69
+ channel = channel_node(`#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --enclosures '#{test_enclosures_url}'`)
70
+ item = channel.find('item').first
70
71
  assert(item)
71
72
  enclosure = item.find('enclosure').first
72
73
  assert(enclosure)
73
- assert_equal(URI.join(test_enclosures_url,'test/fixtures/iTunes.mp3').to_s, enclosure['url'])
74
+ assert_equal(URI.join(test_enclosures_url, 'test/fixtures/iTunes.mp3').to_s, enclosure['url'])
74
75
  end
75
76
 
76
77
  def test_overwrite_image_url
77
78
  test_image_url = 'http://www.example.com/foo/bar/override.gif'
78
- channel = channel_node(%x[#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --image '#{test_image_url}'])
79
+ channel = channel_node(`#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --image '#{test_image_url}'`)
79
80
  assert_equal(test_image_url, channel.find('itunes:image').first['href'])
80
81
 
81
82
  # Make sure the items pick up this URL, too
82
- item = channel.find("item").first
83
+ item = channel.find('item').first
83
84
  assert(item)
84
85
  assert_equal(test_image_url, item.find('itunes:image').first['href'])
85
86
  end
86
87
 
87
88
  def test_overwrite_description
88
89
  test_description = 'Testing commandline apps is not that hard.'
89
- channel = channel_node(%x[#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --description '#{test_description}'])
90
+ channel = channel_node(`#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --description '#{test_description}'`)
90
91
  assert_equal(test_description, channel.find('description').first.content)
91
92
  assert_equal(test_description, channel.find('itunes:summary', NS_ITUNES).first.content)
92
93
  end
93
94
 
94
95
  def test_no_channel_file
95
- Open3.popen3(APP_SCRIPT){|stdin, stdout, stderr|
96
- assert_match(/ERROR: No channel file found/, stderr.read)
97
- } unless Kernel.is_windows?
96
+ unless Kernel.is_windows?
97
+ Open3.popen3(APP_SCRIPT) { |stdin, stdout, stderr|
98
+ assert_match(/ERROR: No channel file found/, stderr.read)
99
+ }
100
+ end
98
101
  end
99
102
 
100
103
  def test_overwrite_all
@@ -102,7 +105,7 @@ class TestApp < TestChannelXML
102
105
  test_link = 'http://www.example.com/bar/foot'
103
106
  test_description = 'Testing commandline apps is really not that hard.'
104
107
 
105
- channel = channel_node(%x[#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --title '#{test_title}' --url '#{test_link}' --description '#{test_description}'])
108
+ channel = channel_node(`#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --title '#{test_title}' --url '#{test_link}' --description '#{test_description}'`)
106
109
 
107
110
  assert_equal(test_title, channel.find('title').first.content)
108
111
  assert_equal(test_link, channel.find('link').first.content)
@@ -111,9 +114,11 @@ class TestApp < TestChannelXML
111
114
  end
112
115
 
113
116
  def test_channel_template_not_found
114
- Open3.popen3("#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --channel-template foo/bar/42"){|stdin, stdout, stderr|
115
- assert_match(/Unable to load template file/, stderr.read)
116
- } unless Kernel.is_windows?
117
+ unless Kernel.is_windows?
118
+ Open3.popen3("#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --channel-template foo/bar/42") { |stdin, stdout, stderr|
119
+ assert_match(/Unable to load template file/, stderr.read)
120
+ }
121
+ end
117
122
  end
118
123
 
119
124
  #
@@ -121,9 +126,9 @@ class TestApp < TestChannelXML
121
126
  #
122
127
  def test_overwrite_channel_template
123
128
  channel_template = File.join(FIXTURES_DIR, 'test_template.json.erb')
124
- channel = JSON.parse(%x[#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --channel-template #{channel_template}])
125
- assert_equal("All About Everything", channel['channel']['title'])
129
+ channel = JSON.parse(`#{APP_SCRIPT} #{FIXTURE_ITUNES_MP3} --channel-template #{channel_template}`)
130
+ assert_equal('All About Everything', channel['channel']['title'])
126
131
  end
127
132
 
128
- # TODO --channel
133
+ # TODO: --channel
129
134
  end