sscharter 0.1.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: '078536b530d41a0c31d05aefb2554ad1baf4221776ce7980b1dc05a6aa3c3603'
4
- data.tar.gz: '0598dab880aa3f14a92f0c1b76df6814000b9e3c2499b9b79f6a2b0e9a458f09'
3
+ metadata.gz: 850d9242b14197642f97c44a83302b16b9093d57bf591b9e0a05be40c9575055
4
+ data.tar.gz: 6190327d91cd1101e469f35f28df7a0297feffa42409bb200382b756908cd40c
5
5
  SHA512:
6
- metadata.gz: 51b40f93074b6076c0b432ba5936788812c2f383dc6cfd8809adc3961cb14454133487753210ad53ba154ba548306796272cbbb9cb474aca4c036304f99cfce0
7
- data.tar.gz: 3af6cee975b795e582f143c1d3b769cd47819fdee1eeab6d44e3ce66e43abf263e12448ad16e088286db5d038049e6c9e893f85cf4af529de75274528eccb2ef
6
+ metadata.gz: 127338f44c7290e6feee3bf1f353b1588fd6afdee192149b458417811e8a46bb800869f20715600b76fa18e05c0e5253f249aaa894d93c82f9fb0cef696e1254
7
+ data.tar.gz: 463989ea415f5701f02ea4d2cf44f188f2e620ac4641bc5b9873b2821997fdd657610d29e94b9b69030fb6b0e59a25fa2f813fc7859e8b5ba7d52a20746aec05
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sscharter (0.1.0)
4
+ sscharter (0.2.1)
5
5
  filewatcher (~> 2.0)
6
6
  launchy (~> 2.5)
7
7
  rubyzip (~> 2.3)
@@ -16,7 +16,7 @@ GEM
16
16
  module_methods (~> 0.1.0)
17
17
  launchy (2.5.2)
18
18
  addressable (~> 2.8)
19
- minitest (5.19.0)
19
+ minitest (5.20.0)
20
20
  module_methods (0.1.0)
21
21
  public_suffix (5.0.3)
22
22
  rake (13.0.6)
data/lib/sscharter/cli.rb CHANGED
@@ -157,6 +157,13 @@ module Sunniesnow::Charter::CLI
157
157
  end
158
158
  end
159
159
  ::Sunniesnow::Charter.charts.each do |name, chart|
160
+ begin
161
+ output = chart.output_json
162
+ rescue => e
163
+ puts 'An error happened. Report if this is a bug of sscharter.'
164
+ puts e.full_message
165
+ return 2
166
+ end
160
167
  zip_file.get_output_stream "#{name}.json" do |file|
161
168
  file.write chart.output_json
162
169
  end
@@ -172,7 +179,7 @@ module Sunniesnow::Charter::CLI
172
179
  server.mount_proc "/#{config[:project_name]}.ssc" do |request, response|
173
180
  response['Content-Type'] = 'application/zip'
174
181
  response['Access-Control-Allow-Origin'] = '*'
175
- response.body = File.read File.join config[:build_dir], "#{config[:project_name]}.ssc"
182
+ response.body = File.read File.join(config[:build_dir], "#{config[:project_name]}.ssc"), binmode: true
176
183
  end
177
184
  url = CGI.escape "http://localhost:#{port}/#{config[:project_name]}.ssc"
178
185
  filewatcher = Filewatcher.new [config[:files_dir], config[:sources_dir], *config[:include]]
@@ -11,7 +11,7 @@ module Sunniesnow::Utils
11
11
  low = 0
12
12
  high = length
13
13
  while low < high
14
- mid = (low + high) / 2
14
+ mid = low + high >> 1
15
15
  compare = compare_function.(self[mid])
16
16
  if compare == 0
17
17
  return mid
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sunniesnow
4
4
  class Charter
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
data/lib/sscharter.rb CHANGED
@@ -156,7 +156,7 @@ class Sunniesnow::Charter
156
156
  cyy = zz*yy - yz*zy
157
157
  cyx = zz*yx - yz*zx
158
158
  dyp = cy0*-cross + cyy*dy + cyx*dx
159
-
159
+
160
160
  event[:angle] = atan2 dyp, dxp
161
161
  event
162
162
  end
@@ -490,6 +490,7 @@ class Sunniesnow::Charter
490
490
  end
491
491
  @groups.each { _1.push event }
492
492
  end
493
+ @current_duplicate += 1
493
494
  result
494
495
  end
495
496
 
@@ -540,8 +541,8 @@ class Sunniesnow::Charter
540
541
  alias f flick
541
542
 
542
543
  def bg_note x, y, duration_beats = 0, text = ''
543
- if !x.is_a?(Numeric) || !y.is_a?(Numeric)
544
- raise ArgumentError, 'x and y must be numbers'
544
+ if !x.is_a?(Numeric) || !y.is_a?(Numeric) || !duration_beats.is_a?(Numeric)
545
+ raise ArgumentError, 'x, y, and duration_beats must be numbers'
545
546
  end
546
547
  if duration_beats < 0
547
548
  raise ArgumentError, 'duration must be non-negative'
data/tutorial/tutorial.md CHANGED
@@ -691,7 +691,7 @@ end
691
691
 
692
692
  Transformations can also be used to bulk edit notes.
693
693
  Imagine that you have already written a bunch of notes with their coordinates,
694
- but you then decided them move them (say, translating by vector $(25,25)$).
694
+ but you then decided them move them (say, translating by vector $`(25,25)`$).
695
695
  You can use `transform` to do that:
696
696
 
697
697
  ```ruby
@@ -999,6 +999,18 @@ their duplicates are also connected by the same tip point, too.
999
999
 
1000
1000
  TODO.
1001
1001
 
1002
+ ### Use Git as a version manager
1003
+
1004
+ ### Useful loops
1005
+
1006
+ ### Homography
1007
+
1008
+ ### Tip points and placeholders
1009
+
1010
+ ### Multiple offsets
1011
+
1012
+ ### JSON post-processing
1013
+
1002
1014
  ## Step 6: review your chart and write the README
1003
1015
 
1004
1016
  Now, you have finished writing the chart!
@@ -1016,4 +1028,5 @@ Congratulations! You finished your chart.
1016
1028
  Now, you can distribute the level file to people who may want to play it.
1017
1029
 
1018
1030
  If you want your chart to be available as an online level of Sunniesnow,
1019
- you need to [contact the author of Sunniesnow](mailto:UlyssesZhan <ulysseszhan@gmail.com>).
1031
+ you need to
1032
+ <a href="mailto:UlyssesZhan <ulysseszhan@gmail.com>">contact the author of Sunniesnow</a>.
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.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ulysses Zhan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-25 00:00:00.000000000 Z
11
+ date: 2023-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip