goldman 0.1.0 → 0.1.2
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 +4 -4
- data/README.md +18 -14
- data/exe/goldman +3 -4
- data/goldman.gemspec +1 -1
- data/lib/goldman/data_loader.rb +3 -3
- data/lib/goldman/version.rb +1 -1
- data/lib/goldman/wday.rb +7 -7
- data/lib/goldman.rb +7 -7
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 313cb238421a3fb15dc26ca2c6ee4ccb12016fa177ffe50070d34c4e71f5c43b
|
|
4
|
+
data.tar.gz: 33440dc517e091c34a781d474eb902e7225e431c99689b7cf4ace6dfa46b2c12
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b751499deeeb6e35928493b41a559287c04c9933d3be4b6d0e4d9b6c5ab4afa3aff4e0d43efbb34b8dd25f312e1e677b30c0eb73b57f4a9366f3d62a86026dc
|
|
7
|
+
data.tar.gz: 9329e65c929da794f4a2da183e34b21dae32e50699659cd449496a3f3345ba6be68ee09646158eb94288acb18800df9c6cae154f9b6635bbded5a9dc97644828
|
data/README.md
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
Goldman is a tool for [g]enerating [o]ption [l]ist of sche[d]ule. And goldman-rb is its ruby
|
|
4
4
|
implementation.
|
|
5
5
|
|
|
6
|
+
## Requirements
|
|
7
|
+
- Ruby: MRI 3.0+
|
|
8
|
+
|
|
6
9
|
## Installation
|
|
7
10
|
|
|
8
11
|
Goldman's installation is standard for a Ruby gem:
|
|
@@ -12,24 +15,25 @@ gem install goldman
|
|
|
12
15
|
```
|
|
13
16
|
|
|
14
17
|
## Setup and configuration
|
|
15
|
-
Please create a configuration file
|
|
18
|
+
Please create a configuration file (`*.yml`) and use the environment variable `GOLDMAN_RB_PATH` to set up the file's path.
|
|
19
|
+
If `GOLDMAN_RB_PATH` is not set, the tool will use the default file path `~/.goldman/config.yml`.
|
|
16
20
|
|
|
17
21
|
Please define the data of schedule options are described in `config.yml` as follows.
|
|
18
22
|
The available data keys are `everyday`, `weekday`, `weekend`, and the day of the week.
|
|
19
23
|
|
|
20
24
|
```yml:config.yml
|
|
21
25
|
data:
|
|
22
|
-
|
|
26
|
+
Everyday:
|
|
23
27
|
- "10:00~11:00"
|
|
24
|
-
|
|
28
|
+
Weekday:
|
|
25
29
|
- "12:00~13:00"
|
|
26
|
-
|
|
30
|
+
Weekend:
|
|
27
31
|
- "20:00~21:00"
|
|
28
|
-
|
|
32
|
+
Monday:
|
|
29
33
|
- "16:00~17:00"
|
|
30
|
-
|
|
34
|
+
Wednesday:
|
|
31
35
|
- "16:00~17:00"
|
|
32
|
-
|
|
36
|
+
Thursday:
|
|
33
37
|
- "16:00~17:00"
|
|
34
38
|
```
|
|
35
39
|
|
|
@@ -40,13 +44,13 @@ format:
|
|
|
40
44
|
schedule: "%{date}(%{wday}) %{time}"
|
|
41
45
|
date: "%Y/%m/%d"
|
|
42
46
|
wday:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
Monday: "月"
|
|
48
|
+
Tuesday: "火"
|
|
49
|
+
Wednesday: "水"
|
|
50
|
+
Thursday: "木"
|
|
51
|
+
Friday: "金"
|
|
52
|
+
Saturday: "土"
|
|
53
|
+
Sunday: "日"
|
|
50
54
|
```
|
|
51
55
|
|
|
52
56
|
## Usage
|
data/exe/goldman
CHANGED
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
require "goldman"
|
|
8
8
|
require "optparse"
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
CONFIG_FILENAME = "config.yml"
|
|
10
|
+
DEFAULT_CONFIG_FILEPATH = ENV["GOLDMAN_RB_PATH"] || File.expand_path("~/.goldman/config.yml")
|
|
12
11
|
NON_OPERATIONAL_OPTS = [:config]
|
|
13
12
|
|
|
14
13
|
# default value
|
|
15
14
|
@options = {
|
|
16
|
-
config:
|
|
15
|
+
config: DEFAULT_CONFIG_FILEPATH
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
opts = OptionParser.new do |opts|
|
|
@@ -39,7 +38,7 @@ begin
|
|
|
39
38
|
formatter = Goldman::Formatter.new(config)
|
|
40
39
|
data = Goldman::DataLoader.new(config).data
|
|
41
40
|
generator = Goldman::Generator.new(data, formatter, date_form)
|
|
42
|
-
|
|
41
|
+
|
|
43
42
|
@options.each do |k, v|
|
|
44
43
|
case k
|
|
45
44
|
when :generate
|
data/goldman.gemspec
CHANGED
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
|
12
12
|
spec.description = %q{goldman for generating option list of schedule}
|
|
13
13
|
spec.homepage = "https://github.com/willsmile/goldman-rb"
|
|
14
14
|
spec.license = "MIT"
|
|
15
|
-
spec.required_ruby_version = ">=
|
|
15
|
+
spec.required_ruby_version = ">= 3.0.0"
|
|
16
16
|
|
|
17
17
|
# Specify which files should be added to the gem when it is released.
|
|
18
18
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
data/lib/goldman/data_loader.rb
CHANGED
|
@@ -31,15 +31,15 @@ module Goldman
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def weekday
|
|
34
|
-
@raw_data[:
|
|
34
|
+
@raw_data[:Weekday]
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def weekend
|
|
38
|
-
@raw_data[:
|
|
38
|
+
@raw_data[:Weekend]
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def everyday
|
|
42
|
-
@raw_data[:
|
|
42
|
+
@raw_data[:Everyday]
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
end
|
data/lib/goldman/version.rb
CHANGED
data/lib/goldman/wday.rb
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
module Goldman
|
|
4
4
|
module Wday
|
|
5
5
|
DATA = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
Monday: 1,
|
|
7
|
+
Tuesday: 2,
|
|
8
|
+
Wednesday: 3,
|
|
9
|
+
Thursday: 4,
|
|
10
|
+
Friday: 5,
|
|
11
|
+
Saturday: 6,
|
|
12
|
+
Sunday: 7
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
class << self
|
data/lib/goldman.rb
CHANGED
|
@@ -13,13 +13,13 @@ module Goldman
|
|
|
13
13
|
schedule: "%{date}(%{wday}) %{time}",
|
|
14
14
|
date: "%Y/%m/%d",
|
|
15
15
|
wday: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
Monday: "Mon",
|
|
17
|
+
Tuesday: "Tue",
|
|
18
|
+
Wednesday: "Wed",
|
|
19
|
+
Thursday: "Thu",
|
|
20
|
+
Friday: "Fri",
|
|
21
|
+
Saturday: "Sat",
|
|
22
|
+
Sunday: "Sun"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: goldman
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Wei Chen (willsmile)
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-05-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: goldman for generating option list of schedule
|
|
14
14
|
email:
|
|
@@ -46,7 +46,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
46
46
|
requirements:
|
|
47
47
|
- - ">="
|
|
48
48
|
- !ruby/object:Gem::Version
|
|
49
|
-
version:
|
|
49
|
+
version: 3.0.0
|
|
50
50
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - ">="
|