koushien 0.1.4 → 0.1.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0be367b88f5604fe10d173040c3ff73d49763f0aa4905b52b7748fbd74982894
4
- data.tar.gz: 0ad59d7b92da89ac1b363f88fdbc11b3b41ecf156e74f393e1df70bc491bef8d
3
+ metadata.gz: daf23b0913abffb109f52645a4e9f574b21006cc3ae07957638806376297cd61
4
+ data.tar.gz: 6daa17ab8a77c19ce65b4ffa4c0ec146a476460e747606f01c5ea0504bb277e2
5
5
  SHA512:
6
- metadata.gz: e45bf7b4d35eb926811392ca7c5725b3a2f04db62e445c0d058581c493b8fabadbd127d0f3f82e112d1ce57f7f615dcf32d3fe80e04086def4fb02ffa8b9264e
7
- data.tar.gz: 694758b3ba4ad1c7b29637d0745d7e5751e4f8a70c1d0abd30cb40c2a22b23aa7409a4a1cea9105b0a92201741cd2d7b55240ab2461c9478c45339ec98eacb54
6
+ metadata.gz: '095eb2bc3b051c5ad686aa8b557ac20bc69a1d9c464184f4566f473caad03a9c676acc648fed6cc062e571f21b420cad356f64a5854c30624e834d945c849a82'
7
+ data.tar.gz: c3b0439d6a023d7db48b3904ae06f5c3db8357f24ffae29eb4abb8525282d5d80b30171b8ac2520ada27ce45c0b0fe1f654c440b26374062f2100f1d303c50a8
data/bin/koushien CHANGED
@@ -2,20 +2,35 @@
2
2
 
3
3
  require 'optparse'
4
4
  require 'koushien/version'
5
- require "koushien"
5
+ require 'koushien'
6
+ require 'fileutils'
7
+ require 'csv'
6
8
 
7
9
  Version = Koushien::VERSION
8
10
 
9
11
  # コマンド定義
10
12
  ARGV.options do |opt|
11
- opt.on('--greet [OPTIONAL]') {|v|
12
- puts v ? v : 'hello!!'
13
- exit
14
- }
13
+
14
+ # バージョン
15
15
  opt.on('-v', '--version') do
16
16
  puts opt.ver
17
17
  exit
18
18
  end
19
+
20
+ # CSV出力
21
+ opt.on('-o') do |v|
22
+ # ディレクトリ作成(なければ)
23
+ FileUtils.mkdir_p('./koushien/outputs/')
24
+ # csv作成
25
+ now = Time.now.strftime('%Y%m%d%H%M%S')
26
+
27
+ CSV.open("./koushien/outputs/koushien_#{now}.csv", 'w') do |csv|
28
+ csv << ['output time']
29
+ csv << [now]
30
+ end
31
+ exit
32
+ end
33
+
19
34
  opt.parse!
20
35
  end
21
36
 
@@ -2,12 +2,15 @@ require 'optparse'
2
2
 
3
3
  module Koushien
4
4
  class Command
5
+ attr_accessor :output_dir
6
+ # デフォルト値設定
7
+ def initialize
8
+ @output_dir = 'koushien_outputs'
9
+ end
10
+
5
11
  class << self
6
12
  def exec(options)
7
13
  end
8
14
  end
9
-
10
- def initialize
11
- end
12
15
  end
13
16
  end
@@ -0,0 +1,9 @@
1
+ module Koushien
2
+ class Output
3
+ attr_accessor :output_dir
4
+ # デフォルト値設定
5
+ def initialize
6
+ @output_dir = 'koushien_outputs'
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Koushien
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koushien
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ms919
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
11
+ date: 2023-03-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -31,6 +31,7 @@ files:
31
31
  - koushien.gemspec
32
32
  - lib/koushien.rb
33
33
  - lib/koushien/command.rb
34
+ - lib/koushien/output.rb
34
35
  - lib/koushien/version.rb
35
36
  - sig/koushien.rbs
36
37
  homepage: https://github.com/ms919/koushien