muzak 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a0c1797fc188edb897360a4566f6b42c608fd1f
4
- data.tar.gz: 0c0bb97bcb1a5fa43ab23eb2fcc1b4c679e6cac5
3
+ metadata.gz: 3343a7ac9f6f6902736580ca2dc6d83821ccbdb8
4
+ data.tar.gz: 6e4ae9b75369dbdee0f1f3c3b74c970689c68ed8
5
5
  SHA512:
6
- metadata.gz: 60596423694b131ef73bb9429d67376e6e56f32fbd5b6d51df24bb1118bea5e75beb7d3654e9ac92690d51c5840f9bd7a50004796c92709c5cc588c6ebe7f4c4
7
- data.tar.gz: a040b8e2de4f7c04e8ba4a8ef4bb959d8c43bad93c7420757d8d98497dde0b94197c05364b291320bd9088058f1ebaff3d035ece6445157b660328b024bbf399
6
+ metadata.gz: a00938c127bc0458f8055ed5f8519bb3e17f165665744fb71f1ba7b668db270387016c68e16ceddc9fdfde8b347eb05236c525daa650e245e6cdabf937c66716
7
+ data.tar.gz: eb1c7eb8fb51521d7fed514915f4af1890ab1eab39b18af6810ae7167c0e1524790132bf7ffa489f367a2b074ff11b2f3998a7619340f27ed1a9a57b32e8e95f
data/bin/muzakd CHANGED
@@ -11,8 +11,7 @@ Thread.abort_on_exception = Muzak::Config.debug
11
11
 
12
12
  muzak = Muzak::Instance.new
13
13
 
14
- server_port = Muzak::Config.daemon_port || 2669
15
- server = TCPServer.new server_port
14
+ server = TCPServer.new Muzak::Config.daemon_port
16
15
 
17
16
  loop do
18
17
  Thread.new(server.accept) do |client|
@@ -29,18 +29,25 @@ module Muzak
29
29
  respond_to? "plugin_#{pname}"
30
30
  end
31
31
 
32
+ DEFAULT_CONFIG = {
33
+ # core defaults
34
+ "debug" => false,
35
+ "verbose" => true,
36
+ "music" => File.expand_path("~/music"),
37
+ "player" => "mpv",
38
+ "index-autobuild" => 86400,
39
+ "deep-index" => false,
40
+ "jukebox-size" => 100,
41
+
42
+ # client/daemon defaults
43
+ "daemon-port" => 2669,
44
+ "daemon-host" => "localhost",
45
+ }.freeze
46
+
32
47
  if File.exist?(CONFIG_FILE)
33
- @config = YAML::load_file(CONFIG_FILE)
48
+ user_config = YAML::load_file(CONFIG_FILE)
34
49
  else
35
- @config = {
36
- "debug" => false,
37
- "verbose" => true,
38
- "music" => File.expand_path("~/music"),
39
- "player" => "mpv",
40
- "index-autobuild" => 86400,
41
- "deep-index" => false,
42
- "jukebox-size" => 100
43
- }
50
+ user_config = DEFAULT_CONFIG
44
51
 
45
52
  [CONFIG_DIR, PLAYLIST_DIR, USER_PLUGIN_DIR, USER_COMMAND_DIR].each do |d|
46
53
  FileUtils.mkdir_p d
@@ -49,6 +56,8 @@ module Muzak
49
56
  sync!
50
57
  end
51
58
 
59
+ @config = DEFAULT_CONFIG.merge(user_config)
60
+
52
61
  @config.each do |key, _|
53
62
  define_singleton_method Utils.resolve_command(key) do
54
63
  @config[key]
@@ -1,6 +1,6 @@
1
1
  module Muzak
2
2
  # Muzak's current version
3
- VERSION = "0.1.7".freeze
3
+ VERSION = "0.1.8".freeze
4
4
 
5
5
  # The root directory for all user configuration, data, etc
6
6
  CONFIG_DIR = File.expand_path("~/.config/muzak").freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muzak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Woodruff