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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e383ccc9d88bc174196bd9467449017be10e894
4
- data.tar.gz: 2159df33eeb83af9a4cd9a1e3519e095a6c0bd53
3
+ metadata.gz: c3953c7d65fca3fcd00c26d87e33647e4cd76a03
4
+ data.tar.gz: 4ec523006a421e0509c152b85c19af74076d82ef
5
5
  SHA512:
6
- metadata.gz: 320fd05178c0ec755f92c891d4bb3b36eff039299062a9b49a77139774e14c5a68163926d2ecd56a4a776f65e6d9679c35e2cf778a440b634a10fcd459c83934
7
- data.tar.gz: 9bd078e3f011e11435455f22beebe298a181f63f0fe828e1d1fe9e7334b0329b58132aa9533a8beca9e09fb61a8d7cf65eaf115bd60bdc893415c90abd73ab43
6
+ metadata.gz: b89644c03cbd9eb73884cd926f891ee1909f6ead87a1de38232fbbefefe78deab0f68a0228fd50991802c75bfaf8472ba560e244179d8976b3355a017c13430b
7
+ data.tar.gz: 01b5900e13312c33a0bc1772bc2b55bcfef01c49ddc2fad5651a9d105ae6c8f85b129857c941de5bf319c077c21b5e0e8bcde41d863be21d191bd2bbd61c3250
@@ -44,12 +44,7 @@ module Shiritori
44
44
 
45
45
  loop do
46
46
 
47
- if Shiritori::ENV == :development
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
- $stdout.puts "Undefined object error"
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
- if Shiritori::ENV == :development
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
@@ -1,3 +1,3 @@
1
1
  module Shiritori
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
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.9
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-19 00:00:00.000000000 Z
11
+ date: 2014-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler