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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +13 -14
  3. data/README.md +1 -1
  4. data/bin/rubyhome +1 -1
  5. data/lib/ruby_home/accessory_info.rb +33 -72
  6. data/lib/ruby_home/device_id.rb +0 -2
  7. data/lib/ruby_home/dns/service.rb +1 -6
  8. data/lib/ruby_home/dns/text_record.rb +0 -2
  9. data/lib/ruby_home/factories/accessory_factory.rb +0 -5
  10. data/lib/ruby_home/factories/characteristic_factory.rb +0 -3
  11. data/lib/ruby_home/factories/templates/characteristic_template.rb +0 -1
  12. data/lib/ruby_home/factories/templates/service_template.rb +0 -2
  13. data/lib/ruby_home/hap/accessory.rb +2 -2
  14. data/lib/ruby_home/hap/characteristic.rb +2 -2
  15. data/lib/ruby_home/hap/crypto/chacha20poly1305.rb +0 -4
  16. data/lib/ruby_home/hap/crypto/hkdf.rb +0 -2
  17. data/lib/ruby_home/hap/http_decryption.rb +5 -6
  18. data/lib/ruby_home/hap/http_encryption.rb +21 -11
  19. data/lib/ruby_home/hap/service.rb +0 -3
  20. data/lib/ruby_home/hap/tlv.rb +28 -21
  21. data/lib/ruby_home/hex_helper.rb +15 -0
  22. data/lib/ruby_home/http/application.rb +24 -19
  23. data/lib/ruby_home/http/controllers/accessories_controller.rb +1 -2
  24. data/lib/ruby_home/http/controllers/application_controller.rb +60 -13
  25. data/lib/ruby_home/http/controllers/characteristics_controller.rb +2 -3
  26. data/lib/ruby_home/http/controllers/pair_setups_controller.rb +41 -78
  27. data/lib/ruby_home/http/controllers/pair_verifies_controller.rb +22 -24
  28. data/lib/ruby_home/http/controllers/pairings_controller.rb +8 -8
  29. data/lib/ruby_home/http/hap_request.rb +2 -6
  30. data/lib/ruby_home/http/hap_response.rb +2 -8
  31. data/lib/ruby_home/http/hap_server.rb +7 -12
  32. data/lib/ruby_home/http/serializers/object_serializer.rb +0 -2
  33. data/lib/ruby_home/http/services/start_srp_service.rb +46 -0
  34. data/lib/ruby_home/http/services/verify_srp_service.rb +55 -0
  35. data/lib/ruby_home/rack/handler/hap_server.rb +2 -7
  36. data/lib/ruby_home/version.rb +1 -1
  37. data/lib/ruby_home/yaml_record.rb +440 -0
  38. data/lib/ruby_home.rb +45 -6
  39. data/rubyhome.gemspec +4 -4
  40. metadata +44 -49
  41. data/lib/ruby_home/broadcast.rb +0 -31
  42. data/lib/ruby_home/hap/hex_pad.rb +0 -13
  43. data/lib/ruby_home/http/cache.rb +0 -30
@@ -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
@@ -1,13 +0,0 @@
1
- module RubyHome
2
- module HAP
3
- module HexPad
4
- def self.pad(input, pad_length: 24)
5
- [
6
- input
7
- .unpack1('H*')
8
- .rjust(pad_length, '0')
9
- ].pack('H*')
10
- end
11
- end
12
- end
13
- end
@@ -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