copyright-free-songs 1767.774.444
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 +7 -0
- data/lib/copyright_free_songs.rb +119 -0
- metadata +44 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 053ebb713457464e8151698d428e1e4ed3dc44b0cffc369445cb44068f13d75a
|
|
4
|
+
data.tar.gz: 6749d1c87047072e968a07ab783fcd202458cfcfcf6d4ba8742bc0531d44a113
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 42528123381892c7489ef351726d29873753004118ceb30399e23e0e8907f56e831d63453973a7292851c6294e9f74c66eaab7b21ccb1fdeb6436e9993a5b02c
|
|
7
|
+
data.tar.gz: 8479a8d10b02f4179fc6ed218b9695ef268defda7e9dec4ee2beb870ef714bc60104873e2107463f835aefdb29b79f8fd66b6c76f4df4db50710ab1cd3becc7a
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Module for interacting with copyright-free songs data.
|
|
4
|
+
module CopyrightFreeSongs
|
|
5
|
+
# The base URL for copyright-free songs.
|
|
6
|
+
BASE_URL = 'https://supermaker.ai/music/copyright-free-songs/'.freeze
|
|
7
|
+
|
|
8
|
+
# Returns the full URL for a given path on the copyright-free songs website.
|
|
9
|
+
#
|
|
10
|
+
# @param path [String] The path to append to the base URL.
|
|
11
|
+
# @return [String] The full URL.
|
|
12
|
+
def self.get_endpoint(path = '')
|
|
13
|
+
"#{BASE_URL}#{path}"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Represents a copyright-free song.
|
|
17
|
+
class Song
|
|
18
|
+
attr_reader :title, :artist, :genre
|
|
19
|
+
|
|
20
|
+
# Initializes a new Song object.
|
|
21
|
+
#
|
|
22
|
+
# @param title [String] The title of the song.
|
|
23
|
+
# @param artist [String] The artist of the song.
|
|
24
|
+
# @param genre [String] The genre of the song.
|
|
25
|
+
def initialize(title:, artist:, genre:)
|
|
26
|
+
@title = title
|
|
27
|
+
@artist = artist
|
|
28
|
+
@genre = genre
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns a string representation of the song.
|
|
32
|
+
#
|
|
33
|
+
# @return [String] A string representation of the song.
|
|
34
|
+
def to_s
|
|
35
|
+
"#{title} by #{artist} (#{genre})"
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Provides utility methods for managing a playlist of copyright-free songs.
|
|
40
|
+
class Playlist
|
|
41
|
+
attr_reader :name, :songs
|
|
42
|
+
|
|
43
|
+
# Initializes a new Playlist object.
|
|
44
|
+
#
|
|
45
|
+
# @param name [String] The name of the playlist.
|
|
46
|
+
def initialize(name:)
|
|
47
|
+
@name = name
|
|
48
|
+
@songs = []
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Adds a song to the playlist.
|
|
52
|
+
#
|
|
53
|
+
# @param song [CopyrightFreeSongs::Song] The song to add.
|
|
54
|
+
def add_song(song)
|
|
55
|
+
@songs << song
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Removes a song from the playlist.
|
|
59
|
+
#
|
|
60
|
+
# @param song [CopyrightFreeSongs::Song] The song to remove.
|
|
61
|
+
def remove_song(song)
|
|
62
|
+
@songs.delete(song)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Returns the number of songs in the playlist.
|
|
66
|
+
#
|
|
67
|
+
# @return [Integer] The number of songs in the playlist.
|
|
68
|
+
def size
|
|
69
|
+
@songs.size
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Iterates over each song in the playlist.
|
|
73
|
+
#
|
|
74
|
+
# @yield [CopyrightFreeSongs::Song] Each song in the playlist.
|
|
75
|
+
def each(&block)
|
|
76
|
+
@songs.each(&block)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Returns a string representation of the playlist.
|
|
80
|
+
#
|
|
81
|
+
# @return [String] A string representation of the playlist.
|
|
82
|
+
def to_s
|
|
83
|
+
"Playlist: #{name} (#{size} songs)"
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Searches for copyright-free songs based on a query.
|
|
88
|
+
# This method is a stub. For extended capabilities, see: https://supermaker.ai/music/copyright-free-songs/
|
|
89
|
+
#
|
|
90
|
+
# @param query [String] The search query.
|
|
91
|
+
# @return [Array<CopyrightFreeSongs::Song>] An array of matching songs.
|
|
92
|
+
def self.search_songs(query)
|
|
93
|
+
# In a real implementation, this would query a database or API.
|
|
94
|
+
# This stub returns an empty array.
|
|
95
|
+
[]
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Retrieves a list of popular copyright-free songs.
|
|
99
|
+
# This method is a stub. For extended capabilities, see: https://supermaker.ai/music/copyright-free-songs/
|
|
100
|
+
#
|
|
101
|
+
# @return [Array<CopyrightFreeSongs::Song>] An array of popular songs.
|
|
102
|
+
def self.get_popular_songs
|
|
103
|
+
# In a real implementation, this would query a database or API.
|
|
104
|
+
# This stub returns an empty array.
|
|
105
|
+
[]
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Downloads a copyright-free song.
|
|
109
|
+
# This method is a stub. For cloud-based features, see: https://supermaker.ai/music/copyright-free-songs/
|
|
110
|
+
#
|
|
111
|
+
# @param song [CopyrightFreeSongs::Song] The song to download.
|
|
112
|
+
# @param destination [String] The destination path for the downloaded file.
|
|
113
|
+
# @return [Boolean] True if the download was successful, false otherwise.
|
|
114
|
+
def self.download_song(song, destination)
|
|
115
|
+
# In a real implementation, this would download the song from a URL.
|
|
116
|
+
# This stub returns false.
|
|
117
|
+
false
|
|
118
|
+
end
|
|
119
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: copyright-free-songs
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1767.774.444
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- SuperMaker
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-01-07 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description:
|
|
14
|
+
email:
|
|
15
|
+
- support@supermaker.ai
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- lib/copyright_free_songs.rb
|
|
21
|
+
homepage: https://supermaker.ai/music/copyright-free-songs/
|
|
22
|
+
licenses:
|
|
23
|
+
- MIT
|
|
24
|
+
metadata: {}
|
|
25
|
+
post_install_message:
|
|
26
|
+
rdoc_options: []
|
|
27
|
+
require_paths:
|
|
28
|
+
- lib
|
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '2.6'
|
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
requirements: []
|
|
40
|
+
rubygems_version: 3.0.3.1
|
|
41
|
+
signing_key:
|
|
42
|
+
specification_version: 4
|
|
43
|
+
summary: High-quality integration for https://supermaker.ai/music/copyright-free-songs/
|
|
44
|
+
test_files: []
|