muri 0.0.11 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 11
4
+ :patch: 13
@@ -56,10 +56,11 @@ class Muri
56
56
  end
57
57
  # if !$5.nil?
58
58
  # @info[:media_size] = case $5.downcase
59
- # when '_s' then 'small'
59
+ # when '_s' then 'square'
60
60
  # when '_t' then 'thumbnail'
61
- # when '_m' then 'medium'
61
+ # when '_m' then 'small'
62
62
  # when '_b' then 'large'
63
+ # when '_o' then 'original'
63
64
  # else nil
64
65
  # end
65
66
  # end
@@ -23,7 +23,7 @@ class Muri
23
23
  # OLD: /^\/albums\/(.+?)\/(.+?)\/((?:.+?\/)*)(.+?)\.(.+)/i
24
24
  photobucket_id = $1
25
25
  media_creator = $2
26
- album = $3
26
+ album = $3.nil? ? '' : "#{$3}/"
27
27
  @info[:media_id] = $4
28
28
  @info[:content_type] = $5
29
29
  url_common = "#{server_id}.photobucket.com/albums/#{photobucket_id}/#{media_creator}/#{album}"
@@ -15,56 +15,7 @@ class Muri
15
15
  def vimeo_parse
16
16
  @info[:service] = 'Vimeo'
17
17
  params = @url.query.nil? ? {} : CGI::parse(@url.query)#.each {|k,v| b[k] = v.first}
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
18
+
68
19
  if @url.path =~ /^\/(album\/)?([0-9]+)\/?$/i
69
20
  @info[:media_id] = $2
70
21
  @info[:media_api_type] = $1.nil? ? VIMEO_VIDEO : VIMEO_ALBUM
@@ -91,7 +42,7 @@ class Muri
91
42
  end
92
43
 
93
44
  def self.parsable?(uri)
94
- uri.host =~ /^vimeo\.com$/i
45
+ uri.host =~ /^(www\.)?vimeo\.com$/i
95
46
  end
96
47
 
97
48
  end
data/muri.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{muri}
8
- s.version = "0.0.11"
8
+ s.version = "0.0.13"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["William Schneider"]
12
- s.date = %q{2010-03-21}
12
+ s.date = %q{2010-03-23}
13
13
  s.description = %q{Automatically get media information from the URL.}
14
14
  s.email = %q{bananastalktome@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -46,13 +46,13 @@ Gem::Specification.new do |s|
46
46
  s.rubygems_version = %q{1.3.5}
47
47
  s.summary = %q{Media URI Parser}
48
48
  s.test_files = [
49
- "test/facebook_test.rb",
50
- "test/twitpic_test.rb",
49
+ "test/error_test.rb",
50
+ "test/facebook_test.rb",
51
+ "test/flickr_test.rb",
52
+ "test/imageshack_test.rb",
51
53
  "test/photobucket_test.rb",
54
+ "test/twitpic_test.rb",
52
55
  "test/vimeo_test.rb",
53
- "test/imageshack_test.rb",
54
- "test/error_test.rb",
55
- "test/flickr_test.rb",
56
56
  "test/youtube_test.rb"
57
57
  ]
58
58
 
@@ -75,6 +75,30 @@ describe "Photobucket parse album first" do
75
75
  end
76
76
  end
77
77
 
78
+ describe "Photobucket parse first" do
79
+ before(:all) do
80
+ @a = Muri.parse 'http://i587.photobucket.com/albums/ss319/bananastalktome/API%20Testing/bananastalktomegmailcom_6c337a91.jpg'
81
+ end
82
+ it_should_behave_like "Photobucket parse photo"
83
+
84
+ it "should have media id" do
85
+ @a.media_id.should == 'bananastalktomegmailcom_6c337a91'
86
+ end
87
+
88
+ it "should have content type" do
89
+ @a.content_type.should == "jpg"
90
+ end
91
+
92
+ it "should have media url" do
93
+ @a.media_url.should == "http://i587.photobucket.com/albums/ss319/bananastalktome/API%20Testing/bananastalktomegmailcom_6c337a91.jpg"
94
+ end
95
+
96
+ it "should have media api id" do
97
+ @a.media_api_id.should == "http://i587.photobucket.com/albums/ss319/bananastalktome/API%20Testing/bananastalktomegmailcom_6c337a91.jpg"
98
+ end
99
+
100
+ end
101
+
78
102
  describe "Photobucket parse first" do
79
103
  before(:all) do
80
104
  @a = Muri.parse 'http://i244.photobucket.com/albums/gg17/pbapi/file.jpg'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muri
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Schneider
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-21 00:00:00 -04:00
12
+ date: 2010-03-23 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -74,11 +74,11 @@ signing_key:
74
74
  specification_version: 3
75
75
  summary: Media URI Parser
76
76
  test_files:
77
+ - test/error_test.rb
77
78
  - test/facebook_test.rb
78
- - test/twitpic_test.rb
79
+ - test/flickr_test.rb
80
+ - test/imageshack_test.rb
79
81
  - test/photobucket_test.rb
82
+ - test/twitpic_test.rb
80
83
  - test/vimeo_test.rb
81
- - test/imageshack_test.rb
82
- - test/error_test.rb
83
- - test/flickr_test.rb
84
84
  - test/youtube_test.rb