mc_dot_art_maker 0.4.0 → 0.4.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
  SHA1:
3
- metadata.gz: 144001b6a79d4c4e769f79d4945856ba6378316d
4
- data.tar.gz: fa4e456ade60eadeaafa495078341cad8c1dba22
3
+ metadata.gz: fe8bba8b3c0dd213bbc1373c7855a5e3e5d525ce
4
+ data.tar.gz: 1e9ef111cc8d79258a25cc2b3150b2008ab8fc69
5
5
  SHA512:
6
- metadata.gz: de51d06a5c62a7dda4b4c086bbefb0ed1eb88aa08575e31d44e13129c6cdf309825f8ff167278c951952e17d071ccdc7ed30d57d37ac8a7851e7f1a74ab9cc19
7
- data.tar.gz: fdc48d92deb4ab917cdbb8ebc71d1f5535424e87c3ca4d2f9595f62618ee5d9319aa3e1e0aec6470d64b8f6439ee3cff3ada893a2cd61279a3014f14bd2b8568
6
+ metadata.gz: b156b06c04153393b1538c8c333914112df2a3e27519d03a6a308212ae238b35054f276384ef44dea3900bad695cc09b8022deb0f91ed6e923dec4cc9008f733
7
+ data.tar.gz: 07e1adbf5b2a86e918f281528f0a188e53f9ce04de02349a4a6de90d7c90b7f6fddd96dc2dc24577aa17a1ebfeca5e460614695efa87cf595e271760be2c4f12
@@ -1,9 +1,9 @@
1
1
  module MCDotArtMaker
2
2
  class BlockList
3
3
  include Enumerable
4
- include Singleton
5
- def initialize
6
- @loader = MCDotArtMaker::TextureLoader.new
4
+ # include Singleton
5
+ def initialize(jar_path = nil)
6
+ @loader = MCDotArtMaker::TextureLoader.new(jar_path)
7
7
  @blocks = []
8
8
 
9
9
  # できるだけ多くのブロックを使ったバージョン
@@ -4,7 +4,7 @@ module MCDotArtMaker
4
4
  class Maker
5
5
  attr_reader :width, :height, :dots, :image
6
6
 
7
- def initialize(filename_or_image,dither_method = RiemersmaDitherMethod)
7
+ def initialize(filename_or_image,dither_method: RiemersmaDitherMethod, jar_path: nil)
8
8
  @image =
9
9
  case filename_or_image
10
10
  when String
@@ -16,9 +16,10 @@ module MCDotArtMaker
16
16
 
17
17
  @schematic_helper = MCDotArtMaker::SchematicHelper.new
18
18
  @schematic_helper.read(File.expand_path('../seed.schematic', __FILE__))
19
- @block_list = MCDotArtMaker::BlockList.instance
19
+ # @block_list = MCDotArtMaker::BlockList.instance
20
+ @block_list = MCDotArtMaker::BlockList.new(jar_path)
20
21
 
21
- @calculation_count = 0 # 近似ブロック計算が終わったらインクリメント
22
+ @calculation_count = 0
22
23
  @is_locked = false
23
24
 
24
25
  MCDotArtMaker::Dot.set_color_palette(@block_list)
@@ -32,7 +33,7 @@ module MCDotArtMaker
32
33
  def manipulate
33
34
  check_not_locked
34
35
  image = yield @image
35
- raise(ArgumentError,"Should return Magick::Image object") unless image.class == Magick::Image
36
+ raise(ArgumentError, "Should return Magick::Image object") unless image.class == Magick::Image
36
37
  @image = image
37
38
  end
38
39
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'mc_dot_art_maker'
3
- s.version = '0.4.0'
3
+ s.version = '0.4.1'
4
4
  s.licenses = ['MIT']
5
5
  s.summary = 'Dot Art Maker for Minecraft'
6
6
  s.description = 'Converting images to mosaic arts using Minecraft textures and .schematic files.'
@@ -8,6 +8,8 @@ Gem::Specification.new do |s|
8
8
  s.files = `git ls-files -z`.split("\x0")
9
9
  s.homepage = 'https://github.com/Kumassy/MCDotArtMaker'
10
10
 
11
+ s.required_ruby_version = '>= 2.1.0'
12
+
11
13
  s.add_development_dependency 'bindata'
12
14
  s.add_development_dependency 'color-rgb'
13
15
  s.add_development_dependency 'nbt_utils'
@@ -3,15 +3,15 @@ require 'test/unit'
3
3
 
4
4
  class BlockListTest < Test::Unit::TestCase
5
5
  def setup
6
- @block_list = MCDotArtMaker::BlockList.instance
6
+ @block_list = MCDotArtMaker::BlockList.new
7
7
  end
8
8
 
9
- def test_singleton
10
- assert_raise(NoMethodError){
11
- MCDotArtMaker::BlockList.new
12
- }
13
- assert_equal(MCDotArtMaker::BlockList,@block_list.class)
14
- end
9
+ # def test_singleton
10
+ # assert_raise(NoMethodError){
11
+ # MCDotArtMaker::BlockList.new
12
+ # }
13
+ # assert_equal(MCDotArtMaker::BlockList,@block_list.class)
14
+ # end
15
15
 
16
16
  def test_block_list
17
17
  assert_equal(58, @block_list.size)
@@ -15,7 +15,7 @@ class BlockPaletteTest < Test::Unit::TestCase
15
15
  end
16
16
  def setup
17
17
  METHODS.each do |m|
18
- maker = MCDotArtMaker::Maker.new("test/images/src/test_image.jpg",m)
18
+ maker = MCDotArtMaker::Maker.new("test/images/src/test_image.jpg",dither_method: m)
19
19
  maker.texture_image.write "test/images/tmp/dither_methods_#{m}.png"
20
20
  end
21
21
  end
data/test/test_dot.rb CHANGED
@@ -3,7 +3,7 @@ require 'test/unit'
3
3
 
4
4
  class DotTest < Test::Unit::TestCase
5
5
  def setup
6
- @block_list = MCDotArtMaker::BlockList.instance
6
+ @block_list = MCDotArtMaker::BlockList.new
7
7
  MCDotArtMaker::Dot.set_color_palette(@block_list)
8
8
  end
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mc_dot_art_maker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kumassy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-05 00:00:00.000000000 Z
11
+ date: 2016-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bindata
@@ -172,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
172
172
  requirements:
173
173
  - - ">="
174
174
  - !ruby/object:Gem::Version
175
- version: '0'
175
+ version: 2.1.0
176
176
  required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - ">="