text2048 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -99
- data/features/step_definitions/2048_steps.rb +3 -3
- data/features/support/env.rb +1 -1
- data/lib/text2048/version.rb +1 -1
- data/text2048.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89758e865b37478a09bec28723b658c852c8fee3
|
4
|
+
data.tar.gz: 6460c24d0f3db36f73322bfe299471fa9804033c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f478dfd038ee7a57c25d596095fcb7f78acf6547bf0f45e0be3bce25a58cf22d23949a23e5080d21b35c6ecdc99e2db3ec88db121ebf14365aa6dfd612ede422
|
7
|
+
data.tar.gz: ff27433c3808da48425a4b6b2eb6b950a0a71d8fedf25da4103c0a90c4e0db36e142b7f19d1ff1f34b72ac864c3dea57e949a51adf0f41d1a71e1ff9190b8eee
|
data/Rakefile
CHANGED
@@ -1,105 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
require 'bundler/gem_tasks'
|
4
|
-
require 'coveralls/rake/task'
|
5
|
-
|
6
3
|
task default: [:test, :reek, :flog, :flay, :rubocop]
|
7
4
|
task test: [:spec, :cucumber, 'coveralls:push']
|
8
5
|
task travis: :default
|
9
6
|
|
10
|
-
|
11
|
-
|
12
|
-
begin
|
13
|
-
require 'rspec/core/rake_task'
|
14
|
-
RSpec::Core::RakeTask.new
|
15
|
-
rescue LoadError
|
16
|
-
task :spec do
|
17
|
-
$stderr.puts 'RSpec is disabled'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
begin
|
22
|
-
require 'cucumber/rake/task'
|
23
|
-
Cucumber::Rake::Task.new
|
24
|
-
rescue LoadError
|
25
|
-
task :cucumber do
|
26
|
-
$stderr.puts 'Cucumber is disabled'
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
begin
|
31
|
-
require 'rubocop/rake_task'
|
32
|
-
Rubocop::RakeTask.new
|
33
|
-
rescue LoadError
|
34
|
-
task :rubocop do
|
35
|
-
$stderr.puts 'Rubocop is disabled'
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
begin
|
40
|
-
require 'reek/rake/task'
|
41
|
-
Reek::Rake::Task.new do |t|
|
42
|
-
t.fail_on_error = true
|
43
|
-
t.verbose = false
|
44
|
-
t.reek_opts = '--quiet'
|
45
|
-
t.source_files = FileList['lib/**/*.rb']
|
46
|
-
end
|
47
|
-
rescue LoadError
|
48
|
-
task :reek do
|
49
|
-
$stderr.puts 'Reek is disabled'
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
begin
|
54
|
-
require 'flog'
|
55
|
-
desc 'Analyze for code complexity'
|
56
|
-
task :flog do
|
57
|
-
flog = Flog.new(continue: true)
|
58
|
-
flog.flog(*FileList['lib/**/*.rb'])
|
59
|
-
threshold = 19
|
60
|
-
|
61
|
-
bad_methods = flog.totals.select do |name, score|
|
62
|
-
!(/##{flog.no_method}$/ =~ name) && score > threshold
|
63
|
-
end
|
64
|
-
bad_methods.sort { |a, b| a[1] <=> b[1] }.reverse.each do |name, score|
|
65
|
-
printf "%8.1f: %s\n", score, name
|
66
|
-
end
|
67
|
-
unless bad_methods.empty?
|
68
|
-
fail "#{bad_methods.size} methods have a complexity > #{threshold}"
|
69
|
-
end
|
70
|
-
end
|
71
|
-
rescue LoadError
|
72
|
-
task :flog do
|
73
|
-
$stderr.puts 'Flog is disabled'
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
begin
|
78
|
-
require 'rake/tasklib'
|
79
|
-
require 'flay'
|
80
|
-
require 'flay_task'
|
81
|
-
|
82
|
-
FlayTask.new do |t|
|
83
|
-
t.dirs = FileList['lib/**/*.rb'].map do |each|
|
84
|
-
each[/[^\/]+/]
|
85
|
-
end.uniq
|
86
|
-
t.threshold = 0
|
87
|
-
t.verbose = true
|
88
|
-
end
|
89
|
-
rescue LoadError
|
90
|
-
task :flay do
|
91
|
-
$stderr.puts 'Flay is disabled'
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
begin
|
96
|
-
require 'yard'
|
97
|
-
YARD::Rake::YardocTask.new do |t|
|
98
|
-
t.options = ['--no-private']
|
99
|
-
t.options << '--debug' << '--verbose' if verbose == true
|
100
|
-
end
|
101
|
-
rescue LoadError
|
102
|
-
task :yard do
|
103
|
-
$stderr.puts 'YARD is disabled'
|
104
|
-
end
|
105
|
-
end
|
7
|
+
Dir.glob('tasks/*.rake').each { |each| import each }
|
@@ -6,7 +6,7 @@ Given(/^a board:$/) do |string|
|
|
6
6
|
layout = string.split("\n").reduce([]) do |memo, row|
|
7
7
|
memo << row.split(' ').map { |each| each.to_i }
|
8
8
|
end
|
9
|
-
@view = Text2048::TextView.new(
|
9
|
+
@view = Text2048::TextView.new(dummy_output)
|
10
10
|
@board = Text2048::Board.new(layout)
|
11
11
|
end
|
12
12
|
|
@@ -28,7 +28,7 @@ end
|
|
28
28
|
|
29
29
|
Then(/^the board is:$/) do |string|
|
30
30
|
@view.update(@board)
|
31
|
-
|
31
|
+
dummy_output.messages.should eq(string)
|
32
32
|
end
|
33
33
|
|
34
34
|
Then(/^the score is (\d+)$/) do |score|
|
@@ -36,5 +36,5 @@ Then(/^the score is (\d+)$/) do |score|
|
|
36
36
|
end
|
37
37
|
|
38
38
|
Then(/^it is game over$/) do
|
39
|
-
@board.lose
|
39
|
+
expect(@board.lose?).to be_truthy
|
40
40
|
end
|
data/features/support/env.rb
CHANGED
data/lib/text2048/version.rb
CHANGED
data/text2048.gemspec
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: text2048
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yasuhito Takamiya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: curses
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.0.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.0.1
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|