sportsflix 1.0.0 → 1.1.0

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: a07fea841fba3e33d6b6107da4bf6a3c6e1cc62c
4
- data.tar.gz: c70331e47828b00fa300f22e23111759ae30cc26
3
+ metadata.gz: dd7ec5c71729b4aa9385032df26998139d54e1c9
4
+ data.tar.gz: 3a9faa2b861c78917ef7ee66e42adb32bcc552fc
5
5
  SHA512:
6
- metadata.gz: a266abb9098421fac6b0a82e92fcf302fb8dca0a4ab55a9bf5977ffc9700c39d2950a9ae63b87016b83c01f52d8fa5752a55f9ca575eb97f6ccd21d22293c8bd
7
- data.tar.gz: ae6a9e451e144e970ca5dc4c56996ff1ceeb36c3eb02d917df453b7cb3af670e470fdddce4827a21229acfc9a3832ce96d7ddfe39dff1f07e5561756ea0746f6
6
+ metadata.gz: 2803dcdc2eee196546c1f4057223b57d90877c3a44be2af4880a7f3b6e704f6041b8a3a30247ad5f34b758b16df1297c68db0ae160e369d1c483b96fef8354b7
7
+ data.tar.gz: 37712bba003af41363a33bbc968276df8b673756cc164e7b4f41179fed5b0e2c08946f57af5ff1a0c3d84b272cb940fcd756f50d10154004526feed3817fb70e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sportsflix (1.0.0)
4
+ sportsflix (1.1.0)
5
5
  oga (~> 2.8)
6
6
  thor (~> 0.19.4)
7
7
 
@@ -15,7 +15,7 @@ GEM
15
15
  diff-lcs (1.3)
16
16
  docile (1.1.5)
17
17
  json (2.0.3)
18
- oga (2.9)
18
+ oga (2.10)
19
19
  ast
20
20
  ruby-ll (~> 2.1)
21
21
  parser (2.3.3.1)
@@ -22,6 +22,7 @@ module Sportsflix
22
22
  class_option('interactive', { :type => :boolean, :default => false })
23
23
  class_option('server-only', { :aliases => :s, :type => :boolean, :default => false })
24
24
  class_option('proxy-delay', { :type => :numeric, :default => DEFAULT_PROXY_DELAY })
25
+ class_option('server-ip', { :type => :string })
25
26
 
26
27
  desc('watch', 'watch stream in the chosen player')
27
28
  def watch
@@ -14,6 +14,7 @@ module Sportsflix
14
14
  def initialize(options)
15
15
  @verbose = options[:verbose]
16
16
  @video_format = options['video-format']
17
+ @server_ip = options['server-ip']
17
18
 
18
19
  @executor = Sportsflix::Utils::Executor.new(options)
19
20
  end
@@ -29,11 +30,15 @@ module Sportsflix
29
30
 
30
31
  def url(uri)
31
32
  stream_uuid = uri.sub(ACESTREAM_STREAM_URI_PREFIX, '')
32
- machine_ip = local_ip
33
+ machine_ip = @server_ip || get_ip_from_host || local_ip
33
34
  "http://#{machine_ip}:8000/pid/#{stream_uuid}/stream.#{@video_format}"
34
35
  end
35
36
 
36
37
  private
38
+ def get_ip_from_host
39
+ ENV['DOCKER_HOST'].gsub(/tcp:\/\/(\S+?):.+/,'\1') if ENV['DOCKER_HOST']
40
+ end
41
+
37
42
  def local_ip
38
43
  # Turn off reverse DNS resolution temporarily
39
44
  orig = Socket.do_not_reverse_lookup
@@ -1,3 +1,3 @@
1
1
  module Sportsflix
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportsflix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Fernandes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-14 00:00:00.000000000 Z
11
+ date: 2017-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler