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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e1d00e135be74ec92b38bfb77a0bb4120920bdf
4
- data.tar.gz: 57ef4e7de3270758c399916c915e966376036a85
3
+ metadata.gz: 0c470baac8c78d7c430ef17fac3c4ad1127d73ff
4
+ data.tar.gz: a33d0ef2619f5eafe571728d4772a007588a3119
5
5
  SHA512:
6
- metadata.gz: 174a41a558282a29ed42129bac38dd96fc4f87af67f9fa0e7c0358f9db12d6e7a0ec6aa52f596a852c8a15e0705cf1dadc8307281803871981301d12f3de0104
7
- data.tar.gz: 76e23bcd669717b9130325c766f99853c8f0e00e5e7c09a2c975ed7353dcfcda5f3a35f7ab4227144c9ea35d5f0d0e11e3941d1e9483fddbc711704bbac6b86c
6
+ metadata.gz: 1fb5648640e702dafa7a5754d463e03e29089a0e4bf860a45163f620601635dbc422cbc895fee34e2fae8a83cd62865f914a997b17439088e3e8cb75b660fd26
7
+ data.tar.gz: 1ac6f152357d03d633e1288c0a47622e9d18803c5e21815467554771c50657a96491a5f32e4796b0f3f488d0a5783a4ca6557756a8339450a48cd52a483d9c2a
@@ -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
- puts "\e[#{RED}mUndefined object error\e[m"
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!\e[m"
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
- puts "Already used method."
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
- puts ex.message
133
+ $error_message = ex.message
143
134
  return false
144
135
  end
145
136
  end
@@ -1,3 +1,3 @@
1
1
  module Shiritori
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-22 00:00:00.000000000 Z
11
+ date: 2014-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler