vlc_proxy 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 838c6ceedc898be9d6c1bca8c6b9811a03a5fd4baac760b841d4b192bdd09dd1
4
- data.tar.gz: d101db097f1d8bd7a9984a5d521f25b141b0c2e7a21bf08344d2bc64a14443e9
3
+ metadata.gz: 55af8fdb16a59d8aabde1102d3c94d8c66f2f55eb30e408c30f632602b6c0c35
4
+ data.tar.gz: 0e00741374165ae9cfc4b2907acc67ff5827d82624e8927293e03255fc79ae5c
5
5
  SHA512:
6
- metadata.gz: c86b087a48edbdb6f5a9e891ef2e2414dfcbe7c22b9cae0940dd45184e6150bba17e0989e90411c20c33a763cd31b5313cc9bb4abd9764b2325bd6c6541b9739
7
- data.tar.gz: 0ad2aefec8a13c60beed9376dcd546121e0d08ace35a07b0250d48f837decbf530eef7c6d9319a6409d650cf7b6bb34a797b959a8083d28830785748891b0fb3
6
+ metadata.gz: f61cd8c90688ed04f5a422ffaa20393de9039766273dd430f62b556fe2e0f7e47185d425e267c88809b871d90aa74d590bfed15270299658a56b936fa1a7f4cc
7
+ data.tar.gz: 4df5dd0df57f09bc936bc2b23d73be36bbf0056902b03c3b9893650bd5fe77c795698b66052476f379683bf2bc8e53abbd8987a172c6b36bc090333f440fc646
@@ -1,7 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.3.0
5
4
  - 2.4.0
6
5
  - 2.5.0
