gst-kitchen 0.5.0 → 0.6.1

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/gst-kitchen.gemspec CHANGED
@@ -17,6 +17,8 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
+ gem.required_ruby_version = '~> 1.9.3'
21
+
20
22
  gem.add_dependency "yajl-ruby"
21
23
  gem.add_dependency "trollop"
22
24
  gem.add_dependency "rake"
@@ -1,9 +1,11 @@
1
1
  class Episode < Struct.new(:number, :name, :length, :media, :auphonic_uuid, :published_at, :summary, :chapters)
2
2
  include Comparable
3
3
 
4
- def self.from_auphonic(production)
4
+ attr_accessor :podcast
5
+
6
+ def self.from_auphonic(podcast, production)
5
7
  data = production.meta
6
- /GST(?<number>\d{3})/ =~ data["data"]["metadata"]["title"]
8
+ /#{podcast.handle}(?<number>\d{3})/ =~ data["data"]["metadata"]["title"]
7
9
 
8
10
  metadata = {
9
11
  auphonic_uuid: data["data"]["uuid"],
@@ -20,7 +22,7 @@ class Episode < Struct.new(:number, :name, :length, :media, :auphonic_uuid, :pub
20
22
  }
21
23
  end
22
24
 
23
- episode = self.new
25
+ episode = self.new podcast
24
26
 
25
27
  episode.number = metadata[:number]
26
28
  episode.name = metadata[:name]
@@ -39,12 +41,15 @@ class Episode < Struct.new(:number, :name, :length, :media, :auphonic_uuid, :pub
39
41
  episode
40
42
  end
41
43
 
42
- def self.from_yaml(yaml_file)
43
- YAML.load_file(yaml_file)
44
+ def self.from_yaml(podcast, yaml_file)
45
+ episode = YAML.load_file(yaml_file)
46
+ episode.podcast = podcast
47
+ episode
44
48
  end
45
49
 
46
- def initialize(*args)
47
- super
50
+ def initialize(podcast=nil, *args)
51
+ @podcast = podcast
52
+ super(*args)
48
53
  end
49
54
 
50
55
  def <=>(other)
@@ -56,7 +61,7 @@ class Episode < Struct.new(:number, :name, :length, :media, :auphonic_uuid, :pub
56
61
  end
57
62
 
58
63
  def handle
59
- "GST#{"%03i" % self.number}"
64
+ "#{podcast.handle}#{"%03i" % self.number}"
60
65
  end
61
66
 
62
67
  def rfc_2822_date
@@ -42,12 +42,12 @@ class Podcast
42
42
 
43
43
  def load_episodes
44
44
  self.episodes = Dir[File.join(self.episodes_path, "#{handle.downcase}*.yml")].map do |yml|
45
- Episode.from_yaml(yml)
45
+ Episode.from_yaml(self, yml)
46
46
  end
47
47
  end
48
48
 
49
49
  def create_episode_from_auphonic(production)
50
- Episode.from_auphonic production
50
+ Episode.from_auphonic(self, production)
51
51
  end
52
52
 
53
53
  def episode_by_handle(handle)
@@ -76,7 +76,7 @@ class Podcast
76
76
 
77
77
  def deep_link_url(episode)
78
78
  url = URI(self.website)
79
- url.fragment = "#{episode.number}:"
79
+ url.fragment = episode.handle
80
80
  url.to_s
81
81
  end
82
82
 
@@ -1,3 +1,3 @@
1
1
  module GstKitchen
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gst-kitchen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-21 00:00:00.000000000 Z
12
+ date: 2013-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yajl-ruby
@@ -126,12 +126,9 @@ require_paths:
126
126
  required_ruby_version: !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
- - - ! '>='
129
+ - - ~>
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
132
- segments:
133
- - 0
134
- hash: 1152790057894084617
131
+ version: 1.9.3
135
132
  required_rubygems_version: !ruby/object:Gem::Requirement
136
133
  none: false
137
134
  requirements:
@@ -140,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
137
  version: '0'
141
138
  segments:
142
139
  - 0
143
- hash: 1152790057894084617
140
+ hash: -1159944381496780028
144
141
  requirements: []
145
142
  rubyforge_project:
146
143
  rubygems_version: 1.8.25