musica 0.0.2 → 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: 13cc496aefb62b54ba9970f25257f66a6456a7591b47d582f1345f21738e3b57
4
- data.tar.gz: a7494abfa0319eb4dd75bb073859caafaeed4aca124522636d73ce724a46ddf3
3
+ metadata.gz: 58e294915c0927510c3ad251196cfa53a23dfe60f1abc87b46688794ae9a8112
4
+ data.tar.gz: bd8603849d076e7e72d6c3bd47f96b1019d98fd1bc275125c8869993f7bda80c
5
5
  SHA512:
6
- metadata.gz: e1e81612f175b0f752f5b473bd40ae969ef905589ac6484654f6ea663cfce4d69d76f92fe20c62deeb72e57e898732af904aba4fddd9215a93488423e620fde7
7
- data.tar.gz: 51006597adfb4d47658fecf15125f06078181b310b0f88c7521c9c57cf626c1faf0aa57d6d2b56727b08d63f676013a6996b6a20900aa75b533a006ec8d7b6ad
6
+ metadata.gz: 3a7913af3724481bec22fc8327dfa475eb5fec30cb9dd18bde95be873033fe388286a9ae6413689a09e5f7549f43e58cfc025e9f6f19854103b1647ef0b369e8
7
+ data.tar.gz: be741c3b07d5860b22905c6eb30fe4ce843ba93861c291ebfa137cee0b1b879b59a58daefba01b3e0287e1ef4e299ad115bcd8ae6494aeccf5db668a046ef023
data/CHANGELOG.md CHANGED
@@ -1,4 +1,6 @@
1
- ## [Unreleased]
1
+ ## [0.1.2] - 2025-09-01
2
+
3
+ - Add YAML configuration support for player selection
2
4
 
3
5
  ## [0.0.2] - 2023-03-27
4
6
 
data/Gemfile CHANGED
@@ -4,6 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
+ gem "debug", "~> 1.7", ">= 1.7.1"
7
8
  gem "rake", "~> 13.0"
8
9
  gem "rspec", "~> 3.0"
9
10
  gem "standard", "~> 1.3"
data/Gemfile.lock CHANGED
@@ -1,13 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- musica (0.0.2)
4
+ musica (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.2)
10
+ debug (1.7.1)
11
+ irb (>= 1.5.0)
12
+ reline (>= 0.3.1)
10
13
  diff-lcs (1.5.0)
14
+ io-console (0.6.0)
15
+ irb (1.6.3)
16
+ reline (>= 0.3.0)
11
17
  json (2.6.3)
12
18
  language_server-protocol (3.17.0.3)
13
19
  parallel (1.22.1)
@@ -16,6 +22,8 @@ GEM
16
22
  rainbow (3.1.1)
17
23
  rake (13.0.6)
18
24
  regexp_parser (2.7.0)
25
+ reline (0.3.3)
26
+ io-console (~> 0.5)
19
27
  rexml (3.2.5)
20
28
  rspec (3.12.0)
21
29
  rspec-core (~> 3.12.0)
@@ -54,13 +62,15 @@ GEM
54
62
 
55
63
  PLATFORMS
56
64
  arm64-darwin-22
65
+ arm64-darwin-25
57
66
  x86_64-linux
58
67
 
59
68
  DEPENDENCIES
69
+ debug (~> 1.7, >= 1.7.1)
60
70
  musica!
61
71
  rake (~> 13.0)
62
72
  rspec (~> 3.0)
63
73
  standard (~> 1.3)
64
74
 
65
75
  BUNDLED WITH
66
- 2.4.8
76
+ 2.7.0
data/README.md CHANGED
@@ -20,7 +20,24 @@ If bundler is not being used to manage dependencies, install the gem by executin
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ Run commands to control your music player:
24
+
25
+ $ musica play
26
+ $ musica pause
27
+ $ musica next track
28
+
29
+ ## Configuration
30
+
31
+ Musica can be configured to work with different music players. Create a configuration file at:
32
+ - `$XDG_CONFIG_HOME/musica/config.yml` (if XDG_CONFIG_HOME is set)
33
+ - `~/.config/musica/config.yml` (default)
34
+
35
+ Example configuration:
36
+ ```yaml
37
+ player: "Spotify"
38
+ ```
39
+
40
+ If no configuration file exists, one will be created automatically with the default player set to "Music".
24
41
 
25
42
  ## Development
26
43
 
data/lib/musica/cli.rb CHANGED
@@ -1,8 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "yaml"
4
+ require "fileutils"
5
+
1
6
  module Musica
2
7
  class Cli
3
8
  def initialize(argv)
4
9
  @prompt = argv.join(" ")
5
- @player = Musica::Player.new(application: "Music")
10
+ @player = Musica::Player.new(application: load_config)
6
11
  end
7
12
 
8
13
  def run
@@ -13,5 +18,24 @@ module Musica
13
18
  private
14
19
 
15
20
  attr_reader :argv, :player, :prompt
21
+
22
+ def load_config
23
+ config_dir = "#{ENV["XDG_CONFIG_HOME"]}/musica" || File.expand_path("~/.config/musica")
24
+ config_file = File.join(config_dir, "config.yml")
25
+
26
+ unless File.exist?(config_file)
27
+ create_config(config_dir, config_file)
28
+ end
29
+
30
+ YAML.load_file(config_file).dig("player")
31
+ end
32
+
33
+ def create_config(config_dir, config_file)
34
+ FileUtils.mkdir_p(config_dir)
35
+
36
+ default_config = { "player" => "Music" }
37
+
38
+ File.write(config_file, YAML.dump(default_config))
39
+ end
16
40
  end
17
41
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Musica
4
- VERSION = "0.0.2"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,16 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: musica
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Rzezak
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description:
14
12
  email:
15
13
  - arzezak@gmail.com
16
14
  executables:
@@ -40,7 +38,6 @@ metadata:
40
38
  homepage_uri: https://github.com/arzezak/musica
41
39
  source_code_uri: https://github.com/arzezak/musica
42
40
  changelog_uri: https://github.com/arzezak/musica/blob/main/CHANGELOG.md
43
- post_install_message:
44
41
  rdoc_options: []
45
42
  require_paths:
46
43
  - lib
@@ -55,8 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
52
  - !ruby/object:Gem::Version
56
53
  version: '0'
57
54
  requirements: []
58
- rubygems_version: 3.4.8
59
- signing_key:
55
+ rubygems_version: 3.7.1
60
56
  specification_version: 4
61
57
  summary: Control macOS music players from the command-line
62
58
  test_files: []