feen 4.0.1 → 4.0.3

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: 1a033acfb60b8db7f259e6e787c71c6e9cae62ef3127faeddfec5c881e9a0171
4
- data.tar.gz: f62cf07a12178a848df661c9a695bc7eb9c8adcac1ea399c252f7c4d9aee77af
3
+ metadata.gz: 98cae677c862ba15d503bd607228abfd3aa06f7b4524c30f1a8890f446978784
4
+ data.tar.gz: ce5628e2b182d15d7e51567b67550338308a87508bf4422cae6e710b04aa6e33
5
5
  SHA512:
6
- metadata.gz: d96c233e0adb0998281b40e8b282526275ace24c53d9200fffd66907617b0b905d34c592ad7f45659d3f8df9dfa64e738c825c2582b6e5d18da443008a2ae348
7
- data.tar.gz: 443ec302a41d65bc96ca9605edc8d3b2f8fbfd323d042da95a3d783c86f7af301389d8d61f9e1114ec019084d94afe1af8602a70e9b4511ce6a8df177e8f6b82
6
+ metadata.gz: b294ea3521b0e34fbce443942d7c9aec06388f290025977d6995312f0a01492aedd498ea6a9e41b5eb19f9762ae79a6970a512f192fda2ab09ec890cd77c606d
7
+ data.tar.gz: 6dd225e8abcf4189f4124225a35d26c1f1faf39e804204f2467bf11350539394f9ea52eeabb3835d1d3ab232c74b1136e341f21669b469a126395473034bdac7
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
- The MIT License (MIT)
1
+ # The MIT License
2
2
 
3
- Copyright (c) 2020 Sashite
3
+ Copyright (c) 2020-2023 Sashité
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,35 +1,42 @@
1
1
  # FEEN.rb
2
2
 
