sashite-gan 0.0.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7290bdd98bab0d141cef6f7ed05b515d51175657
4
+ data.tar.gz: c699426a9dcc7530b714d1272735ec002d023078
5
+ SHA512:
6
+ metadata.gz: 6d008347910accfd80e61f883011f4eb5b1a705aa850214c6f9a33f2ac0087f12d3f70a741d59fe043902a60d159d1e1c60398358fc272027861ca49fa47a433
7
+ data.tar.gz: e9b488691546b34fc43875035a940eb3192ad001f4a99f23fb1e6fe2d102de45417409ec0ec9d1022083dcb55bfbeb3bc6d33cf0f8246b92a3104fefe39871cf
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.2
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Cyril Wack
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,38 @@
1
+ # Sashite::GAN
2
+
3
+ Implementation of [General Actor Notation](//sashite-wiki.herokuapp.com/General_Actor_Notation) for storing actors from abstract strategy games.
4
+
5
+ ## Status
6
+
7
+ [![Gem Version](https://badge.fury.io/rb/sashite-gan.svg)](//badge.fury.io/rb/sashite-gan)
8
+ [![Build Status](https://secure.travis-ci.org/sashite/gan.rb.svg?branch=master)](//travis-ci.org/sashite/gan.rb?branch=master)
9
+
10
+ ## Installation
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ gem 'sashite-gan'
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install sashite-gan
23
+
24
+ ## Usage
25
+
26
+ require 'sashite-gan'
27
+
28
+ actor = Sashite::GAN::Actor.new 2,
29
+ 'bc096c4c7f48fc5c4c162555e4df98169e204aea', 'top', 'xianqi', 'rook'
30
+ actor.to_gan # => '2:bc096c4c7f48fc5c4c162555e4df98169e204aea:top:xianqi:rook'
31
+
32
+ ## Contributing
33
+
34
+ 1. Fork it
35
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
36
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
37
+ 4. Push to the branch (`git push origin my-new-feature`)
38
+ 5. Create a new Pull Request
@@ -0,0 +1,7 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new do |t|
5
+ end
6
+
7
+ task(default: :test)
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,25 @@
1
+ module Sashite
2
+ module GAN
3
+ class Actor
4
+ attr_accessor :dimension, :cgh, :side, :variant, :name
5
+
6
+ def initialize dimension, cgh, side, variant, name
7
+ @dimension = dimension
8
+ @cgh = cgh
9
+ @side = side
10
+ @variant = variant
11
+ @name = name
12
+ end
13
+
14
+ def to_gan
15
+ [
16
+ @dimension,
17
+ @cgh,
18
+ @side,
19
+ @variant,
20
+ @name
21
+ ].join ':'
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,19 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = 'sashite-gan'
3
+ spec.version = File.read('VERSION.semver')
4
+ spec.authors = ['Cyril Wack']
5
+ spec.email = ['contact@cyril.io']
6
+ spec.summary = %q{A GAN implementation in Ruby.}
7
+ spec.description = %q{Implementation of GAN (General Actor Notation) for storing actors from abstract strategy games.}
8
+ spec.homepage = 'https://github.com/sashite/gan.rb'
9
+ spec.license = 'MIT'
10
+
11
+ spec.files = `git ls-files -z`.split("\x0")
12
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
13
+ spec.test_files = spec.files.grep(%r{^test/})
14
+ spec.require_paths = ['lib']
15
+
16
+ spec.add_development_dependency 'bundler', '~> 1.6'
17
+ spec.add_development_dependency 'minitest', '~> 5'
18
+ spec.add_development_dependency 'rake', '~> 10'
19
+ end
@@ -0,0 +1,2 @@
1
+ require 'sashite/gan'
2
+ require 'minitest/autorun'
@@ -0,0 +1,15 @@
1
+ require_relative '_test_helper'
2
+
3
+ describe Sashite::GAN::Actor do
4
+ describe '#to_s' do
5
+ before do
6
+ @actor = Sashite::GAN::Actor.new 2,
7
+ 'bc096c4c7f48fc5c4c162555e4df98169e204aea',
8
+ 'top', 'xianqi', 'rook'
9
+ end
10
+
11
+ it 'returns the GAN of the actor' do
12
+ @actor.to_gan.must_equal '2:bc096c4c7f48fc5c4c162555e4df98169e204aea:top:xianqi:rook'
13
+ end
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sashite-gan
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Cyril Wack
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: minitest
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10'
55
+ description: Implementation of GAN (General Actor Notation) for storing actors from
56
+ abstract strategy games.
57
+ email:
58
+ - contact@cyril.io
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".travis.yml"
65
+ - Gemfile
66
+ - LICENSE.md
67
+ - README.md
68
+ - Rakefile
69
+ - VERSION.semver
70
+ - lib/sashite/gan.rb
71
+ - sashite-gan.gemspec
72
+ - test/_test_helper.rb
73
+ - test/test_gan.rb
74
+ homepage: https://github.com/sashite/gan.rb
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.2.2
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: A GAN implementation in Ruby.
98
+ test_files:
99
+ - test/_test_helper.rb
100
+ - test/test_gan.rb