airplay 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +28 -11
- data/airplay-cli.gemspec +4 -4
- data/airplay.gemspec +7 -5
- data/bin/air +5 -1
- data/lib/airplay/browser.rb +56 -8
- data/lib/airplay/cli.rb +66 -0
- data/lib/airplay/cli/version.rb +1 -1
- data/lib/airplay/connection.rb +2 -1
- data/lib/airplay/connection/persistent.rb +6 -7
- data/lib/airplay/device.rb +23 -3
- data/lib/airplay/device/info.rb +3 -1
- data/lib/airplay/player/media.rb +42 -11
- data/lib/airplay/player/playback_info.rb +5 -1
- data/lib/airplay/server.rb +4 -2
- data/lib/airplay/server/app.rb +2 -1
- data/lib/airplay/version.rb +1 -1
- data/test/test_helper.rb +5 -0
- data/test/unit/configuration_test.rb +28 -0
- data/test/unit/device_test.rb +12 -0
- data/test/unit/player/media_test.rb +16 -0
- metadata +50 -10
data/Gemfile.lock
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
airplay (1.0.
|
4
|
+
airplay (1.0.1)
|
5
5
|
CFPropertyList (~> 2.2.0)
|
6
6
|
celluloid (~> 0.15.0)
|
7
7
|
cuba (~> 3.1.0)
|
8
8
|
dnssd (~> 2.0)
|
9
9
|
log4r (~> 1.1.10)
|
10
10
|
micromachine (~> 1.0.4)
|
11
|
+
mime-types (~> 2.0)
|
11
12
|
net-http-digest_auth (~> 1.2.1)
|
12
|
-
net-ptth (= 0.0.
|
13
|
-
|
13
|
+
net-ptth (= 0.0.16)
|
14
|
+
reel-rack (~> 0.1.0)
|
14
15
|
|
15
16
|
GEM
|
16
17
|
remote: http://rubygems.org/
|
@@ -32,25 +33,40 @@ GEM
|
|
32
33
|
debugger-ruby_core_source (1.2.3)
|
33
34
|
dnssd (2.0)
|
34
35
|
fakeweb (1.3.0)
|
35
|
-
|
36
|
+
given_core (3.0.0)
|
37
|
+
sorcerer (>= 0.3.7)
|
38
|
+
http (0.5.0)
|
39
|
+
http_parser.rb
|
40
|
+
http_parser.rb (0.6.0.beta.2)
|
36
41
|
log4r (1.1.10)
|
37
|
-
macaddr (1.6.1)
|
38
|
-
systemu (~> 2.5.0)
|
39
42
|
micromachine (1.0.4)
|
43
|
+
mime-types (2.0)
|
40
44
|
minitest (4.4.0)
|
45
|
+
minitest-given (3.0.0)
|
46
|
+
given_core (= 3.0.0)
|
47
|
+
minitest (> 4.3)
|
41
48
|
net-http-digest_auth (1.2.1)
|
42
|
-
net-ptth (0.0.
|
49
|
+
net-ptth (0.0.16)
|
43
50
|
celluloid-io (~> 0.15.0)
|
44
|
-
http_parser.rb (~> 0.
|
51
|
+
http_parser.rb (~> 0.6.0.beta.2)
|
45
52
|
rack (~> 1.5.2)
|
46
53
|
nio4r (0.5.0)
|
47
54
|
rack (1.5.2)
|
48
55
|
rake (10.1.0)
|
49
|
-
|
56
|
+
reel (0.4.0)
|
57
|
+
celluloid (>= 0.15.1)
|
58
|
+
celluloid-io (>= 0.15.0)
|
59
|
+
http (>= 0.5.0)
|
60
|
+
http_parser.rb (>= 0.6.0.beta.2)
|
61
|
+
websocket_parser (>= 0.1.4)
|
62
|
+
reel-rack (0.1.0)
|
63
|
+
rack (>= 1.4.0)
|
64
|
+
reel (>= 0.4.0)
|
65
|
+
sorcerer (1.0.2)
|
50
66
|
timers (1.1.0)
|
51
|
-
uuid (2.3.7)
|
52
|
-
macaddr (~> 1.0)
|
53
67
|
vcr (2.4.0)
|
68
|
+
websocket_parser (0.1.4)
|
69
|
+
http
|
54
70
|
|
55
71
|
PLATFORMS
|
56
72
|
ruby
|
@@ -60,5 +76,6 @@ DEPENDENCIES
|
|
60
76
|
debugger
|
61
77
|
fakeweb (~> 1.3.0)
|
62
78
|
minitest (~> 4.4.0)
|
79
|
+
minitest-given (~> 3.0.0)
|
63
80
|
rake
|
64
81
|
vcr (~> 2.4.0)
|
data/airplay-cli.gemspec
CHANGED
@@ -4,7 +4,7 @@ require "airplay/cli/version"
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "airplay-cli"
|
6
6
|
s.version = Airplay::CLI::VERSION
|
7
|
-
s.summary = "Airplay
|
7
|
+
s.summary = "Airplay CLI"
|
8
8
|
s.description = "Send pics and videos using the terminal"
|
9
9
|
s.executables = "air"
|
10
10
|
s.licenses = ["MIT", "HUGWARE"]
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.homepage = "http://github.com/elcuervo/airplay"
|
14
14
|
s.files = %w(bin/air lib/airplay/cli.rb)
|
15
15
|
|
16
|
-
s.add_dependency("airplay",
|
17
|
-
s.add_dependency("clap",
|
18
|
-
s.add_dependency("ruby-progressbar",
|
16
|
+
s.add_dependency("airplay", "= 1.0.1")
|
17
|
+
s.add_dependency("clap", "~> 1.0.0")
|
18
|
+
s.add_dependency("ruby-progressbar", "~> 1.2.0")
|
19
19
|
end
|
data/airplay.gemspec
CHANGED
@@ -14,16 +14,18 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.test_files = `git ls-files test`.split("\n")
|
15
15
|
|
16
16
|
s.add_dependency("dnssd", "~> 2.0")
|
17
|
-
s.add_dependency("uuid", "~> 2.3.6")
|
18
17
|
s.add_dependency("CFPropertyList", "~> 2.2.0")
|
18
|
+
s.add_dependency("mime-types", "~> 2.0")
|
19
19
|
s.add_dependency("log4r", "~> 1.1.10")
|
20
20
|
s.add_dependency("cuba", "~> 3.1.0")
|
21
21
|
s.add_dependency("micromachine", "~> 1.0.4")
|
22
22
|
s.add_dependency("celluloid", "~> 0.15.0")
|
23
|
-
s.add_dependency("
|
23
|
+
s.add_dependency("reel-rack", "~> 0.1.0")
|
24
|
+
s.add_dependency("net-ptth", "= 0.0.16")
|
24
25
|
s.add_dependency("net-http-digest_auth", "~> 1.2.1")
|
25
26
|
|
26
|
-
s.add_development_dependency("minitest",
|
27
|
-
s.add_development_dependency("
|
28
|
-
s.add_development_dependency("
|
27
|
+
s.add_development_dependency("minitest", "~> 4.4.0")
|
28
|
+
s.add_development_dependency("minitest-given", "~> 3.0.0")
|
29
|
+
s.add_development_dependency("fakeweb", "~> 1.3.0")
|
30
|
+
s.add_development_dependency("vcr", "~> 2.4.0")
|
29
31
|
end
|
data/bin/air
CHANGED
@@ -10,9 +10,11 @@ begin
|
|
10
10
|
"--wait" => lambda { |sec| @wait = sec.to_i },
|
11
11
|
"--interactive" => lambda { @interactive = true },
|
12
12
|
|
13
|
+
"help" => Airplay::CLI.method(:help),
|
14
|
+
|
13
15
|
"list" => Airplay::CLI.method(:list),
|
14
16
|
|
15
|
-
"version" =>
|
17
|
+
"version" => Airplay::CLI.method(:version),
|
16
18
|
|
17
19
|
"play" => lambda { |video|
|
18
20
|
options = { device: @device || Airplay.devices.first }
|
@@ -28,6 +30,8 @@ begin
|
|
28
30
|
Airplay::CLI.view(file, options)
|
29
31
|
}
|
30
32
|
|
33
|
+
Airplay::CLI.help if ARGV.empty?
|
34
|
+
|
31
35
|
rescue Airplay::Browser::NoDevicesFound
|
32
36
|
puts "No devices found."
|
33
37
|
rescue Interrupt
|
data/lib/airplay/browser.rb
CHANGED
@@ -49,17 +49,65 @@ module Airplay
|
|
49
49
|
# Returns if there are more nodes coming
|
50
50
|
#
|
51
51
|
def node_resolver(node, resolved)
|
52
|
-
|
53
|
-
|
52
|
+
address = get_device_address(resolved)
|
53
|
+
type = get_type(resolved.text_record)
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
)
|
55
|
+
add_device(node.name, address, type)
|
56
|
+
resolved.flags.more_coming?
|
57
|
+
end
|
59
58
|
|
60
|
-
|
59
|
+
# Private: Gets the device type
|
60
|
+
#
|
61
|
+
# records - The text records hash to be investigated
|
62
|
+
#
|
63
|
+
# Returns a symbol with the type
|
64
|
+
#
|
65
|
+
def get_type(records)
|
66
|
+
# rhd means Remote HD the first product of the Airserver people
|
67
|
+
if records.has_key?("rhd")
|
68
|
+
:airserver
|
69
|
+
else
|
70
|
+
:apple_tv
|
71
|
+
end
|
72
|
+
end
|
61
73
|
|
62
|
-
|
74
|
+
# Private: Resolves the node complete address
|
75
|
+
#
|
76
|
+
# resolved - The DNS Resolved object
|
77
|
+
#
|
78
|
+
# Returns a string with the address (host:ip)
|
79
|
+
#
|
80
|
+
def get_device_address(resolved)
|
81
|
+
host = get_device_host(resolved.target)
|
82
|
+
"#{host}:#{resolved.port}"
|
83
|
+
end
|
84
|
+
|
85
|
+
# Private: Resolves the node ip or hostname
|
86
|
+
#
|
87
|
+
# resolved - The DNS Resolved object
|
88
|
+
#
|
89
|
+
# Returns a string with the ip or the hostname
|
90
|
+
#
|
91
|
+
def get_device_host(target)
|
92
|
+
info = Socket.getaddrinfo(target, nil, Socket::AF_INET)
|
93
|
+
info[0][2]
|
94
|
+
rescue SocketError
|
95
|
+
target
|
96
|
+
end
|
97
|
+
|
98
|
+
# Private: Creates and adds a device to the pool
|
99
|
+
#
|
100
|
+
# name - The device name
|
101
|
+
# address - The device address
|
102
|
+
#
|
103
|
+
# Returns nothing
|
104
|
+
#
|
105
|
+
def add_device(name, address, type)
|
106
|
+
devices << Device.new(
|
107
|
+
name: name.gsub(/\u00a0/, ' '),
|
108
|
+
address: address,
|
109
|
+
type: type
|
110
|
+
)
|
63
111
|
end
|
64
112
|
|
65
113
|
# Private: Resolves the node information given a node
|
data/lib/airplay/cli.rb
CHANGED
@@ -9,6 +9,35 @@ module Airplay
|
|
9
9
|
#
|
10
10
|
module CLI
|
11
11
|
class << self
|
12
|
+
# Public: Shows CLI help
|
13
|
+
#
|
14
|
+
# Returns nothing.
|
15
|
+
#
|
16
|
+
def help
|
17
|
+
Airplay.configuration.load
|
18
|
+
puts <<-EOS.gsub!(" "*10, "")
|
19
|
+
Usage: air [OPTIONS] ACTION [URL OR PATH]
|
20
|
+
|
21
|
+
Command line for the apple tv.
|
22
|
+
Example: air play my_video.mov
|
23
|
+
|
24
|
+
Actions:
|
25
|
+
|
26
|
+
list - Lists the available devices in the network.
|
27
|
+
help - This help.
|
28
|
+
version - The current airplay-cli version.
|
29
|
+
play - Plays a local or remote video.
|
30
|
+
view - Shows an image or a folder of images, can be an url.
|
31
|
+
|
32
|
+
Options:
|
33
|
+
|
34
|
+
--device - Name of the device where it should be played (Default: The first one)
|
35
|
+
--wait - The wait time for playing an slideshow (Default: 3)
|
36
|
+
--interactive - Control the slideshow using left and right arrows.
|
37
|
+
|
38
|
+
EOS
|
39
|
+
end
|
40
|
+
|
12
41
|
# Public: Lists all the devices to STDOUT
|
13
42
|
#
|
14
43
|
# Returns nothing.
|
@@ -18,6 +47,7 @@ module Airplay
|
|
18
47
|
puts <<-EOS.gsub(/^\s{12}/,'')
|
19
48
|
* #{device.name} (#{device.info.model} running #{device.info.os_version})
|
20
49
|
ip: #{device.ip}
|
50
|
+
type: #{device.type}
|
21
51
|
resolution: #{device.info.resolution}
|
22
52
|
|
23
53
|
EOS
|
@@ -76,6 +106,42 @@ module Airplay
|
|
76
106
|
end
|
77
107
|
end
|
78
108
|
|
109
|
+
# Public: Shows the current CLI version
|
110
|
+
#
|
111
|
+
# Returns nothing
|
112
|
+
#
|
113
|
+
def version
|
114
|
+
Airplay.configuration.load
|
115
|
+
v = Airplay::CLI::VERSION
|
116
|
+
puts <<-EOS
|
117
|
+
|
118
|
+
i@@@@@@@@@@@@@@@@@@@@@@@@@
|
119
|
+
i80000000000000000000000000000
|
120
|
+
i80000000000000000000000000000000G
|
121
|
+
i8000000000000000000000000000000000000
|
122
|
+
i80000000000000000000000000000000000000000
|
123
|
+
@00000 @0000000000000000000000000000000000000@ 000000@
|
124
|
+
@0000008 @000000000000000000000000000000000@ 80000000@
|
125
|
+
@001 @00000000000000000000000000000@ 100@
|
126
|
+
@001 @0000000000000000000000000@ 100@
|
127
|
+
@001 80000000000000000000008 t00@
|
128
|
+
@001 8000000000000000008 t00@
|
129
|
+
@001 800000000000008 t00@
|
130
|
+
@001 G000000000G t00@
|
131
|
+
@001 G00000G t00@
|
132
|
+
@001 L0L t00@
|
133
|
+
@001 t00@
|
134
|
+
@001 air t00@
|
135
|
+
@001 #{v} t00@
|
136
|
+
@001 t00@
|
137
|
+
@001 t00@
|
138
|
+
@001 100@
|
139
|
+
@00000000000000000000000000000000000000000000000000000G000@
|
140
|
+
@000000000000000000000000000000000000000000000000000000000@
|
141
|
+
|
142
|
+
EOS
|
143
|
+
end
|
144
|
+
|
79
145
|
end
|
80
146
|
end
|
81
147
|
end
|
data/lib/airplay/cli/version.rb
CHANGED
data/lib/airplay/connection.rb
CHANGED
@@ -1,26 +1,25 @@
|
|
1
1
|
require "net/ptth"
|
2
|
-
require "
|
2
|
+
require "securerandom"
|
3
3
|
|
4
4
|
module Airplay
|
5
5
|
# Public: The class that handles all the outgoing basic HTTP connections
|
6
6
|
#
|
7
7
|
class Connection
|
8
|
-
attr_reader :session
|
9
|
-
|
10
8
|
# Public: Class that wraps a persistent connection to point to the airplay
|
11
9
|
# server and other configuration
|
12
10
|
#
|
13
11
|
class Persistent
|
12
|
+
attr_reader :session, :mac_address
|
13
|
+
|
14
14
|
def initialize(address, options = {})
|
15
15
|
@logger = Airplay::Logger.new("airplay::connection::persistent")
|
16
16
|
@socket = Net::PTTH.new(address, options)
|
17
17
|
@socket.set_debug_output = @logger
|
18
18
|
|
19
|
-
@
|
20
|
-
|
19
|
+
@session = SecureRandom.uuid
|
20
|
+
@mac_address = "0x#{SecureRandom.hex(6)}"
|
21
21
|
|
22
|
-
|
23
|
-
@_session ||= UUID.generate
|
22
|
+
@socket.socket
|
24
23
|
end
|
25
24
|
|
26
25
|
def close
|
data/lib/airplay/device.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "airplay"
|
1
2
|
require "airplay/playable"
|
2
3
|
require "airplay/viewable"
|
3
4
|
require "airplay/device/features"
|
@@ -7,14 +8,19 @@ module Airplay
|
|
7
8
|
# Public: Represents an Airplay Node
|
8
9
|
#
|
9
10
|
class Device
|
10
|
-
|
11
|
+
MissingAttributes = Class.new(KeyError)
|
12
|
+
|
13
|
+
attr_reader :name, :address, :type, :password
|
11
14
|
|
12
15
|
include Playable
|
13
16
|
include Viewable
|
14
17
|
|
15
18
|
def initialize(attributes = {})
|
16
|
-
|
17
|
-
|
19
|
+
validate_attributes(attributes)
|
20
|
+
|
21
|
+
@name = attributes[:name]
|
22
|
+
@address = attributes[:address]
|
23
|
+
@type = attributes[:type]
|
18
24
|
@password = attributes[:password]
|
19
25
|
|
20
26
|
Airplay.configuration.load
|
@@ -98,6 +104,18 @@ module Airplay
|
|
98
104
|
|
99
105
|
private
|
100
106
|
|
107
|
+
# Private: Validates the mandatory attributes for a device
|
108
|
+
#
|
109
|
+
# attributes - The attributes hash to be validated
|
110
|
+
#
|
111
|
+
# Returns nothing or raises a MissingAttributes if some key is missing
|
112
|
+
#
|
113
|
+
def validate_attributes(attributes)
|
114
|
+
if !([:name, :address] - attributes.keys).empty?
|
115
|
+
raise MissingAttributes.new("A :name and an :address are mandatory")
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
101
119
|
# Private: Access the basic info of the device
|
102
120
|
#
|
103
121
|
# Returns a hash with the basic information
|
@@ -121,6 +139,8 @@ module Airplay
|
|
121
139
|
new_device.address = "#{ip}:7100"
|
122
140
|
|
123
141
|
response = new_device.connection.get("/stream.xml").response
|
142
|
+
return {} if response.status != 200
|
143
|
+
|
124
144
|
plist = CFPropertyList::List.new(data: response.body)
|
125
145
|
CFPropertyList.native_types(plist.value)
|
126
146
|
end
|
data/lib/airplay/device/info.rb
CHANGED
data/lib/airplay/player/media.rb
CHANGED
@@ -1,22 +1,53 @@
|
|
1
|
+
require "mime/types"
|
2
|
+
|
3
|
+
require "airplay/server"
|
4
|
+
|
1
5
|
module Airplay
|
2
6
|
class Player
|
3
7
|
class Media
|
4
|
-
attr_reader :url
|
8
|
+
attr_reader :file_or_url, :url
|
9
|
+
|
10
|
+
COMPATIBLE_TYPES = %w(
|
11
|
+
application/mp4
|
12
|
+
video/mp4
|
13
|
+
video/vnd.objectvideo
|
14
|
+
video/MP2T
|
15
|
+
video/quicktime
|
16
|
+
video/mpeg4
|
17
|
+
)
|
5
18
|
|
6
19
|
def initialize(file_or_url)
|
7
|
-
@
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
20
|
+
@file_or_url = file_or_url
|
21
|
+
end
|
22
|
+
|
23
|
+
def url
|
24
|
+
@_url ||= case true
|
25
|
+
when local?
|
26
|
+
Airplay.server.serve(File.expand_path(file_or_url))
|
27
|
+
when remote?
|
28
|
+
file_or_url
|
29
|
+
else
|
30
|
+
raise Errno::ENOENT, file_or_url
|
31
|
+
end
|
15
32
|
end
|
16
33
|
|
17
|
-
def
|
18
|
-
@
|
34
|
+
def compatible?
|
35
|
+
@_compatible ||= begin
|
36
|
+
path = File.basename(file_or_url)
|
37
|
+
compatibility = MIME::Types.type_for(path).map(&:to_s) & COMPATIBLE_TYPES
|
38
|
+
compatibility.any?
|
39
|
+
end
|
19
40
|
end
|
41
|
+
|
42
|
+
def local?
|
43
|
+
File.exists?(file_or_url)
|
44
|
+
end
|
45
|
+
|
46
|
+
def remote?
|
47
|
+
!!(file_or_url =~ URI::regexp)
|
48
|
+
end
|
49
|
+
|
50
|
+
def to_s; url end
|
20
51
|
end
|
21
52
|
end
|
22
53
|
end
|
@@ -9,12 +9,16 @@ module Airplay
|
|
9
9
|
info["duration"]
|
10
10
|
end
|
11
11
|
|
12
|
+
def has_duration?
|
13
|
+
!duration.to_f.zero?
|
14
|
+
end
|
15
|
+
|
12
16
|
def position
|
13
17
|
info["position"]
|
14
18
|
end
|
15
19
|
|
16
20
|
def percent
|
17
|
-
return unless position &&
|
21
|
+
return unless position && has_duration?
|
18
22
|
(position * 100 / duration).floor
|
19
23
|
end
|
20
24
|
|
data/lib/airplay/server.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "rack"
|
2
2
|
require "socket"
|
3
|
-
require "
|
3
|
+
require "celluloid"
|
4
|
+
require "reel/rack"
|
4
5
|
|
5
6
|
require "airplay/logger"
|
6
7
|
require "airplay/server/app"
|
@@ -13,11 +14,12 @@ module Airplay
|
|
13
14
|
@port = Airplay.configuration.port
|
14
15
|
@logger = Airplay::Logger.new("airplay::server")
|
15
16
|
@server = Rack::Server.new(
|
16
|
-
server: :
|
17
|
+
server: :reel,
|
17
18
|
Host: private_ip,
|
18
19
|
Port: @port,
|
19
20
|
Logger: @logger,
|
20
21
|
AccessLog: [],
|
22
|
+
quiet: true,
|
21
23
|
app: App.app
|
22
24
|
)
|
23
25
|
|
data/lib/airplay/server/app.rb
CHANGED
data/lib/airplay/version.rb
CHANGED
data/test/test_helper.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
require "airplay/configuration"
|
3
|
+
|
4
|
+
describe Airplay::Configuration do
|
5
|
+
Given(:configuration) { Airplay::Configuration.new }
|
6
|
+
|
7
|
+
context "default configuration" do
|
8
|
+
Then { configuration.log_level == 4 }
|
9
|
+
Then { configuration.autodiscover == true }
|
10
|
+
Then { configuration.host == "0.0.0.0" }
|
11
|
+
Then { configuration.port == "1337" }
|
12
|
+
Then { configuration.output.respond_to?(:info) }
|
13
|
+
end
|
14
|
+
|
15
|
+
context "changing configuration" do
|
16
|
+
When do
|
17
|
+
configuration.log_level = 1
|
18
|
+
configuration.autodiscover = false
|
19
|
+
configuration.host = "200.47.220.245"
|
20
|
+
configuration.port = "80"
|
21
|
+
end
|
22
|
+
|
23
|
+
Then { configuration.log_level == 1 }
|
24
|
+
And { configuration.autodiscover == false }
|
25
|
+
And { configuration.host == "200.47.220.245" }
|
26
|
+
And { configuration.port == "80" }
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
require "airplay/device"
|
3
|
+
|
4
|
+
describe Airplay::Device do
|
5
|
+
context "a Device must have at least a name and an address" do
|
6
|
+
When(:result) { Airplay::Device.new name: "Test" }
|
7
|
+
Then { result == Failure(Airplay::Device::MissingAttributes) }
|
8
|
+
|
9
|
+
When(:result) { Airplay::Device.new address: "192.168.1.1:80" }
|
10
|
+
Then { result == Failure(Airplay::Device::MissingAttributes) }
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
require "airplay/player/media"
|
3
|
+
|
4
|
+
describe Airplay::Player::Media do
|
5
|
+
context "finding if a media is compatible" do
|
6
|
+
Given(:media) { Airplay::Player::Media.new("test.mov") }
|
7
|
+
When(:compatibility) { media.compatible? }
|
8
|
+
Then { compatibility == true }
|
9
|
+
end
|
10
|
+
|
11
|
+
context "finding if a media is not compatible" do
|
12
|
+
Given(:media) { Airplay::Player::Media.new("test.psd") }
|
13
|
+
When(:compatibility) { media.compatible? }
|
14
|
+
Then { compatibility == false }
|
15
|
+
end
|
16
|
+
end
|
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: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dnssd
|
@@ -28,13 +28,13 @@ dependencies:
|
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '2.0'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
31
|
+
name: CFPropertyList
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 2.
|
37
|
+
version: 2.2.0
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,15 +42,15 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 2.
|
45
|
+
version: 2.2.0
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
47
|
+
name: mime-types
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
none: false
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 2.
|
53
|
+
version: '2.0'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.
|
61
|
+
version: '2.0'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: log4r
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,6 +123,22 @@ dependencies:
|
|
123
123
|
- - ~>
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: 0.15.0
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: reel-rack
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ~>
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: 0.1.0
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ~>
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: 0.1.0
|
126
142
|
- !ruby/object:Gem::Dependency
|
127
143
|
name: net-ptth
|
128
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,7 +146,7 @@ dependencies:
|
|
130
146
|
requirements:
|
131
147
|
- - '='
|
132
148
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.0.
|
149
|
+
version: 0.0.16
|
134
150
|
type: :runtime
|
135
151
|
prerelease: false
|
136
152
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -138,7 +154,7 @@ dependencies:
|
|
138
154
|
requirements:
|
139
155
|
- - '='
|
140
156
|
- !ruby/object:Gem::Version
|
141
|
-
version: 0.0.
|
157
|
+
version: 0.0.16
|
142
158
|
- !ruby/object:Gem::Dependency
|
143
159
|
name: net-http-digest_auth
|
144
160
|
requirement: !ruby/object:Gem::Requirement
|
@@ -171,6 +187,22 @@ dependencies:
|
|
171
187
|
- - ~>
|
172
188
|
- !ruby/object:Gem::Version
|
173
189
|
version: 4.4.0
|
190
|
+
- !ruby/object:Gem::Dependency
|
191
|
+
name: minitest-given
|
192
|
+
requirement: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
194
|
+
requirements:
|
195
|
+
- - ~>
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: 3.0.0
|
198
|
+
type: :development
|
199
|
+
prerelease: false
|
200
|
+
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
202
|
+
requirements:
|
203
|
+
- - ~>
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: 3.0.0
|
174
206
|
- !ruby/object:Gem::Dependency
|
175
207
|
name: fakeweb
|
176
208
|
requirement: !ruby/object:Gem::Requirement
|
@@ -261,6 +293,10 @@ files:
|
|
261
293
|
- test/fixtures/files/transition_1.png
|
262
294
|
- test/fixtures/files/transition_2.png
|
263
295
|
- test/fixtures/files/transition_3.png
|
296
|
+
- test/test_helper.rb
|
297
|
+
- test/unit/configuration_test.rb
|
298
|
+
- test/unit/device_test.rb
|
299
|
+
- test/unit/player/media_test.rb
|
264
300
|
homepage: http://github.com/elcuervo/airplay
|
265
301
|
licenses:
|
266
302
|
- MIT
|
@@ -293,3 +329,7 @@ test_files:
|
|
293
329
|
- test/fixtures/files/transition_1.png
|
294
330
|
- test/fixtures/files/transition_2.png
|
295
331
|
- test/fixtures/files/transition_3.png
|
332
|
+
- test/test_helper.rb
|
333
|
+
- test/unit/configuration_test.rb
|
334
|
+
- test/unit/device_test.rb
|
335
|
+
- test/unit/player/media_test.rb
|