kokki 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: b8ba825ca1cc842f7f6e6e832122f787a87006008dae07ae1474836358e5efcb
4
- data.tar.gz: 60b4e83c2e3af33773e478ce48537bac9d9c0b4b1eb91a4043c550282fc7e377
3
+ metadata.gz: efe9d3dfac4b18b97849891ebad58d847f7cf7aeb04202bccd75b8995e79a0e6
4
+ data.tar.gz: f86ad67ee03db20cbb7464df1c6583b164e90a066adcc15233623b97265c33c3
5
5
  SHA512:
6
- metadata.gz: 878baf28b473bca015f3e13732b24b1f4d2d5ac9d91e3f513d6f8d8c6081cb1df35d0b710a7169ff6eaa60e137ce0116f125a7e53f0e372a7616e49829319e83
7
- data.tar.gz: c566a4284612228afeee8010126e514bfbc910d76c8427c3e7d803864bbc6757c9fa949574e1df01b32a5107de893010a7542014ee6367ea50929b8298238aa1
6
+ metadata.gz: 0db03b7b48c23bd2f8761e57ceb69ea77615c702e758549ff69727c7062a614cb98f52ffef33c59edf1fc8914df18abce06d06e61b897b03a427a63878e30304
7
+ data.tar.gz: 7b72a3a51ecf1c13f029be4cd4a6d66cf5266951fc41e7d427bb604bac223001402e60f29f9df99759ae59e39804e2b8686e05c0938d298f82ca21e7895b88a2
data/exe/kokki CHANGED
@@ -4,14 +4,6 @@
4
4
  require "bundler/setup"
5
5
  require "kokki"
6
6
 
7
- input = ARGV.first
7
+ input = ARGV.first || gets
8
8
 
9
- if input
10
- begin
11
- puts Kokki.flagize(input)
12
- rescue Kokki::InvalidInputError => e
13
- puts e.message
14
- end
15
- else
16
- puts "Input not found: plase give a word to convert."
17
- end
9
+ Kokki::CLI.start input
data/lib/kokki/cli.rb ADDED
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Kokki
4
+ class CLI
5
+ def self.start(input)
6
+ if input
7
+ begin
8
+ puts Kokki.flagize(input.chomp)
9
+ rescue Kokki::InvalidInputError => e
10
+ puts e.message
11
+ end
12
+ else
13
+ puts "Input not found: plase give a word to convert."
14
+ end
15
+ end
16
+ end
17
+ end
data/lib/kokki/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kokki
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
data/lib/kokki.rb CHANGED
@@ -7,6 +7,8 @@ require "kokki/dictionary"
7
7
  require "kokki/ip_address"
8
8
  require "kokki/converter"
9
9
 
10
+ require "kokki/cli"
11
+
10
12
  module Kokki
11
13
  def self.flagize(input)
12
14
  Converter.convert input
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kokki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
@@ -128,6 +128,7 @@ files:
128
128
  - exe/kokki
129
129
  - kokki.gemspec
130
130
  - lib/kokki.rb
131
+ - lib/kokki/cli.rb
131
132
  - lib/kokki/converter.rb
132
133
  - lib/kokki/data/dict.yml
133
134
  - lib/kokki/dictionary.rb