ruby_home 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +13 -14
- data/README.md +1 -1
- data/bin/rubyhome +1 -1
- data/lib/ruby_home/accessory_info.rb +33 -72
- data/lib/ruby_home/device_id.rb +0 -2
- data/lib/ruby_home/dns/service.rb +1 -6
- data/lib/ruby_home/dns/text_record.rb +0 -2
- data/lib/ruby_home/factories/accessory_factory.rb +0 -5
- data/lib/ruby_home/factories/characteristic_factory.rb +0 -3
- data/lib/ruby_home/factories/templates/characteristic_template.rb +0 -1
- data/lib/ruby_home/factories/templates/service_template.rb +0 -2
- data/lib/ruby_home/hap/accessory.rb +2 -2
- data/lib/ruby_home/hap/characteristic.rb +2 -2
- data/lib/ruby_home/hap/crypto/chacha20poly1305.rb +0 -4
- data/lib/ruby_home/hap/crypto/hkdf.rb +0 -2
- data/lib/ruby_home/hap/http_decryption.rb +5 -6
- data/lib/ruby_home/hap/http_encryption.rb +21 -11
- data/lib/ruby_home/hap/service.rb +0 -3
- data/lib/ruby_home/hap/tlv.rb +28 -21
- data/lib/ruby_home/hex_helper.rb +15 -0
- data/lib/ruby_home/http/application.rb +24 -19
- data/lib/ruby_home/http/controllers/accessories_controller.rb +1 -2
- data/lib/ruby_home/http/controllers/application_controller.rb +60 -13
- data/lib/ruby_home/http/controllers/characteristics_controller.rb +2 -3
- data/lib/ruby_home/http/controllers/pair_setups_controller.rb +41 -78
- data/lib/ruby_home/http/controllers/pair_verifies_controller.rb +22 -24
- data/lib/ruby_home/http/controllers/pairings_controller.rb +8 -8
- data/lib/ruby_home/http/hap_request.rb +2 -6
- data/lib/ruby_home/http/hap_response.rb +2 -8
- data/lib/ruby_home/http/hap_server.rb +7 -12
- data/lib/ruby_home/http/serializers/object_serializer.rb +0 -2
- data/lib/ruby_home/http/services/start_srp_service.rb +46 -0
- data/lib/ruby_home/http/services/verify_srp_service.rb +55 -0
- data/lib/ruby_home/rack/handler/hap_server.rb +2 -7
- data/lib/ruby_home/version.rb +1 -1
- data/lib/ruby_home/yaml_record.rb +440 -0
- data/lib/ruby_home.rb +45 -6
- data/rubyhome.gemspec +4 -4
- metadata +44 -49
- data/lib/ruby_home/broadcast.rb +0 -31
- data/lib/ruby_home/hap/hex_pad.rb +0 -13
- data/lib/ruby_home/http/cache.rb +0 -30
data/lib/ruby_home/broadcast.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
require_relative 'dns/service'
|
2
|
-
require_relative 'http/application'
|
3
|
-
|
4
|
-
Thread.abort_on_exception = true
|
5
|
-
|
6
|
-
module RubyHome
|
7
|
-
class Broadcast
|
8
|
-
def self.run
|
9
|
-
threads = []
|
10
|
-
threads << Thread.new do
|
11
|
-
dns_service
|
12
|
-
end
|
13
|
-
threads.each(&:join)
|
14
|
-
|
15
|
-
http_server.run!
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.dns_service
|
19
|
-
@_dns_service ||= begin
|
20
|
-
service = RubyHome::DNS::Service.new(http_server.port)
|
21
|
-
|
22
|
-
service.register
|
23
|
-
service
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.http_server
|
28
|
-
@_http_server ||= RubyHome::HTTP::Application
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
data/lib/ruby_home/http/cache.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'singleton'
|
2
|
-
|
3
|
-
module RubyHome
|
4
|
-
module ActLikeHash
|
5
|
-
def [](key)
|
6
|
-
store[key]
|
7
|
-
end
|
8
|
-
|
9
|
-
def []=(key, value)
|
10
|
-
store[key] = value
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
class Cache
|
15
|
-
include ActLikeHash
|
16
|
-
|
17
|
-
def store
|
18
|
-
@store ||= {}
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
class GlobalCache
|
23
|
-
include Singleton
|
24
|
-
include ActLikeHash
|
25
|
-
|
26
|
-
def store
|
27
|
-
@@store ||= {}
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|