flickvimeo 1.0.0 → 1.0.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/README.md CHANGED
@@ -40,7 +40,7 @@ For example:
40
40
 
41
41
  Once you've made your great commits:
42
42
 
43
- 1. [Fork][fk] Mustache
43
+ 1. [Fork][fk] FlickVimeo
44
44
  2. Create a topic branch - `git checkout -b my_branch`
45
45
  3. Push to your branch - `git push origin my_branch`
46
46
  4. Create a Pull Request or an [Issue][is] with a link to your branch
@@ -52,11 +52,12 @@ on coding standards, new features, etc.
52
52
 
53
53
  # License
54
54
 
55
- Copyright (c) 2010-2011 Eric Lindvall. See LICENSE for details.
55
+ Copyright (c) 2010-2011 Eric Lindvall. See [LICENSE][] for details.
56
56
 
57
57
 
58
58
  [Vimeo]: http://vimeo.com/
59
59
  [AirFlick]: http://ericasadun.com/ftp/AirPlay/
60
- [cb]: http://wiki.github.com/defunkt/resque/contributing
60
+ [cb]: https://wiki.github.com/defunkt/resque/contributing
61
61
  [fk]: http://help.github.com/forking/
62
- [is]: http://github.com/eric/flickvimeo/issues
62
+ [is]: https://github.com/eric/flickvimeo/issues
63
+ [LICENSE]: https://github.com/eric/flickvimeo/blob/master/LICENSE
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'flickvimeo'
16
- s.version = '1.0.0'
16
+ s.version = '1.0.1'
17
17
  s.date = '2011-01-02'
18
18
  # s.rubyforge_project = 'flickvimeo'
19
19
 
@@ -56,7 +56,6 @@ Gem::Specification.new do |s|
56
56
  # = MANIFEST =
57
57
  s.files = %w[
58
58
  Gemfile
59
- Gemfile.lock
60
59
  LICENSE
61
60
  README.md
62
61
  Rakefile
@@ -2,5 +2,5 @@
2
2
  require 'flickvimeo/video'
3
3
 
4
4
  module FlickVimeo
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.1'
6
6
  end
@@ -42,15 +42,17 @@ module FlickVimeo
42
42
  response = http_request(@url)
43
43
 
44
44
  if m = response.body.match(/clip\d+_\d+ = (.*)?;Player.checkRatio/)
45
- # Cleanup javascript to be valid JSON
46
- json = m[1].gsub(/([\{\[,]\s*)([a-zA-Z_]+):/) { %{#{$1}"#{$2}":} }
47
- json = json.gsub(/(:\s*)'(.*?)'/, '\1"\2"')
48
-
49
- Yajl::Parser.parse(json)
45
+ Yajl::Parser.parse(convert_javascript_to_valid_json(m[1]))
50
46
  end
51
47
  end
52
48
  end
53
49
 
50
+ def convert_javascript_to_valid_json(input)
51
+ # Cleanup javascript to be valid JSON
52
+ json = input.gsub(/([\{\[,]\s*)([a-zA-Z_]+):/) { %{#{$1}"#{$2}":} }
53
+ json = json.gsub(/(:\s*)'((?:[^'\\]|\\.)*)'/, '\1"\2"')
54
+ end
55
+
54
56
  def vimeo_url(id)
55
57
  case id.to_s
56
58
  when %r{^http://.*vimeo.com.*[#/](\d+)}
@@ -15,8 +15,6 @@ class TestBasic < Test::Unit::TestCase
15
15
  end
16
16
 
17
17
  def test_video_file_url
18
- pp @video.config
19
- puts @video.video_file_url
20
18
  assert_not_nil @video.video_file_url
21
19
  end
22
20
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickvimeo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease: false
4
+ hash: 21
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eric Lindvall
@@ -45,7 +45,6 @@ extra_rdoc_files:
45
45
  - LICENSE
46
46
  files:
47
47
  - Gemfile
48
- - Gemfile.lock
49
48
  - LICENSE
50
49
  - README.md
51
50
  - Rakefile
@@ -87,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
86
  requirements: []
88
87
 
89
88
  rubyforge_project:
90
- rubygems_version: 1.3.7
89
+ rubygems_version: 1.4.1
91
90
  signing_key:
92
91
  specification_version: 2
93
92
  summary: A simple tool to use AirFlick to send Vimeo videos to your AppleTV
@@ -1,19 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- flickvimeo (0.0)
5
- yajl-ruby
6
-
7
- GEM
8
- remote: http://rubygems.org/
9
- specs:
10
- rake (0.8.7)
11
- yajl-ruby (0.7.8)
12
-
13
- PLATFORMS
14
- ruby
15
-
16
- DEPENDENCIES
17
- flickvimeo!
18
- rake
19
- yajl-ruby