shiritori 0.0.9 → 0.1.0
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 +13 -14
- data/lib/shiritori/version.rb +1 -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: c3953c7d65fca3fcd00c26d87e33647e4cd76a03
|
4
|
+
data.tar.gz: 4ec523006a421e0509c152b85c19af74076d82ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b89644c03cbd9eb73884cd926f891ee1909f6ead87a1de38232fbbefefe78deab0f68a0228fd50991802c75bfaf8472ba560e244179d8976b3355a017c13430b
|
7
|
+
data.tar.gz: 01b5900e13312c33a0bc1772bc2b55bcfef01c49ddc2fad5651a9d105ae6c8f85b129857c941de5bf319c077c21b5e0e8bcde41d863be21d191bd2bbd61c3250
|
data/lib/shiritori/shiritori.rb
CHANGED
@@ -44,12 +44,7 @@ module Shiritori
|
|
44
44
|
|
45
45
|
loop do
|
46
46
|
|
47
|
-
|
48
|
-
print "Please input first object > "
|
49
|
-
command = $stdin.gets
|
50
|
-
else
|
51
|
-
command = Readline.readline("Please input first object > ", true)
|
52
|
-
end
|
47
|
+
command = get_command
|
53
48
|
|
54
49
|
begin
|
55
50
|
@current_object = eval(command.chomp)
|
@@ -58,7 +53,7 @@ module Shiritori
|
|
58
53
|
break
|
59
54
|
rescue Exception => ex
|
60
55
|
new_line
|
61
|
-
|
56
|
+
puts "\e[#{RED}mUndefined object error\e[m"
|
62
57
|
redo
|
63
58
|
end
|
64
59
|
end
|
@@ -70,6 +65,15 @@ module Shiritori
|
|
70
65
|
@success
|
71
66
|
end
|
72
67
|
|
68
|
+
def get_command
|
69
|
+
if Shiritori::ENV == :development
|
70
|
+
print "Please input first object > "
|
71
|
+
$stdin.gets
|
72
|
+
else
|
73
|
+
Readline.readline("Please input first object > ", true)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
73
77
|
def run
|
74
78
|
|
75
79
|
loop do
|
@@ -84,12 +88,7 @@ module Shiritori
|
|
84
88
|
|
85
89
|
new_line
|
86
90
|
|
87
|
-
|
88
|
-
print "Please input first object > "
|
89
|
-
command = $stdin.gets
|
90
|
-
else
|
91
|
-
command = Readline.readline("Please input first object > ", true)
|
92
|
-
end
|
91
|
+
command = get_command
|
93
92
|
|
94
93
|
break if command.nil?
|
95
94
|
redo if command.blank?
|
@@ -110,7 +109,7 @@ module Shiritori
|
|
110
109
|
end
|
111
110
|
end
|
112
111
|
rescue Exception => ex
|
113
|
-
puts ex.message
|
112
|
+
puts "\e[#{RED}m#{ex.message}\e[m"
|
114
113
|
end
|
115
114
|
end
|
116
115
|
end
|
data/lib/shiritori/version.rb
CHANGED
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.0
|
4
|
+
version: 0.1.0
|
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-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|