This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Version bump to 0.0.0

  • Loading branch information...
pengwynn committed Jan 27, 2010
1 parent eb7a26c commit 2c06a52597ef964ac3c7b69da745fc0e481f21a4
View
@@ -5,13 +5,19 @@ begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "buzzsprout"
- gem.summary = %Q{TODO: one-line summary of your gem}
- gem.description = %Q{TODO: longer description of your gem}
+ gem.summary = %Q{Ruby wrapper for the stealth mode Buzzsprout API}
+ gem.description = %Q{Ruby wrapper for the stealth mode Buzzsprout API}
gem.email = "wynn.netherland@gmail.com"
gem.homepage = "http://github.com/pengwynn/buzzsprout"
gem.authors = ["Wynn Netherland"]
- gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+ gem.add_dependency('activesupport', '>= 2.3.2')
+ gem.add_dependency('hashie', '>= 0.1.3')
+ gem.add_dependency('httparty', '>= 0.5.0')
+
+ gem.add_development_dependency('thoughtbot-shoulda', '>= 2.10.1')
+ gem.add_development_dependency('jnunemaker-matchy', '0.4.0')
+ gem.add_development_dependency('fakeweb', '>= 1.2.5')
+ gem.add_development_dependency "yard", ">= 0"
end
Jeweler::GemcutterTasks.new
rescue LoadError
View
@@ -0,0 +1 @@
+0.0.0
View
@@ -0,0 +1,31 @@
+require 'rubygems'
+require 'time'
+gem 'activesupport', '>= 2.3.2'
+require 'activesupport'
+
+gem 'hashie', '>= 0.1.3'
+require 'hashie'
+
+gem 'httparty', '>= 0.5.0'
+require 'httparty'
+
+
+
+directory = File.expand_path(File.dirname(__FILE__))
+
+Hash.send :include, Hashie::HashExtensions
+
+module Buzzsprout
+
+ def self.episodes(podcast_id, tags=[])
+ Client.episodes(podcast_id, tags)
+ end
+
+ def self.episode(podcast_id, episode_id)
+ Client.episode(podcast_id, episode_id)
+ end
+
+end
+
+require File.join(directory, 'buzzsprout', 'episode')
+require File.join(directory, 'buzzsprout', 'client')
View
@@ -0,0 +1,21 @@
+module Buzzsprout
+
+ class Client
+ include HTTParty
+ format :json
+ base_uri "http://www.buzzsprout.com"
+
+ def self.episodes(podcast_id, tags=[])
+ query = {}
+ tags = tags.join(",") if tags.is_a?(Array)
+ query[:tags] = tags if tags and not tags.empty?
+ response = self.get("/#{podcast_id}.json", :query => query)
+ response.map{|item| Buzzsprout::Episode.new(item['episode'])}
+ end
+
+ def self.episode(podcast_id, episode_id)
+ Buzzsprout::Episode.new(self.get("/#{podcast_id}/#{episode_id}.json")['episode'])
+ end
+ end
+
+end
View
@@ -0,0 +1,47 @@
+
+module Buzzsprout
+ class Episode < Hashie::Dash
+ property :s3
+ property :artist
+ property :size
+ property :title
+ property :tags
+ property :date
+ property :podcast_id
+ property :live
+ property :id
+ property :description
+ property :duration
+ property :updated_at
+ property :created_at
+
+ def s3?
+ !!self[:s3]
+ end
+
+ def live?
+ !!self[:live]
+ end
+
+ def duration
+ segments = [self[:duration]/60]
+ segments << (self[:duration] % 60 )
+ segments.map {|t| t.to_s.rjust(2, '0')}.join(':')
+ end
+
+ def duration=(value)
+ new_duration = value.to_s.split(":").reverse
+ s, m = new_duration
+ self[:duration] = (s.to_i + (m.to_i*60))
+ end
+
+ def duration_in_seconds
+ self[:duration]
+ end
+
+ def tags
+ self[:tags].split(",")
+ end
+
+ end
+end
View
@@ -0,0 +1,17 @@
+{
+ "episode": {
+ "s3": true,
+ "artist": "Adam Stacoviak and Wynn Netherland",
+ "updated_at": "2010-01-25T14:36:42-05:00",
+ "size": 37400482,
+ "title": "Episode 0.1.0 - Chris Wanstrath from GitHub",
+ "tags": "git, github, interview, bootstrapping, business, startups",
+ "date": "2010-01-25",
+ "podcast_id": 105,
+ "live": true,
+ "id": 2274,
+ "description": "Adam and Wynn talk with Chris Wanstrath aka @defunkt from GitHub about the magic of Git, the past, present and future of GitHub, building a bootstrapped startup and some other cool stuff you'll just have to hear for yourself.",
+ "duration": 4675,
+ "created_at": "2010-01-25T12:53:02-05:00"
+ }
+}
@@ -0,0 +1,170 @@
+[{
+ "episode": {
+ "s3": true,
+ "artist": "Adam Stacoviak and Wynn Netherland",
+ "updated_at": "2010-01-25T14:36:42-05:00",
+ "size": 37400482,
+ "title": "Episode 0.1.0 - Chris Wanstrath from GitHub",
+ "tags": "git, github, interview, bootstrapping, business, startups",
+ "date": "2010-01-25",
+ "podcast_id": 105,
+ "live": true,
+ "id": 2274,
+ "description": "Adam and Wynn talk with Chris Wanstrath aka @defunkt from GitHub about the magic of Git, the past, present and future of GitHub, building a bootstrapped startup and some other cool stuff you'll just have to hear for yourself.",
+ "duration": 4675,
+ "created_at": "2010-01-25T12:53:02-05:00"
+ }
+},
+{
+ "episode": {
+ "s3": true,
+ "artist": "Adam Stacoviak and Wynn Netherland",
+ "updated_at": "2010-01-25T16:31:21-05:00",
+ "size": 10392587,
+ "title": "Episode 0.0.9 - Fix-me, Configliere, and more Node.js",
+ "tags": "node-js, javascript, news, ruby, css",
+ "date": "2010-01-19",
+ "podcast_id": 105,
+ "live": true,
+ "id": 2190,
+ "description": "Adam and Wynn ran down some news highlights with Marshall Culpepper from Appcelerator.",
+ "duration": 1299,
+ "created_at": "2010-01-19T22:06:02-05:00"
+ }
+},
+{
+ "episode": {
+ "s3": true,
+ "artist": "Adam Stacoviak and Wynn Netherland",
+ "updated_at": "2010-01-14T11:01:27-05:00",
+ "size": 25148636,
+ "title": "Episode 0.0.8 - Marshall Culpepper from Appcelerator Titanium",
+ "tags": "javascript, mobile, ruby, python, php, interview",
+ "date": "2010-01-14",
+ "podcast_id": 105,
+ "live": true,
+ "id": 2131,
+ "description": "Adam and Wynn spoke with Marshall Culpepper from Appcelerator about their open source projects Titanium Desktop and Titanium Mobile. ",
+ "duration": 3143,
+ "created_at": "2010-01-14T10:50:28-05:00"
+ }
+},
+{
+ "episode": {
+ "s3": true,
+ "artist": "Adam Stacoviak and Wynn Netherland",
+ "updated_at": "2009-12-17T10:33:18-05:00",
+ "size": 19880469,
+ "title": "Episode 0.0.7 - Mike Dirolf from 10gen and MongoDB",
+ "tags": "mongodb, ruby, python, nosql, javascript, 10gen, jobs",
+ "date": "2009-12-17",
+ "podcast_id": 105,
+ "live": true,
+ "id": 1959,
+ "description": "Adam and Wynn spoke with Mike Dirolf from 10gen about their fast-growing MongoDB project. Mike gave us insight on how MongoDB came about, design decisions, and the future of this cool NoSQL server.",
+ "duration": 2485,
+ "created_at": "2009-12-17T10:25:27-05:00"
+ }
+},
+{
+ "episode": {
+ "s3": true,
+ "artist": "Adam Stacoviak and Wynn Netherland",
+ "updated_at": "2009-12-15T11:20:57-05:00",
+ "size": 22376939,
+ "title": "Episode 0.0.6 - Steven Bristol from LessEverything and weekly news",
+ "tags": "guest-hosts, javascript, ruby, rack, rails, erlang, twitter, less",
+ "date": "2009-12-15",
+ "podcast_id": 105,
+ "live": true,
+ "id": 1935,
+ "description": "In this episode, Adam, Wynn, and Steven Bristol discuss Erlang, Javascript on the server, Lighthouse, Docsplit, Rackamole/whackamole, unfollowing under-performing Twitter peeps, and suing domain squatters.",
+ "duration": 2797,
+ "created_at": "2009-12-15T11:11:04-05:00"
+ }
+},
+{
+ "episode": {
+ "s3": true,
+ "artist": "Adam Stacoviak and Wynn Netherland",
+ "updated_at": "2009-12-06T21:08:00-05:00",
+ "size": 17208247,
+ "title": "Episode 0.0.5 - DocumentCloud",
+ "tags": "javascript, open source, rails, ruby, media",
+ "date": "2009-12-06",
+ "podcast_id": 105,
+ "live": true,
+ "id": 1908,
+ "description": "We interviewed Jeremy Ashkenas Lead Developer at DocumentCloud about their effort to revolutionize the way media organizations gather news. Jeremy discusses their open source projects CloudCrowd, Underscore.js, and JAMMIT that they've released along the way. ",
+ "duration": 2151,
+ "created_at": "2009-12-06T21:00:33-05:00"
+ }
+},
+{
+ "episode": {
+ "s3": true,
+ "artist": "Adam Stacoviak and Wynn Netherland",
+ "updated_at": "2009-12-01T13:38:09-05:00",
+ "size": 14668518,
+ "title": "Episode 0.0.4 - Chrome OS, Thor, and ROaR (30:34)",
+ "tags": "google, handbrake, osx, ruby, rails, javascript, thor, testing",
+ "date": "2009-12-01",
+ "podcast_id": 105,
+ "live": true,
+ "id": 1876,
+ "description": "In this episode we discuss: <a href=\"http://thechangelog.com/post/255853114/google-chrome-os-chromium-os\">Google Chrome OS</a>, <a href=\"http://thechangelog.com/post/256716884/handbrake-0-9-4-released-64-bit-support\">HandBrake 0.9.4</a>, <a href=\"http://thechangelog.com/post/258093819/functional-cocoa-applications-using-webkit\">CocoUI</a>, <a href=\"http://thechangelog.com/post/259540919/rails-2-3-5-released\">Rails 2.3.5</a>, <a href=\"http://thechangelog.com/post/259598588/restler-for-node-js\">Restler</a> &amp; <a href=\"http://thechangelog.com/post/261021600/nodejs-evented-i-o-for-v8-javascript\">Node.js</a>, <a href=\"http://thechangelog.com/post/259987077/riot-an-extremely-fast-running-unit-testing\">Riot</a>, <a href=\"http://thechangelog.com/post/260932630/thor-git-make-developing-with-git-easier\">Thor-Git</a> and <a href=\"http://thechangelog.com/post/261042337/webroar-ruby-rack-rails-application-server\">WebROaR</a>",
+ "duration": 1833,
+ "created_at": "2009-12-01T13:31:49-05:00"
+ }
+},
+{
+ "episode": {
+ "s3": true,
+ "artist": "Adam Stacoviak and Wynn Netherland",
+ "updated_at": "2009-11-27T14:52:18-05:00",
+ "size": 10404498,
+ "title": "Episode 0.0.3 - Google's Go Programming Language",
+ "tags": "go, programing language, google, go code",
+ "date": "2009-11-27",
+ "podcast_id": 105,
+ "live": true,
+ "id": 1861,
+ "description": "We spoke with <a href=\"http://research.google.com/people/r/\">Rob Pike</a>, Principal Engineer at Google and Tech Lead for the <a href=\"http://go-lang.org/\">Google Go</a> team about <a href=\"http://go-lang.org/\">Go</a>.",
+ "duration": 1300,
+ "created_at": "2009-11-27T06:10:10-05:00"
+ }
+},
+{
+ "episode": {
+ "s3": true,
+ "artist": "Adam Stacoviak and Wynn Netherland",
+ "updated_at": "2009-11-30T11:54:21-05:00",
+ "size": 10312338,
+ "title": "Episode 0.0.2 - First weekly show",
+ "tags": "asset packaging, javascript, browser, buttons, compass, sass, google go",
+ "date": "2009-11-25",
+ "podcast_id": 105,
+ "live": true,
+ "id": 1859,
+ "description": "In this episode we discuss: JAMMIT - Rails plugin for asset packaging, Underscore.js the bowtie for jQuery's tux, Google Go, Firefox 3.6 beta 2, Google Chrome OS and creating \"fancy buttons\" with Compass and Sass.",
+ "duration": 1289,
+ "created_at": "2009-11-26T05:27:48-05:00"
+ }
+},
+{
+ "episode": {
+ "s3": true,
+ "artist": "Adam Stacoviak and Wynn Netherland",
+ "updated_at": "2009-11-25T17:21:08-05:00",
+ "size": 28656567,
+ "title": "Episode 0.0.1 - Haml Sass and Compass",
+ "tags": "haml, sass, compass, web design, front-end development, css",
+ "date": "2009-11-19",
+ "podcast_id": 105,
+ "live": true,
+ "id": 1805,
+ "description": "Wynn and I discuss <a href=\"http://haml-lang.com/\">Haml</a>, <a href=\"http://sass-lang.com/\">Sass</a> and <a href=\"http://compass-style.org/\">Compass</a> with the core developers Nathan Weizenbaum (@nex3) and Chris Eppstein (@chriseppstein).",
+ "duration": 3582,
+ "created_at": "2009-11-19T13:14:24-05:00"
+ }
+}]
View
@@ -0,0 +1,17 @@
+[{
+ "episode": {
+ "s3": true,
+ "artist": "Adam Stacoviak and Wynn Netherland",
+ "updated_at": "2009-12-17T10:33:18-05:00",
+ "size": 19880469,
+ "title": "Episode 0.0.7 - Mike Dirolf from 10gen and MongoDB",
+ "tags": "mongodb, ruby, python, nosql, javascript, 10gen, jobs",
+ "date": "2009-12-17",
+ "podcast_id": 105,
+ "live": true,
+ "id": 1959,
+ "description": "Adam and Wynn spoke with Mike Dirolf from 10gen about their fast-growing MongoDB project. Mike gave us insight on how MongoDB came about, design decisions, and the future of this cool NoSQL server.",
+ "duration": 2485,
+ "created_at": "2009-12-17T10:25:27-05:00"
+ }
+}]
View
@@ -1,10 +1,42 @@
-require 'rubygems'
require 'test/unit'
+require 'pathname'
+require 'rubygems'
+
+gem 'thoughtbot-shoulda', '>= 2.10.1'
+gem 'jnunemaker-matchy', '0.4.0'
+gem 'fakeweb', '>= 1.2.5'
+
require 'shoulda'
+require 'matchy'
+require 'fakeweb'
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'buzzsprout'
+FakeWeb.allow_net_connect = false
+
class Test::Unit::TestCase
end
+
+def fixture_file(filename)
+ return '' if filename == ''
+ file_path = File.expand_path(File.dirname(__FILE__) + '/fixtures/' + filename)
+ File.read(file_path)
+end
+
+def buzzsprout_url(url)
+ url =~ /^http/ ? url : "http://www.buzzsprout.com#{url}"
+end
+
+def stub_get(url, filename, options={})
+ opts = {:body => fixture_file(filename)}.merge(options)
+
+ FakeWeb.register_uri(:get, buzzsprout_url(url), opts)
+end
+
+def stub_post(url, filename)
+ FakeWeb.register_uri(:post, buzzsprout_url(url), :body => fixture_file(filename))
+end
+
Oops, something went wrong.

0 comments on commit 2c06a52

Please sign in to comment.