matsuya 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/matsuya +20 -5
  3. data/lib/matsuya/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f98865d16d194fbff56cd113ce65df3bac2d0c7
4
- data.tar.gz: 61b4b695ce167e15ee00d4e47b189ad7ac17cd72
3
+ metadata.gz: 87e61bc4fcce42ca4821d45efbbedc50be6f5219
4
+ data.tar.gz: ed998f21caf7a7da139819ccd50a45d0aaa0ffb3
5
5
  SHA512:
6
- metadata.gz: deb6302617793dde6eaf81d5971a13e33daaf99d045f5bb84b258db7a2f3f033388ed366dafa7fc7b69beb01585b0f9948286ceedb6b2ce2d1ad5124fc4b0320
7
- data.tar.gz: 99dde451e918eb081247a280fb759dbe054ce94691315822cf736454b38561ee07829848dc4f733b4dd13f6fb832937bb764e7be2ca3934fe995e29537b92237
6
+ metadata.gz: a6c22aea610b4b35dd42afdb69d1f3496d773d422e2f753e99947f14bd01f37fcc6d2c0e0b07e945375158fd403b3409d29491acbf48ab1a19de0e823986927c
7
+ data.tar.gz: 149dc1b18719524ccc16a9f376b2e81cd14017fa0dcf3cf244125b7a1f785b45bf6d9dff417e3fdf179dc402542d6f1761ba414ec7920e023446d044cdc23acd
@@ -1,14 +1,29 @@
1
1
  #!/usr/bin/env ruby
2
+ # coding: utf-8
2
3
 
3
4
  require 'matsuya'
4
-
5
- if ARGV.include?('--help') || ARGV.include?('-h')
6
- puts "Usage: matsuya [okano]"
7
- exit
5
+ require 'optparse'
6
+ okano = 0.1
7
+ OptionParser.new do |opt|
8
+ opt.banner = "Usage: matsuya [options]"
9
+ opt.separator "options are:"
10
+ opt.on('-h', '--help', "Show this message") do
11
+ puts opt
12
+ exit
13
+ end
14
+ opt.on('-o', '--okano=', "おかの値(0.0-1.0 default %f)" % okano) do |value|
15
+ if value.match(/^[0-9]+(?:\.[0-9]+)?$/)
16
+ okano = value.to_f
17
+ else
18
+ warn 'Invalid おかの値 (-h to show help message)'
19
+ abort
20
+ end
21
+ end
22
+ opt.parse!(ARGV)
8
23
  end
9
24
 
10
25
  if ARGV.size > 0 && ARGV[0].match(/^[0-9]+(?:\.[0-9]+)?$/)
11
26
  puts Matsuya.order(ARGV[0].to_f)
12
27
  else
13
- puts Matsuya.order
28
+ puts Matsuya.order(okano: okano)
14
29
  end
@@ -1,3 +1,3 @@
1
1
  module Matsuya
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matsuya
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshiaki Asai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-05 00:00:00.000000000 Z
11
+ date: 2015-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler