text2048 0.6.0 → 0.7.0

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: 3b38ba8bba87211b11aec9d46187e5e67edb98e9
4
- data.tar.gz: f8238c1b70544f21ed8a7d260947e513f5e248ca
3
+ metadata.gz: b3a9fa828625d47123e5b5da1f648bb3469f8238
4
+ data.tar.gz: 686ec778c882bfbf3f2c9ae667e39a3f1aba8825
5
5
  SHA512:
6
- metadata.gz: e6dd1f5d927c70135e72be6c56a76870b545a77455f0582d17f20c14b2226be70b09878d5e76a4ba1ae8a5f1b74cf9dc13bc37d4f61e61f2a370b88314bacd35
7
- data.tar.gz: f24978440f3041a49956726d910cdc472f7b618181910cdd34195b6f1cc07b675dac8e7fe5dd8e1bb6b08a04ffabf72110b58448db731f91567308c2d3e79715
6
+ metadata.gz: 7b668ba69fe2bc9ddaa776de2480b794eeedab09ed9bf3e4ef36fa9b5b579477d9f945a15422f7ed914fed1d869e10f6ce9be15137f1b54ac26359aa19eba8aa
7
+ data.tar.gz: a67611a3b78da79182004417ef90826b2d750fde61bd28b9cb206980469ddc055ab9ffe9f554960b9f03cf4ffaceeb2d6b02d17200b119e8877e7089db561e04
@@ -12,7 +12,7 @@ module Text2048
12
12
  attr_reader :score
13
13
 
14
14
  def initialize(tiles = Array.new(4) { Array.new(4, 0) }, score = 0)
15
- @all_tiles = tiles.to_h
15
+ @all_tiles = tiles.hashinize
16
16
  @score = score
17
17
  end
18
18
 
@@ -6,7 +6,7 @@ module Text2048
6
6
  module Array
7
7
  # 2048 related methods
8
8
  module Board
9
- def to_h
9
+ def hashinize
10
10
  [0, 1, 2, 3].product([0, 1, 2, 3]).reduce({}) do |memo, (col, row)|
11
11
  tile = self[col][row]
12
12
  memo[[col, row]] =
@@ -6,10 +6,8 @@ module Text2048
6
6
  module Hash
7
7
  # For 1.9 backword compatibility
8
8
  module Converter
9
- if RUBY_VERSION < '2.0'
10
- def to_h
11
- self
12
- end
9
+ def hashinize
10
+ self
13
11
  end
14
12
  end
15
13
  end
@@ -3,5 +3,5 @@
3
3
  # This module smells of :reek:UncommunicativeModuleName
4
4
  module Text2048
5
5
  # gem version.
6
- VERSION = '0.6.0'.freeze
6
+ VERSION = '0.7.0'.freeze
7
7
  end
data/spec/spec_helper.rb CHANGED
@@ -1,12 +1,21 @@
1
1
  # encoding: utf-8
2
2
 
3
+ require 'codeclimate-test-reporter'
4
+ require 'coveralls'
5
+ require 'simplecov'
6
+
3
7
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
8
 
5
- require 'codeclimate-test-reporter'
6
- CodeClimate::TestReporter.start
9
+ formatters = [SimpleCov::Formatter::HTMLFormatter]
7
10
 
8
- require 'coveralls'
9
- Coveralls.wear_merged!
11
+ formatters << Coveralls::SimpleCov::Formatter if ENV['COVERALLS_REPO_TOKEN']
12
+ if ENV['CODECLIMATE_REPO_TOKEN']
13
+ formatters << CodeClimate::TestReporter::Formatter
14
+ end
15
+
16
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[*formatters]
17
+
18
+ SimpleCov.start
10
19
 
11
20
  require 'rspec'
12
21
  require 'rspec/given'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text2048
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuhito Takamiya