shogi_koma 0.0.5 → 0.0.6

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
- SHA1:
3
- metadata.gz: 38ea8d2fafff928b5c0d8271fbee74588d2f7cb1
4
- data.tar.gz: a1d5e9dac5350be102d5b544a302a5621cf489e8
2
+ SHA256:
3
+ metadata.gz: 7006549d9682989e456fbd720bb13eab1d86f24e4e371cc0f4ee41f859ef50f7
4
+ data.tar.gz: e7bfcc042fb4f5fac11769bb5610376eb5ab001afa6c230b405494691e04a737
5
5
  SHA512:
6
- metadata.gz: d5f22bd0510b94f9e4318547a904531aeb84d334023a8e07b65d186c5246a2d537a4f81a1d108d6762e51dc473c290ae2b82b8d1bfacdba8c102e1d90faf72dd
7
- data.tar.gz: e2aa6d6a1b5c940c95faf5de6f12fa6de961c3feb68afafc318355e99d0e6b99fe3355f3a24ada8ca7f4810a65f7c886b7d98cf2c801d55868b67322675c2caa
6
+ metadata.gz: 7334f9c148ab19dd9106a56f9aeff5ba6a4f91c5c28f3f0b422ee426a73e5c51b225474851273ae6eef9667da633507864841680920707d0e755b5dfcc9ae8b5
7
+ data.tar.gz: 94243255b8037eeb37f91d12c479caa53a97725fcaf0ec82c959cb13f051a997776ec827c3d150db519c21de64443765ba2d3703117fc20d3c7d6bb54e5c823f
data/README.md CHANGED
@@ -37,7 +37,7 @@ require "shogi_koma"
37
37
  painter = ShogiKoma::Painter.new
38
38
  #painter.width = 200 # as default
39
39
  #painter.height = 200 # as default
40
- #painter.font = "IPAMincho" # as default
40
+ #painter.font = "xxx" # default: "Hiragino Mincho" or "MS Mincho" or "Noto"
41
41
  painter.write_to_png("歩", "shogi_koma-fu1.png")
42
42
  painter.write_to_png("歩兵", "shogi_koma-fu2.png")
43
43
  ```
@@ -55,7 +55,6 @@ Cairo::ImageSurface.new(:argb32, width, height) do |surface|
55
55
  Cairo::Context.new(surface) do |context|
56
56
  context.scale(width, height)
57
57
  painter = ShogiKoma::Painter.new
58
- #painter.font = "IPAMincho" # as default
59
58
  painter.draw(context, "歩")
60
59
  end
61
60
  end
data/Rakefile CHANGED
@@ -1,9 +1,10 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rake/testtask"
2
3
 
3
- desc "Run test"
4
- task :test do
5
- Bundler::GemHelper.install_tasks
6
- ruby("-rubygems", "test/run-test.rb")
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
7
8
  end
8
9
 
9
10
  task :default => :test
@@ -8,7 +8,10 @@ module ShogiKoma
8
8
  def initialize
9
9
  @width = 200
10
10
  @height = 200
11
- @font = "IPAMincho"
11
+ ["Hiragino Mincho", "MS Mincho", "Noto"].each do |font_name|
12
+ @font = Fontdock::Local.find(font_name)
13
+ break if @font
14
+ end
12
15
  @border_scale = 1.0
13
16
  set_body_rgb(1, 0.8, 0.2)
14
17
  set_frame_color(:black)
@@ -1,3 +1,3 @@
1
1
  module ShogiKoma
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/shogi_koma.gemspec CHANGED
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency("test-unit")
25
25
  spec.add_development_dependency("test-unit-notify")
26
26
  spec.add_development_dependency("test-unit-rr")
27
- spec.add_development_dependency("bundler", "~> 1.3")
27
+ spec.add_development_dependency("bundler")
28
28
  spec.add_development_dependency("rake")
29
29
  end
@@ -1,4 +1,4 @@
1
- require "shogi_koma/painter"
1
+ require "test_helper"
2
2
  require "cairo"
3
3
 
4
4
  class PainterTest < Test::Unit::TestCase
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
4
+ require "shogi_koma"
5
+
6
+ require "test-unit"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shogi_koma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masafumi Yokoyama
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-18 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cairo
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '1.3'
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '1.3'
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -128,13 +128,13 @@ files:
128
128
  - lib/shogi_koma/version.rb
129
129
  - sample/shogikoma.rb
130
130
  - shogi_koma.gemspec
131
- - test/run-test.rb
132
- - test/test-painter.rb
131
+ - test/painter_test.rb
132
+ - test/test_helper.rb
133
133
  homepage: https://github.com/myokoym/shogi_koma
134
134
  licenses:
135
135
  - MIT
136
136
  metadata: {}
137
- post_install_message:
137
+ post_install_message:
138
138
  rdoc_options: []
139
139
  require_paths:
140
140
  - lib
@@ -149,12 +149,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
151
  requirements: []
152
- rubyforge_project:
153
- rubygems_version: 2.2.2
154
- signing_key:
152
+ rubygems_version: 3.5.3
153
+ signing_key:
155
154
  specification_version: 4
156
155
  summary: An image generater for Shogi's pieces
157
156
  test_files:
158
- - test/run-test.rb
159
- - test/test-painter.rb
160
- has_rdoc:
157
+ - test/painter_test.rb
158
+ - test/test_helper.rb
data/test/run-test.rb DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "test-unit"
4
- require "test/unit/notify"
5
- require "test/unit/rr"
6
-
7
- base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
8
- $LOAD_PATH.unshift(File.join(base_dir, "lib"))
9
- $LOAD_PATH.unshift(File.join(base_dir, "test"))
10
-
11
- exit Test::Unit::AutoRunner.run(true)