shiritori 0.0.8 → 0.0.9

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: fb84441c364a1dfb4d9b46af2d071a32e2af24c7
4
- data.tar.gz: 51125877608ca6f3f461fc84f1cafb1a1d7e164d
3
+ metadata.gz: 1e383ccc9d88bc174196bd9467449017be10e894
4
+ data.tar.gz: 2159df33eeb83af9a4cd9a1e3519e095a6c0bd53
5
5
  SHA512:
6
- metadata.gz: 92841ab261bcab47557f04f5860b9f5c20e3eda002c471d1649529683a5f59a70054d8ada1b034babdc645f9eb5019d79303d98828a1c9f75b95527d20f4b59a
7
- data.tar.gz: 842afd23db4cce22a20970179d29ed3845ed24a5cdb73042945588bf3df25951c3853115ad98d336429a88dbb0409d4b0adfd2a7e4abe27510c97ece25987fdd
6
+ metadata.gz: 320fd05178c0ec755f92c891d4bb3b36eff039299062a9b49a77139774e14c5a68163926d2ecd56a4a776f65e6d9679c35e2cf778a440b634a10fcd459c83934
7
+ data.tar.gz: 9bd078e3f011e11435455f22beebe298a181f63f0fe828e1d1fe9e7334b0329b58132aa9533a8beca9e09fb61a8d7cf65eaf115bd60bdc893415c90abd73ab43
@@ -0,0 +1,6 @@
1
+ module Shiritori
2
+ class Command
3
+ def self.parse(argv)
4
+ end
5
+ end
6
+ end
@@ -1,4 +1,5 @@
1
1
  require 'pp'
2
+ require 'readline'
2
3
 
3
4
  module Shiritori
4
5
  class Main
@@ -42,11 +43,16 @@ module Shiritori
42
43
  @success = false
43
44
 
44
45
  loop do
45
- print "Please input first object > "
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
46
53
 
47
54
  begin
48
- str = $stdin.gets.chomp
49
- @current_object = eval(str)
55
+ @current_object = eval(command.chomp)
50
56
  @current_chain << @current_object.to_ss
51
57
  @success = true
52
58
  break
@@ -78,8 +84,12 @@ module Shiritori
78
84
 
79
85
  new_line
80
86
 
81
- print "Please input next method > "
82
- command = $stdin.gets
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
83
93
 
84
94
  break if command.nil?
85
95
  redo if command.blank?
@@ -1,3 +1,3 @@
1
1
  module Shiritori
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
data/lib/shiritori.rb CHANGED
@@ -2,4 +2,8 @@ require "shiritori/version"
2
2
  require "shiritori/search_method"
3
3
  require 'shiritori/view'
4
4
  require 'shiritori/convert'
5
- require "shiritori/shiritori"
5
+ require "shiritori/shiritori"
6
+
7
+ module Shiritori
8
+ ENV = :production
9
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'shiritori'
2
2
 
3
3
  $LOAD_PATH << File.expand_path('../../lib', __FILE__)
4
+ Shiritori::ENV = :development
4
5
 
5
6
  module Helpers
6
7
  METHOD_PATTERN = /[\w|\?|\>|\<|\=|\!|\[|\[|\]|\*|\/|\+|\-|\^|\~|\@|\%|\&|]+/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shiritori
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - siman-man
@@ -96,6 +96,7 @@ files:
96
96
  - Rakefile
97
97
  - bin/shiritori
98
98
  - lib/shiritori.rb
99
+ - lib/shiritori/command.rb
99
100
  - lib/shiritori/convert.rb
100
101
  - lib/shiritori/error.rb
101
102
  - lib/shiritori/search_method.rb