shiritori 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shiritori/shiritori.rb +5 -14
- data/lib/shiritori/version.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c470baac8c78d7c430ef17fac3c4ad1127d73ff
|
4
|
+
data.tar.gz: a33d0ef2619f5eafe571728d4772a007588a3119
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fb5648640e702dafa7a5754d463e03e29089a0e4bf860a45163f620601635dbc422cbc895fee34e2fae8a83cd62865f914a997b17439088e3e8cb75b660fd26
|
7
|
+
data.tar.gz: 1ac6f152357d03d633e1288c0a47622e9d18803c5e21815467554771c50657a96491a5f32e4796b0f3f488d0a5783a4ca6557756a8339450a48cd52a483d9c2a
|
data/lib/shiritori/shiritori.rb
CHANGED
@@ -41,6 +41,7 @@ module Shiritori
|
|
41
41
|
@current_chain = []
|
42
42
|
@chain_count = 0
|
43
43
|
@success = false
|
44
|
+
$error_message = nil
|
44
45
|
|
45
46
|
loop do
|
46
47
|
|
@@ -53,7 +54,7 @@ module Shiritori
|
|
53
54
|
break
|
54
55
|
rescue Exception => ex
|
55
56
|
new_line
|
56
|
-
|
57
|
+
$error_message = "Undefined object error"
|
57
58
|
redo
|
58
59
|
end
|
59
60
|
end
|
@@ -83,7 +84,7 @@ module Shiritori
|
|
83
84
|
puts "\e[#{GREEN}mSuccess!\e[m"
|
84
85
|
@success = false
|
85
86
|
else
|
86
|
-
puts "\e[#{RED}mFailed
|
87
|
+
puts "\e[#{RED}mFailed! : #{$error_message}\e[m"
|
87
88
|
end
|
88
89
|
|
89
90
|
new_line
|
@@ -105,7 +106,7 @@ module Shiritori
|
|
105
106
|
elsif result.first == :exit
|
106
107
|
break
|
107
108
|
else
|
108
|
-
|
109
|
+
$error_message = "Already used method."
|
109
110
|
end
|
110
111
|
end
|
111
112
|
rescue Exception => ex
|
@@ -118,15 +119,6 @@ module Shiritori
|
|
118
119
|
method_name = command.scan(METHOD_PATTERN).first.to_sym
|
119
120
|
result = [ method_name ]
|
120
121
|
|
121
|
-
# puts debug
|
122
|
-
# Bignumがエラーが出る
|
123
|
-
# puts "Exec command #{[object.to_ss, command].join('.')}"
|
124
|
-
# p method_name
|
125
|
-
# history 機能
|
126
|
-
# 時間制限はつける
|
127
|
-
# メモリ制限もつける
|
128
|
-
# hard modeの追加
|
129
|
-
|
130
122
|
case command
|
131
123
|
when EXIT_PATTERN
|
132
124
|
return [:exit]
|
@@ -135,11 +127,10 @@ module Shiritori
|
|
135
127
|
Thread.new do
|
136
128
|
raise NoMethodError unless object.respond_to?(method_name)
|
137
129
|
|
138
|
-
#result << object.instance_eval{ eval("self."+command) }
|
139
130
|
result << eval("object."+command)
|
140
131
|
end.join
|
141
132
|
rescue Exception => ex
|
142
|
-
|
133
|
+
$error_message = ex.message
|
143
134
|
return false
|
144
135
|
end
|
145
136
|
end
|
data/lib/shiritori/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -50,7 +50,6 @@ module Helpers
|
|
50
50
|
|
51
51
|
__self__ = check(command, obj||__instance__)
|
52
52
|
|
53
|
-
#other = [ope.scan(METHOD_PATTERN).first.to_sym, test_obj.instance_eval{ eval("self."+command) } ]
|
54
53
|
other = [ope.scan(METHOD_PATTERN).first.to_sym, eval("test_obj."+command) ]
|
55
54
|
|
56
55
|
compare_range(__self__, other) if [Range, Enumerator].include?(__self__.last.class)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shiritori
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- siman-man
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|