sscharter 0.5.0 → 0.5.3

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: 8a943768e6ccb1b3d49ea613906e43cb2f67754163452b40ddca1a2bc79931ed
4
- data.tar.gz: d2d6e47744b310cf86dca899136d26a7ed36b6322a663354be26b06c81de573e
3
+ metadata.gz: 065ee5d5dcbb9b881ef8c302c900643b4ab3f40d089ffed2e9eb36b3e5d219c7
4
+ data.tar.gz: 98279a939f070e49d4bccdc5c587e4e619243f8646d1300900dc5edf1b1c5724
5
5
  SHA512:
6
- metadata.gz: d9895ab04396393eee863bb0cb8af4631e27af7c7c7f1b154dcac4da796a691dcaf35cba80ece174b1cda9332f245c8a7ad4ac23c8159888fb29cd677d52f802
7
- data.tar.gz: 2104bc67acc80130c885388b495f89fd3ce3c23d75a82d2f82d8829f51f47e669c5ef1541616b82fb987eede8f5a39b52484ef6e12d9764371a1d815f6447fe8
6
+ metadata.gz: 1dccdf3e5bea18e1c15a9202f5ae57cd3620c04a7287f24a464a7363738de02819608a81a693a851eedd8ef1928bf9ac22a248cb61df617b718ef44a79af4e0d
7
+ data.tar.gz: 9973f1da573b1e3abbd6b5b8da220febdabe9dbf31d50ba53ff4a44174389d2e26e2742c3e4b353af7bfe922fb6c7f146d48198b2b248e28a476bf4b7ea7d29a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sscharter (0.4.0)
4
+ sscharter (0.5.3)
5
5
  filewatcher (~> 2.0)
6
6
  launchy (~> 2.5)
7
7
  rubyzip (~> 2.3)
@@ -10,16 +10,16 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- addressable (2.8.5)
13
+ addressable (2.8.6)
14
14
  public_suffix (>= 2.0.2, < 6.0)
15
15
  filewatcher (2.1.0)
16
16
  module_methods (~> 0.1.0)
17
17
  launchy (2.5.2)
18
18
  addressable (~> 2.8)
19
- minitest (5.20.0)
19
+ minitest (5.22.0)
20
20
  module_methods (0.1.0)
21
- public_suffix (5.0.3)
22
- rake (13.0.6)
21
+ public_suffix (5.0.4)
22
+ rake (13.1.0)
23
23
  rubyzip (2.3.2)
24
24
  webrick (1.8.1)
25
25
 
@@ -36,4 +36,4 @@ DEPENDENCIES
36
36
  webrick (~> 1.8)
37
37
 
38
38
  BUNDLED WITH
39
- 2.4.13
39
+ 2.5.4
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sunniesnow
4
4
  class Charter
5
- VERSION = "0.5.0"
5
+ VERSION = "0.5.3"
6
6
  end
7
7
  end
data/lib/sscharter.rb CHANGED
@@ -221,6 +221,11 @@ class Sunniesnow::Charter
221
221
  end
222
222
 
223
223
  def check
224
+ if !@x.is_a?(Numeric) || !@y.is_a?(Numeric)
225
+ raise ArgumentError, 'x and y must be numbers'
226
+ end
227
+ @x = @x.to_f
228
+ @y = @y.to_f
224
229
  %i[@relative_time @speed @relative_beat @beat_speed].each do |key|
225
230
  value = instance_variable_get key
226
231
  raise ArgumentError, "cannot specify both #@time_key and #{key}" if @time_key && value&.!=(0)
@@ -270,7 +275,7 @@ class Sunniesnow::Charter
270
275
  hard: '#e75e74',
271
276
  master: '#8c68f3',
272
277
  special: '#f156ee'
273
- }
278
+ }.freeze
274
279
 
275
280
  DIRECTIONS = {
276
281
  right: 0.0,
@@ -282,6 +287,19 @@ class Sunniesnow::Charter
282
287
  down: -Math::PI / 2,
283
288
  down_right: -Math::PI / 4
284
289
  }
290
+ {
291
+ right: %i[r],
292
+ up_right: %i[ur ru],
293
+ up: %i[u],
294
+ up_left: %i[ul lu],
295
+ left: %i[l],
296
+ down_left: %i[dl ld],
297
+ down: %i[d],
298
+ down_right: %i[dr rd]
299
+ }.each do |direction_name, aliases|
300
+ aliases.each { DIRECTIONS[_1] = DIRECTIONS[direction_name] }
301
+ end
302
+ DIRECTIONS.freeze
285
303
 
286
304
  singleton_class.attr_reader :charts
287
305
  @charts = {}
data/tutorial/tutorial.md CHANGED
@@ -163,6 +163,7 @@ charter 'Your name'
163
163
  difficulty_name 'Master'
164
164
  difficulty_color '#8c68f3'
165
165
  difficulty '12'
166
+ difficulty_sup '+' # optional
166
167
 
167
168
  offset 0
168
169
  bpm 120
@@ -248,6 +249,7 @@ charter 'Your name'
248
249
  difficulty_name 'Master'
249
250
  difficulty_color '#8c68f3'
250
251
  difficulty '12'
252
+ difficulty_sup '+' # optional
251
253
  ```
252
254
 
253
255
  These lines are the metadata of the chart.
@@ -552,7 +554,7 @@ If you see something similar, congratulations!
552
554
 
553
555
  ### Background patterns
554
556
 
555
- There are totally 7 different kinds of background patterns:
557
+ There are totally 8 different kinds of background patterns:
556
558
 
557
559
  | Pattern | Syntax |
558
560
  |-|-|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sscharter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ulysses Zhan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-27 00:00:00.000000000 Z
11
+ date: 2024-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '13.0'
97
- description:
97
+ description:
98
98
  email:
99
99
  - ulysseszhan@gmail.com
100
100
  executables:
@@ -120,7 +120,7 @@ licenses: []
120
120
  metadata:
121
121
  homepage_uri: https://github.com/sunniesnow/sscharter
122
122
  source_code_uri: https://github.com/sunniesnow/sscharter
123
- post_install_message:
123
+ post_install_message:
124
124
  rdoc_options: []
125
125
  require_paths:
126
126
  - lib
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubygems_version: 3.4.22
139
- signing_key:
139
+ signing_key:
140
140
  specification_version: 4
141
141
  summary: A Ruby DSL for writing Sunniesnow charts
142
142
  test_files: []