airplay 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +30 -0
- data/airplay.gemspec +2 -2
- data/lib/airplay/client.rb +1 -1
- data/lib/airplay/protocol.rb +4 -2
- data/lib/airplay/protocol/image.rb +0 -1
- data/test/discovery.rb +1 -1
- data/test/images.rb +1 -1
- metadata +9 -8
data/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# Airplay
|
2
|
+
|
3
|
+
A client (and someday a server) of the superfancy http content stream technique
|
4
|
+
that Apple uses in its products.
|
5
|
+
|
6
|
+
You can try this in an AppleTV for instance.
|
7
|
+
|
8
|
+
## Basic Usage
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'airplay'
|
12
|
+
|
13
|
+
airplay = Airplay::Client.new
|
14
|
+
# To send an image
|
15
|
+
airplay.send_image("fancy_pants.jpg")
|
16
|
+
# To stream a video
|
17
|
+
airplay.send_video("http://www.yo-yo.org/mp4/yu2.mp4")
|
18
|
+
```
|
19
|
+
|
20
|
+
## Useful methods
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
require 'airplay'
|
24
|
+
|
25
|
+
airplay = Airplay::Client.new
|
26
|
+
airplay.browse
|
27
|
+
#=> [#<Airplay::Node:0x007fbb5a83eb28 @name="elCuervo", @domain="local.", @ip="10.1.0.63">, #<Airplay::Node:0x007fbb5a83b0b8 @name="Apple TV", @domain="local.", @ip="10.1.0.220">]
|
28
|
+
airplay.use "elCuervo"
|
29
|
+
airplay.use "Apple TV"
|
30
|
+
```
|
data/airplay.gemspec
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "airplay"
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.4"
|
4
4
|
s.summary = "Airplay client"
|
5
5
|
s.description = "Send image/video to an airplay enabled device"
|
6
6
|
s.authors = ["elcuervo"]
|
7
7
|
s.email = ["yo@brunoaguirre.com"]
|
8
8
|
s.homepage = "http://github.com/elcuervo/airplay"
|
9
9
|
s.files = `git ls-files`.split("\n")
|
10
|
-
s.test_files
|
10
|
+
s.test_files = `git ls-files spec`.split("\n")
|
11
11
|
|
12
12
|
s.add_dependency("dnssd")
|
13
13
|
s.add_development_dependency("cutest")
|
data/lib/airplay/client.rb
CHANGED
data/lib/airplay/protocol.rb
CHANGED
@@ -11,8 +11,10 @@ class Airplay::Protocol
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def make_request(request)
|
14
|
-
|
15
|
-
|
14
|
+
Thread.new do |t|
|
15
|
+
response = @http.request(request)
|
16
|
+
raise Airplay::Protocol::InvalidRequestError if response.code == "404"
|
17
|
+
end
|
16
18
|
true
|
17
19
|
end
|
18
20
|
|
data/test/discovery.rb
CHANGED
data/test/images.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path("helper", File.dirname(__FILE__))
|
|
3
3
|
scope do
|
4
4
|
test "check image protocol class" do
|
5
5
|
image_protocol = Airplay::Protocol::Image.new("127.0.0.1")
|
6
|
-
assert_equal "/
|
6
|
+
assert_equal "/photo", image_protocol.resource
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airplay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-08-
|
12
|
+
date: 2011-08-19 00:00:00.000000000 -03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: dnssd
|
17
|
-
requirement: &
|
17
|
+
requirement: &70215413744060 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70215413744060
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: cutest
|
28
|
-
requirement: &
|
28
|
+
requirement: &70215413743480 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70215413743480
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: capybara
|
39
|
-
requirement: &
|
39
|
+
requirement: &70215413742900 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *70215413742900
|
48
48
|
description: Send image/video to an airplay enabled device
|
49
49
|
email:
|
50
50
|
- yo@brunoaguirre.com
|
@@ -53,6 +53,7 @@ extensions: []
|
|
53
53
|
extra_rdoc_files: []
|
54
54
|
files:
|
55
55
|
- .gitignore
|
56
|
+
- README.md
|
56
57
|
- Rakefile
|
57
58
|
- airplay.gemspec
|
58
59
|
- lib/airplay.rb
|