7
- before_install: gem install bundler -v 1.16.2
6
+ - 2.6.0
7
+ - 2.7.0
data/README.md CHANGED
@@ -1,8 +1,17 @@
1
1
  # VlcProxy
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/vlc_proxy`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![Gem Version](https://badge.fury.io/rb/vlc_proxy.svg)](https://badge.fury.io/rb/vlc_proxy)
4
+ [![Build Status](https://travis-ci.org/zsyed91/vlc_proxy.svg?branch=master)](https://travis-ci.org/zsyed91/vlc_proxy)
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
+
7
+ VLC exposes an optional [http server](https://wiki.videolan.org/Documentation:Modules/http_intf/) for remote commands to be called against the
8
+ running instance of VLC. This can be configured to listen on localhost only and
9
+ uses HTTP basic auth for authentication.
10
+
11
+ The purpose of this gem is to allow programmatic access using ruby against this
12
+ http server. Possible use cases are scripts to automate VLC, expose automation
13
+ services to your VLC instance, gather information on your running VLC instance,
14
+ control VLC programmatically etc.
6
15
 
7
16
  ## Installation
8
17
 
@@ -22,17 +31,80 @@ Or install it yourself as:
22
31
 
23
32
  ## Usage
24
33
 
25
- TODO: Write usage instructions here
34
+ At the top of your application or script load the library:
35
+
36
+ ```ruby
37
+ require 'vlc_proxy
38
+ ```
39
+
40
+ ### Client Usage - Basic Example
41
+
42
+ First create the connection object by giving it both the hostname that VLC is
43
+ running on along with the password set for basic auth. The default port is `8080`
44
+ and the default scheme is `http`.
45
+
46
+ ```ruby
47
+ # Create the connection
48
+
49
+ connection = VlcProxy::Connection.new(hostname, password)
50
+
51
+ # Create the client
52
+ client = VlcProxy::Client.new(connection)
53
+
54
+ puts client.current_state.inspect
55
+ ```
56
+
57
+ ### Client Usage - Advanced Example
58
+
59
+ If you configure the HTTP server not to use the default port and scheme, you
60
+ can pass this into the connection object as optional inputs to override the defaults.
61
+
62
+ ```ruby
63
+ # Create the connection
64
+
65
+ port = 8090
66
+ connection = VlcProxy::Connection.new(hostname, password, port)
67
+
68
+ # Create the client
69
+ client = VlcProxy::Client.new(connection)
70
+
71
+ if client.connection.connected?
72
+ puts 'Hello VLC'
73
+ else
74
+ puts 'Failed to connect to VLC'
75
+ end
76
+ ```
77
+
78
+ ### Methods available
79
+
80
+ After creating the client, there are multiple methods exposed to interact with
81
+ the VLC instance. The basic example is to call current state, but we can also
82
+ make VLC take actions directly available through the UI.
83
+
84
+ - current_state
85
+ - pause_playlist
86
+ - start_playlist
87
+ - stop_playlist
88
+ - next_item
89
+ - previous_item
90
+ - toggle_repeat
91
+ - toggle_loop
92
+ - toggle_random
93
+ - toggle_fullscren
94
+ - increase_volume(amount)
95
+ - decrease_volume(amount)
96
+ - skip_forward(amount_in_seconds)
97
+ - skip_backward(amount_in_seconds)
26
98
 
27
99
  ## Development
28
100
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
101
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
102
 
31
103
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
104
 
33
105
  ## Contributing
34
106
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/vlc_proxy. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
107
+ Bug reports and pull requests are welcome on GitHub at https://github.com/zsyed91/vlc_proxy. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
108
 
37
109
  ## License
38
110
 
@@ -40,4 +112,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
40
112
 
41
113
  ## Code of Conduct
42
114
 
43
- Everyone interacting in the VlcProxy project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/vlc_proxy/blob/master/CODE_OF_CONDUCT.md).
115
+ Everyone interacting in the VlcProxy project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/zsyed91/vlc_proxy/blob/master/CODE_OF_CONDUCT.md).
@@ -10,7 +10,7 @@ module VlcProxy
10
10
  end
11
11
 
12
12
  def logger
13
- @logger.level = verbose? ? Logger::INFO : Logger::WARN
13
+ @logger.level = verbose? ? Logger::DEBUG : Logger::INFO
14
14
 
15
15
  @logger
16
16
  end
@@ -31,7 +31,7 @@ module VlcProxy
31
31
  request.basic_auth('', @password)
32
32
 
33
33
  Net::HTTP.start(uri.hostname, uri.port) do |http|
34
- @logger.info('Starting HTTP request')
34
+ @logger.debug('Starting HTTP request')
35
35
  http.request(request)
36
36
  end
37
37
  end
@@ -63,7 +63,7 @@ module VlcProxy
63
63
  base_url += "&#{params}"
64
64
  end
65
65
 
66
- @logger.info("built uri: #{base_url}")
66
+ @logger.debug("built uri: #{base_url}")
67
67
  URI(base_url)
68
68
  end
69
69
  end
@@ -1,3 +1,3 @@
1
1
  module VlcProxy
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vlc_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zshawn Syed
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-27 00:00:00.000000000 Z
11
+ date: 2020-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -128,7 +128,6 @@ files:
128
128
  - ".travis.yml"
129
129
  - CODE_OF_CONDUCT.md
130
130
  - Gemfile
131
- - Gemfile.lock
132
131
  - LICENSE.txt
133
132
  - README.md
134
133
  - Rakefile
@@ -1,79 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- vlc_proxy (0.1.0)
5
- nokogiri (>= 1.9.1)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- ansi (1.5.0)
11
- ast (2.4.1)
12
- coderay (1.1.3)
13
- diff-lcs (1.4.4)
14
- docile (1.3.2)
15
- method_source (0.9.2)
16
- mini_portile2 (2.4.0)
17
- nokogiri (1.10.10)
18
- mini_portile2 (~> 2.4.0)
19
- parallel (1.19.2)
20
- parser (2.7.1.4)
21
- ast (~> 2.4.1)
22
- pry (0.12.2)
23
- coderay (~> 1.1.0)
24
- method_source (~> 0.9.0)
25
- rainbow (3.0.0)
26
- rake (13.0.1)
27
- regexp_parser (1.7.1)
28
- rexml (3.2.4)
29
- rspec (3.9.0)
30
- rspec-core (~> 3.9.0)
31
- rspec-expectations (~> 3.9.0)
32
- rspec-mocks (~> 3.9.0)
33
- rspec-core (3.9.2)
34
- rspec-support (~> 3.9.3)
35
- rspec-expectations (3.9.2)
36
- diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.9.0)
38
- rspec-mocks (3.9.1)
39
- diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.9.0)
41
- rspec-support (3.9.3)
42
- rubocop (0.87.1)
43
- parallel (~> 1.10)
44
- parser (>= 2.7.1.1)
45
- rainbow (>= 2.2.2, < 4.0)
46
- regexp_parser (>= 1.7)
47
- rexml
48
- rubocop-ast (>= 0.1.0, < 1.0)
49
- ruby-progressbar (~> 1.7)
50
- unicode-display_width (>= 1.4.0, < 2.0)
51
- rubocop-ast (0.1.0)
52
- parser (>= 2.7.0.1)
53
- ruby-progressbar (1.10.1)
54
- simplecov (0.18.5)
55
- docile (~> 1.1)
56
- simplecov-html (~> 0.11)
57
- simplecov-console (0.7.2)
58
- ansi
59
- simplecov
60
- terminal-table
61
- simplecov-html (0.12.2)
62
- terminal-table (1.8.0)
63
- unicode-display_width (~> 1.1, >= 1.1.1)
64
- unicode-display_width (1.7.0)
65
-
66
- PLATFORMS
67
- ruby
68
-
69
- DEPENDENCIES
70
- pry (~> 0.12.1)
71
- rake (~> 13.0, >= 13.0.1)
72
- rspec (~> 3.9)
73
- rubocop (~> 0.87.0)
74
- simplecov (~> 0.18.5)
75
- simplecov-console (~> 0.7.2)
76
- vlc_proxy!
77
-
78
- BUNDLED WITH
79
- 2.1.4