ramekin 0.3.0 → 0.3.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: dc9d8831c982112091407c651b5f183b750c75d43d1e3d2615fbd89dc7b4446b
4
- data.tar.gz: 23b5db297f7166f9257609ab45888f81894e2d5df8d40a922920efe56f4e948d
3
+ metadata.gz: 66ae01e06b69f6c295e9bd28d8fb79959f28818fd70770d608883e5b4baf5226
4
+ data.tar.gz: 05ece2318701ce0b3036d984ed4169e9dfcc11e19b98b86b54ff3aacdd9781b2
5
5
  SHA512:
6
- metadata.gz: bd69f5639e4f86fb7792b38021a13e02f0604fd375f1821e59909b674d7160b9df2efad996cae43a94d47540f1ba33e051097b00f5278e02806b9f460859d916
7
- data.tar.gz: 449a4e060eba4cb7b93d6ab6ea92a10f7ba99411f2f66d6b94f105f465541547c7c92475fd23891208ac806395bf7b1a575ea0737b906c6f03c6a505005c88b7
6
+ metadata.gz: 1454727b090f2ee0db392c4822f3bb716c68ef5cdc23dd5156eeef9ab3f98a4fcde9eaa3964f21282f3caa7b152b9efa64067af57f8c35c6db365e153a665716
7
+ data.tar.gz: 06da5febfe538506f6dc98c08f0178c9311207b06380ce7601cb208925aec653c9a8ede8f9b04a33cd42d03b0150a2153bb038e7dceb105d9f9caad72cfd3e70
@@ -101,31 +101,21 @@ module Ramekin
101
101
  end
102
102
  end
103
103
 
104
- packs = @meta.instruments.map(&:pack).uniq
104
+ readme = @meta.readme&.value
105
105
 
106
- pack_info = packs.map do |pack|
107
- out = StringIO.new
108
- out << " #{pack.name}"
109
- out << " (posted by #{pack.authors.join(', ')})" if pack.authors.any?
110
- out << "\n"
106
+ if readme
107
+ File.write("./README.txt", <<~README)
108
+ #{readme}
111
109
 
112
- out << " - #{pack.url}"
113
- out.string
114
- end.join("\n\n")
110
+ --
115
111
 
116
- readme = @meta.readme&.value || '(you should edit this space before publishing)'
112
+ #{basename}.txt was composed as #{basename}.rmk with Ramekin
113
+ https://codeberg.org/jneen/ramekin
117
114
 
118
- File.write("./README.txt", <<~README)
119
- #{readme}
120
-
121
- --
122
-
123
- #{basename}.txt was composed as #{basename}.rmk with Ramekin
124
- https://codeberg.org/jneen/ramekin
125
-
126
- Sample sources:
127
- #{pack_info}
128
- README
115
+ Sample sources:
116
+ #{@meta.pack_info}
117
+ README
118
+ end
129
119
  end
130
120
  end
131
121
 
data/lib/ramekin/cli.rb CHANGED
@@ -258,13 +258,8 @@ module Ramekin
258
258
  $stderr.puts <<~MSG
259
259
  Package directory generated at #{@output_package}
260
260
  MSG
261
-
262
- $stderr.puts <<~MSG unless channels.meta.readme
263
- Please remember to edit README.txt!
264
- MSG
265
261
  end
266
262
 
267
- binding.pry
268
263
  if @output_vis
269
264
  FileUtils.cp(runner.vis_file, @output_vis)
270
265
  end
@@ -41,7 +41,9 @@ module Ramekin
41
41
  # spc_player: __auto__
42
42
  # spc_player: C:\\Users\\jneen\\Desktop\\spcplay\\spcplay.exe
43
43
  # spc_player: /path/to/bin/spct
44
-
44
+ #
45
+ # if spct is installed on your PATH
46
+ # spc_player: spct
45
47
  YML
46
48
  end
47
49
 
data/lib/ramekin/meta.rb CHANGED
@@ -24,12 +24,32 @@ module Ramekin
24
24
 
25
25
  def sample_path_unsafe
26
26
  return @sample_path if @sample_path
27
+ game = @game&.value
28
+ title = @title&.value
29
+ author = @author&.value
27
30
 
28
- return "#{@title.value} - #{@game.value}" if @title && @game
29
- return (@title || @game).value if @title || @game
31
+ game = nil if game && game.upcase == "N/A"
32
+
33
+ return "#{game} - #{title}" if game && title
34
+ return "#{author} - #{title}" if author && title
35
+ return title if title
30
36
  nil
31
37
  end
32
38
 
39
+ def pack_info
40
+ packs = self.instruments.map(&:pack).uniq
41
+
42
+ pack_info = packs.map do |pack|
43
+ out = StringIO.new
44
+ out << " #{pack.name}"
45
+ out << " (posted by #{pack.authors.join(', ')})" if pack.authors.any?
46
+ out << "\n"
47
+
48
+ out << " - #{pack.url}"
49
+ out.string
50
+ end.join("\n\n")
51
+ end
52
+
33
53
  def sample_path
34
54
  p = sample_path_unsafe
35
55
  return nil if p.nil?
@@ -53,6 +53,13 @@ module Ramekin
53
53
 
54
54
  yield "; generated from #{@filename} by Ramekin v#{RAMEKIN_VERSION}\n"
55
55
  yield "; https://codeberg.org/jneen/ramekin\n\n"
56
+ if m.instruments.any?
57
+ yield "; Sample Sources:\n"
58
+ m.pack_info.split("\n").each do |line|
59
+ yield "; #{line}\n"
60
+ end
61
+ yield "\n"
62
+ end
56
63
 
57
64
  amk = @track.meta.amk&.value || 4
58
65
  yield "#amk #{amk}\n"
@@ -3,7 +3,11 @@ module Ramekin
3
3
  def self.make_instance
4
4
  config = Ramekin.config.spc_player
5
5
  unless config == '__auto__'
6
- return CustomSPCPlayer.new(File.expand_path(config, HOME))
6
+ if config.start_with?('./') || config.start_with?('.\\')
7
+ return CustomSPCPlayer.new(File.expand_path(config, HOME))
8
+ else
9
+ return CustomSPCPlayer.new(config)
10
+ end
7
11
  end
8
12
 
9
13
  return WindowsSPCPlayer.new if Ramekin.config.windows?
@@ -96,7 +100,7 @@ module Ramekin
96
100
 
97
101
  class CustomSPCPlayer < SPCPlayer
98
102
  def initialize(path)
99
- @path = Ramekin.config.expand(path)
103
+ @path = path
100
104
  end
101
105
 
102
106
  def render(fname, outfile, seconds=nil)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ramekin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jneen
8
8
  bindir: gembin
9
9
  cert_chain: []
10
- date: 2025-03-25 00:00:00.000000000 Z
10
+ date: 2025-04-11 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: strscan
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.6.6
118
+ rubygems_version: 3.6.2
119
119
  specification_version: 4
120
120
  summary: A tool for making SMW music with AddmusicK
121
121
  test_files: []