koushien 0.1.5 → 0.1.7

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: daf23b0913abffb109f52645a4e9f574b21006cc3ae07957638806376297cd61
4
- data.tar.gz: 6daa17ab8a77c19ce65b4ffa4c0ec146a476460e747606f01c5ea0504bb277e2
3
+ metadata.gz: 7e9e7e8811c5fca89a34b9cfee9d0c7a7b78d0b046a24a83cc4c6fc5b8e1a7b2
4
+ data.tar.gz: 9cfb263783b7c50b556a68e945d96872535babcc9e5b1e1034f71cfc6963b82e
5
5
  SHA512:
6
- metadata.gz: '095eb2bc3b051c5ad686aa8b557ac20bc69a1d9c464184f4566f473caad03a9c676acc648fed6cc062e571f21b420cad356f64a5854c30624e834d945c849a82'
7
- data.tar.gz: c3b0439d6a023d7db48b3904ae06f5c3db8357f24ffae29eb4abb8525282d5d80b30171b8ac2520ada27ce45c0b0fe1f654c440b26374062f2100f1d303c50a8
6
+ metadata.gz: a2fd9cbe2d1b3b9906f0ecc448c254b9e72755c54d4fcdcb098e03e92af0e9c8033b44af1274cb566313cc82957609819f0bed88ea88074df7d90b2edd52a8b1
7
+ data.tar.gz: d1504ca8faef8d6ec5cba6b874dcb097a19e78398bf9dd57f0fd7e32000dfcb226564c58841268dedf070510ecb74ec8c34acef531403c2e2a6a1f4ccae71a4a
data/bin/koushien CHANGED
@@ -14,11 +14,42 @@ ARGV.options do |opt|
14
14
  # バージョン
15
15
  opt.on('-v', '--version') do
16
16
  puts opt.ver
17
- exit
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
+ if RUBY_VERSION.to_f >= 2.7
28
+ a = arr.filter_map do |y|
29
+ y if /^t\..*/.match(y)
30
+ end
31
+ else
32
+ a = arr.map do |y|
33
+ y if /^t\..*/.match(y)
34
+ end
35
+ a.compact!
36
+ end
37
+
38
+ # ディレクトリ作成(なければ)
39
+ FileUtils.mkdir_p('./koushien/outputs/')
40
+ # csv作成
41
+ today = Time.now.strftime('%Y%m%d')
42
+
43
+ CSV.open("./koushien/outputs/koushien_#{today}.csv", 'a') do |csv|
44
+ csv << ['output time']
45
+ csv << [today]
46
+ csv << []
47
+ csv << a
48
+ end
18
49
  end
19
50
 
20
51
  # CSV出力
21
- opt.on('-o') do |v|
52
+ opt.on('-o') do
22
53
  # ディレクトリ作成(なければ)
23
54
  FileUtils.mkdir_p('./koushien/outputs/')
24
55
  # csv作成
@@ -28,7 +59,6 @@ ARGV.options do |opt|
28
59
  csv << ['output time']
29
60
  csv << [now]
30
61
  end
31
- exit
32
62
  end
33
63
 
34
64
  opt.parse!
data/koushien.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = "output koushien data."
12
12
  spec.homepage = "https://github.com/ms919/koushien"
13
13
  spec.license = "MIT"
14
- spec.required_ruby_version = ">= 2.6.0"
14
+ spec.required_ruby_version = ">= 2.7.0"
15
15
 
16
16
  spec.metadata["homepage_uri"] = spec.homepage
17
17
  spec.metadata["source_code_uri"] = "https://github.com/ms919/koushien"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Koushien
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.7"
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.5
4
+ version: 0.1.7
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-28 00:00:00.000000000 Z
11
+ date: 2023-04-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -49,7 +49,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 2.6.0
52
+ version: 2.7.0
53
53
  required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - ">="