koushien 0.1.4 → 0.1.6

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: 1e9fa9ecf20d82a03e9114f05b8073a4a74592b17757a6134c5e31d813d41ade
4
+ data.tar.gz: 9492b69cf7ba2e0d4c588ad3f07f86acfb067c459c49450bb69c7fa66f7ec5bc
5
5
  SHA512:
6
- metadata.gz: e45bf7b4d35eb926811392ca7c5725b3a2f04db62e445c0d058581c493b8fabadbd127d0f3f82e112d1ce57f7f615dcf32d3fe80e04086def4fb02ffa8b9264e
7
- data.tar.gz: 694758b3ba4ad1c7b29637d0745d7e5751e4f8a70c1d0abd30cb40c2a22b23aa7409a4a1cea9105b0a92201741cd2d7b55240ab2461c9478c45339ec98eacb54
6
+ metadata.gz: 65fa14e51783c5fb092165121e4a5d0fcd7ffeddab42c4f6bb11b67cb0e4f407213a962f9cdbae32174e6869f6fdd478a12421a001ee68c48dc82c6a3adf7448
7
+ data.tar.gz: 33c92959083b6c05be891b4df111a49791138997b394b0beb7074c242285b92c10a575861246e815c18b1851bebd84cb5ffc91e85c2468a0583fc80329a3b8b8
data/bin/koushien CHANGED
@@ -2,20 +2,58 @@
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
- exit
18
17
  end
18
+
19
+ # 読み込み
20
+ opt.on('-r') do
21
+ arr = []
22
+ File.open('./koushien/data/test.rb') { |f|
23
+ arr = f.readlines
24
+ }
25
+ arr.each {|x| x.strip!}
26
+
27
+ a = arr.filter_map do |y|
28
+ y if /^t\..*/.match(y)
29
+ end
30
+
31
+ # ディレクトリ作成(なければ)
32
+ FileUtils.mkdir_p('./koushien/outputs/')
33
+ # csv作成
34
+ now = Time.now.strftime('%Y%m%d%H%M%S')
35
+
36
+ CSV.open("./koushien/outputs/koushien_#{now}.csv", 'w') do |csv|
37
+ csv << ['output time']
38
+ csv << [now]
39
+ csv << []
40
+ csv << a
41
+ end
42
+ end
43
+
44
+ # CSV出力
45
+ opt.on('-o') do
46
+ # ディレクトリ作成(なければ)
47
+ FileUtils.mkdir_p('./koushien/outputs/')
48
+ # csv作成
49
+ now = Time.now.strftime('%Y%m%d%H%M%S')
50
+
51
+ CSV.open("./koushien/outputs/koushien_#{now}.csv", 'w') do |csv|
52
+ csv << ['output time']
53
+ csv << [now]
54
+ end
55
+ end
56
+
19
57
  opt.parse!
20
58
  end
21
59
 
@@ -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.6"
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.6
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-04-03 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