embeddable 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5ea8ddee330b32ebe578d29fcf6a50bd8b99ae4
4
- data.tar.gz: 7c45262cb3fc0fc112417e8efab81cd936247e50
3
+ metadata.gz: c3ac69dc8d6ec87fefeecfd16886e6f7eeac72ee
4
+ data.tar.gz: 2d95c52fdb3d62215ab53a41240d4454e52ad431
5
5
  SHA512:
6
- metadata.gz: 28eec77adfff43b90c150c98d7393ae190ceba1e231dabb24012a068e70b0bc235d339fd5cc2358f1e9f3e00d94ad6bfe6aa3c51ef35b2367d82a30130596e6e
7
- data.tar.gz: f18f2439d651f66061b22b1ba83e3325f8673c6002163e7fd3de6c5e75e08c4c56a79b4093ed64a0752e117d1103e2a816573c598ea44f2f852d6e7962f8dcf1
6
+ metadata.gz: 47f91ddb77d89df4c98f2158451f8343b0c5a713c17e5fde7e529b560cabdf6bd19d4375a0a2c7b43294f12296ec5f419acfa459c1ae150abb432760927643db
7
+ data.tar.gz: 405c619f02a7240cab22888fd8cc74807ae08bff6ec375f624011a7a3c354d0ee6426f07614e5ead7746ab1d860c9c24746077798d1e2f9859629b9addbd6969
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
data/README.md CHANGED
@@ -21,9 +21,9 @@ Or install it yourself as:
21
21
 
22
22
  ## Usage
23
23
 
24
- ```
24
+ ```ruby
25
25
  # app/models/post.rb
26
- class Post
26
+ class Post < ActiveRecord::Base
27
27
  embeddable :video, from: :video_url
28
28
  end
29
29
 
@@ -8,22 +8,13 @@ module Embeddable::Concerns
8
8
  youtube: [
9
9
  %r{^https?://(?:(?:www|m)\.)?youtube\.com/watch\?v=([^&]+)},
10
10
  %r{^https?://(?:(?:www|m)\.)?youtu\.be/([^?]+)}
11
+ ],
12
+ vimeo: [
13
+ %r{^https?://(?:www\.)?vimeo\.com/([^\?]+)},
11
14
  ]
12
15
  }
13
16
 
14
17
  module ClassMethods
15
- # Denotes an embeddable for given name
16
- #
17
- # Options:
18
- # :from (source property for this embeddable, required)
19
- #
20
- # Example:
21
- #
22
- # class Post
23
- # include Concerns::Embeddable
24
- # embeddable :video, from: :video_url
25
- # end
26
- #
27
18
  def embeddable(name, options = {})
28
19
  source = options.fetch :from
29
20
 
@@ -1,3 +1,3 @@
1
1
  module Embeddable
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -20,6 +20,15 @@ module Embeddable
20
20
  end
21
21
  end
22
22
 
23
+ describe 'Vimeo' do
24
+ context 'with http://vimeo.com/...' do
25
+ before { subject.video_url = 'https://vimeo.com/77949044' }
26
+
27
+ its(:video_type) { should eq :vimeo }
28
+ its(:video_id) { should eq '77949044' }
29
+ end
30
+ end
31
+
23
32
  describe 'YouTube' do
24
33
 
25
34
  context 'with http://youtube.com/watch?v=...' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embeddable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Gorset
@@ -77,6 +77,7 @@ extra_rdoc_files: []
77
77
  files:
78
78
  - .gitignore
79
79
  - .rspec
80
+ - .travis.yml
80
81
  - Gemfile
81
82
  - LICENSE.txt
82
83
  - README.md