twisty_puzzles 0.0.13 → 0.0.14

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: 20cf60d5066716b3eaa148e33f1e8c598387573170e1005d034f3128e6b971cb
4
- data.tar.gz: 2770afd2a3a625f281089401c2a2ef47a6c61843d09026e9d999ee79139fe54e
3
+ metadata.gz: f95cf6c568aab20bad9dd5d48222afd5261215984a5da7c2c18b9d3bdf315763
4
+ data.tar.gz: 713e3825d332a49805f4938b8bc2be924f3813d49e25e9997278966409bb73fe
5
5
  SHA512:
6
- metadata.gz: 2bdf4691d6efea522b259510bcdb405820784870566948d47b653c91e2d8ca495d9946e17f0d9f703ee234bf0758b3a59969dc52e4f91eafa94659c624ac3930
7
- data.tar.gz: b28d42481604cbec6b748b025a3293eed64e2c7a90b0e6186c6eadeed63352f81b562e835f54bf6b4fbc9905bf047c917b269896c5504628c7d9c7352c1b70ec
6
+ metadata.gz: 2e0ba5a01642a11c57a1d83aeb6b22aa4de037fcbbd6a062a2aff29028f37260cd06a38e009fe5683949a65509a899acd925bbe3b58fdf1552760d5664631ade
7
+ data.tar.gz: 3b2d41b1b10065029813152e693f0c61c6b28557e1794d16dcb4d6c7b300fd7d0d6fa94b2b23de3e01041526ef03463a05a8854b1eec1be7cfaec7ef1943debb
@@ -156,7 +156,7 @@ module TwistyPuzzles # rubocop:disable Style/Documentation
156
156
  parse_open_bracket
157
157
  first_part = parse_nonempty_moves_with_triggers
158
158
  skip_spaces
159
- parse_comma
159
+ parse_pure_separator
160
160
  second_part = parse_nonempty_moves_with_triggers
161
161
  skip_spaces
162
162
  parse_close_bracket
@@ -166,27 +166,27 @@ module TwistyPuzzles # rubocop:disable Style/Documentation
166
166
  def parse_pure_commutator_no_brackets
167
167
  first_part_or_algorithm = parse_moves_with_triggers
168
168
  skip_spaces
169
- if @scanner.eos? || !@scanner.peek(1) == ','
169
+ if @scanner.eos? || !PURE_SEPARATORS.include?(@scanner.peek(1))
170
170
  return FakeCommutator.new(first_part_or_algorithm)
171
171
  end
172
172
 
173
173
  first_part = first_part_or_algorithm
174
174
  complain('move') if first_part.empty?
175
- parse_comma
175
+ parse_pure_separator
176
176
  second_part = parse_nonempty_moves_with_triggers
177
177
  skip_spaces
178
178
  PureCommutator.new(first_part, second_part)
179
179
  end
180
180
 
181
- def parse_comma
182
- complain('middle of pure commutator') unless @scanner.getch == ','
181
+ def parse_pure_separator
182
+ complain('middle of pure commutator') unless PURE_SEPARATORS.include?(@scanner.getch)
183
183
  end
184
184
 
185
185
  def parse_commutator_internal_after_separator(setup_or_first_part, separator)
186
- if [':', ';'].include?(separator)
186
+ if SETUP_SEPARATORS.include?(separator)
187
187
  inner_commutator = parse_setup_commutator_inner
188
188
  SetupCommutator.new(setup_or_first_part, inner_commutator)
189
- elsif separator == ','
189
+ elsif PURE_SEPARATORS.include?(separator)
190
190
  second_part = parse_nonempty_moves_with_triggers
191
191
  PureCommutator.new(setup_or_first_part, second_part)
192
192
  else
@@ -194,7 +194,9 @@ module TwistyPuzzles # rubocop:disable Style/Documentation
194
194
  end
195
195
  end
196
196
 
197
- SEPARATORS = %w[; : ,].freeze
197
+ SETUP_SEPARATORS = %w[; :].freeze
198
+ PURE_SEPARATORS = %w[/ ,].freeze
199
+ SEPARATORS = (SETUP_SEPARATORS + PURE_SEPARATORS).freeze
198
200
 
199
201
  def parse_separator
200
202
  separator = @scanner.getch
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TwistyPuzzles
4
- VERSION = '0.0.13'
4
+ VERSION = '0.0.14'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twisty_puzzles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernhard F. Brodowsky