3
- [![Build Status](https://travis-ci.org/sashite/feen.rb.svg?branch=master)](https://travis-ci.org/sashite/feen.rb)
4
- [![Documentation](https://img.shields.io/:yard-docs-38c800.svg)](https://rubydoc.info/gems/feen/frames)
3
+ [![Version](https://img.shields.io/github/v/tag/sashite/feen.rb?label=Version&logo=github)](https://github.com/sashite/feen.rb/releases)
4
+ [![Yard documentation](https://img.shields.io/badge/Yard-documentation-blue.svg?logo=github)](https://rubydoc.info/github/sashite/feen.rb/main)
5
+ [![CI](https://github.com/sashite/feen.rb/workflows/CI/badge.svg?branch=main)](https://github.com/sashite/feen.rb/actions?query=workflow%3Aci+branch%3Amain)
6
+ [![RuboCop](https://github.com/sashite/feen.rb/workflows/RuboCop/badge.svg?branch=main)](https://github.com/sashite/feen.rb/actions?query=workflow%3Arubocop+branch%3Amain)
7
+ [![License](https://img.shields.io/github/license/sashite/feen.rb?label=License&logo=github)](https://github.com/sashite/feen.rb/raw/main/LICENSE.md)
5
8
 
6
- > __FEEN__ (Forsyth–Edwards Expanded Notation) support for the Ruby language.
9
+ > __FEEN__ (FEN Easy Extensible Notation) support for the Ruby language.
7
10
 
8
11
  ## Overview
9
12
 
10
- This is an implementation of [FEEN](https://developer.sashite.com/specs/forsyth-edwards-expanded-notation), a generic format that can be used for serializing and deserializing chess positions.
13
+ This is an implementation of [FEEN](https://developer.sashite.com/specs/fen-easy-extensible-notation), a generic format that can be used for serializing and deserializing chess positions.
11
14
 
12
- The main chess variants are supported, including [Chess](https://en.wikipedia.org/wiki/Chess), [Janggi](https://en.wikipedia.org/wiki/Janggi), [Makruk](https://en.wikipedia.org/wiki/Makruk), [Shogi](https://en.wikipedia.org/wiki/Shogi), [Xiangqi](https://en.wikipedia.org/wiki/Xiangqi).
15
+ The main chess variants may be supported, including [Chess](https://en.wikipedia.org/wiki/Chess), [Janggi](https://en.wikipedia.org/wiki/Janggi), [Makruk](https://en.wikipedia.org/wiki/Makruk), [Shogi](https://en.wikipedia.org/wiki/Shogi), [Xiangqi](https://en.wikipedia.org/wiki/Xiangqi).
13
16
 
14
- More exotic variants are also supported, like: [Dai dai shogi](https://en.wikipedia.org/wiki/Dai_dai_shogi), [Four-player chess](https://en.wikipedia.org/wiki/Four-player_chess), or [Three-dimensional chess](https://en.wikipedia.org/wiki/Three-dimensional_chess) 🖖
17
+ More exotic variants may be also supported, like: [Dai dai shogi](https://en.wikipedia.org/wiki/Dai_dai_shogi), [Four-player chess](https://en.wikipedia.org/wiki/Four-player_chess), or [Three-dimensional chess](https://en.wikipedia.org/wiki/Three-dimensional_chess) 🖖
15
18
 
16
- ![3D chess on Star Trek (from the episode "Court Martial")](https://github.com/sashite/feen.rb/raw/master/star-trek-chess.jpg)
19
+ ![3D chess on Star Trek (from the episode "Court Martial")](https://github.com/sashite/feen.rb/raw/main/star-trek-chess.jpg)
17
20
 
18
21
  ## Installation
19
22
 
20
23
  Add this line to your application's Gemfile:
21
24
 
22
25
  ```ruby
23
- gem 'feen'
26
+ gem "feen"
24
27
  ```
25
28
 
26
29
  And then execute:
27
30
 
28
- $ bundle
31
+ ```sh
32
+ bundle install
33
+ ```
29
34
 
30
35
  Or install it yourself as:
31
36
 
32
- $ gem install feen
37
+ ```sh
38
+ gem install feen
39
+ ```
33
40
 
34
41
  ## Usage
35
42
 
@@ -38,13 +45,13 @@ require "feen"
38
45
 
39
46
  # Dump a classic Tsume Shogi problem
40
47
  FEEN.dump(
41
- "in_hand": %w[S r r b g g g g s n n n n p p p p p p p p p p p p p p p p p],
42
- "shape": [9, 9],
43
- "side_id": 0,
44
- "square": {
45
- 3 => "s",
46
- 4 => "k",
47
- 5 => "s",
48
+ in_hand: %w[S r r b g g g g s n n n n p p p p p p p p p p p p p p p p p],
49
+ shape: [9, 9],
50
+ side_id: 0,
51
+ square: {
52
+ 3 => "s",
53
+ 4 => "k",
54
+ 5 => "s",
48
55
  22 => "+P",
49
56
  43 => "+B"
50
57
  }
@@ -60,8 +67,8 @@ FEEN.parse("3,s,k,s,3/9/4,+P,4/9/7,+B,1/9/9/9/9 0 S,b,g,g,g,g,n,n,n,n,p,p,p,p,p,
60
67
 
61
68
  The code is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
62
69
 
63
- ## About Sashite
70
+ ## About Sashité
64
71
 
65
- This [gem](https://rubygems.org/gems/feen) is maintained by [Sashite](https://sashite.com/).
72
+ This [gem](https://rubygems.org/gems/feen) is maintained by [Sashité](https://sashite.com/).
66
73
 
67
74
  With some [lines of code](https://github.com/sashite/), let's share the beauty of Chinese, Japanese and Western cultures through the game of chess!
@@ -20,7 +20,7 @@ module FEEN
20
20
  def self.dump(piece_names)
21
21
  return "-" if piece_names.empty?
22
22
 
23
- piece_names.sort.join("/")
23
+ piece_names.sort.join(",")
24
24
  end
25
25
  end
26
26
  end
data/lib/feen/parser.rb CHANGED
@@ -28,13 +28,13 @@ module FEEN
28
28
  #
29
29
  # @return [Hash] The position params representing the position.
30
30
  def self.call(feen)
31
- square_str, side_id_str, in_hand_str = feen.split(" ")
31
+ square_str, side_id_str, in_hand_str = feen.split
32
32
 
33
33
  {
34
34
  in_hand: InHand.parse(in_hand_str),
35
- shape: Shape.new(square_str).to_a,
35
+ shape: Shape.new(square_str).to_a,
36
36
  side_id: Turn.parse(side_id_str),
37
- square: Square.new(square_str).to_h
37
+ square: Square.new(square_str).to_h
38
38
  }
39
39
  end
40
40
  end
data/lib/feen.rb CHANGED
@@ -6,9 +6,9 @@ require_relative File.join("feen", "parser")
6
6
  # This module provides a Ruby interface for data serialization and
7
7
  # deserialization in FEEN format.
8
8
  #
9
- # @see https://developer.sashite.com/specs/forsyth-edwards-expanded-notation
9
+ # @see https://developer.sashite.com/specs/fen-easy-extensible-notation
10
10
  module FEEN
11
- # @example Dumps position params into a FEEN string.
11
+ # Dumps position params into a FEEN string.
12
12
  #
13
13
  # @param in_hand [Array] The list of pieces in hand.
14
14
  # @param shape [Array] The shape of the board.
@@ -33,10 +33,10 @@ module FEEN
33
33
  # @return [String] The FEEN string representing the position.
34
34
  def self.dump(in_hand:, shape:, side_id:, square:)
35
35
  Dumper.call(
36
- in_hand: in_hand,
37
- shape: shape,
38
- side_id: side_id,
39
- square: square
36
+ in_hand:,
37
+ shape:,
38
+ side_id:,
39
+ square:
40
40
  )
41
41
  end
42
42
 
metadata CHANGED
@@ -1,127 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feen
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Kato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-03 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: brutal
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: byebug
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: rubocop-performance
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop-thread_safety
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: simplecov
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: yard
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
11
+ date: 2023-04-24 00:00:00.000000000 Z
12
+ dependencies: []
125
13
  description: A Ruby interface for data serialization and deserialization in FEEN format.
126
14
  email: contact@cyril.email
127
15
  executables: []
@@ -140,13 +28,11 @@ files:
140
28
  - lib/feen/parser/shape.rb
141
29
  - lib/feen/parser/square.rb
142
30
  - lib/feen/parser/turn.rb
143
- homepage: https://developer.sashite.com/specs/forsyth-edwards-expanded-notation
31
+ homepage: https://github.com/sashite/feen.rb
144
32
  licenses:
145
33
  - MIT
146
34
  metadata:
147
- bug_tracker_uri: https://github.com/sashite/feen.rb/issues
148
- documentation_uri: https://rubydoc.info/gems/feen/index
149
- source_code_uri: https://github.com/sashite/feen.rb
35
+ rubygems_mfa_required: 'true'
150
36
  post_install_message:
151
37
  rdoc_options: []
152
38
  require_paths:
@@ -155,14 +41,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
41
  requirements:
156
42
  - - ">="
157
43
  - !ruby/object:Gem::Version
158
- version: 2.7.0
44
+ version: 3.2.0
159
45
  required_rubygems_version: !ruby/object:Gem::Requirement
160
46
  requirements:
161
47
  - - ">="
162
48
  - !ruby/object:Gem::Version
163
49
  version: '0'
164
50
  requirements: []
165
- rubygems_version: 3.1.2
51
+ rubygems_version: 3.4.6
166
52
  signing_key:
167
53
  specification_version: 4
168
54
  summary: FEEN support for the Ruby language.