goldman 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -14
- data/exe/goldman +3 -4
- 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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52be477a4632324c453bacd8f3e748bb0c02873642e4ee7498c819e6282f3f06
|
4
|
+
data.tar.gz: 619eabb3703eef463ed164e27cccff677fa521b46b12527d6dc374bbb25ad3b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51db44f5a47de166c4959b54ad46b4fa7946dc1c6cb686ca48b30270a8d91655ccbe416c17c2cca801ff059767a77a234c3058e3753cacd0645793212e9dbb8e
|
7
|
+
data.tar.gz: 6bdc1deedc08e4d281499f1dbd3af308c2cb040a212004a5ec06a03dac32a47bb279a036040bb5fed98dc77aa73fe33089f6bbc8aabda3e1800b5a10c2c458c8
|
data/README.md
CHANGED
@@ -12,24 +12,25 @@ gem install goldman
|
|
12
12
|
```
|
13
13
|
|
14
14
|
## Setup and configuration
|
15
|
-
Please create a configuration file
|
15
|
+
Please create a configuration file (`*.yml`) and use the environment variable `GOLDMAN_RB_PATH` to set up the file's path.
|
16
|
+
If `GOLDMAN_RB_PATH` is not set, the tool will use the default file path `~/.goldman/config.yml`.
|
16
17
|
|
17
18
|
Please define the data of schedule options are described in `config.yml` as follows.
|
18
19
|
The available data keys are `everyday`, `weekday`, `weekend`, and the day of the week.
|
19
20
|
|
20
21
|
```yml:config.yml
|
21
22
|
data:
|
22
|
-
|
23
|
+
Everyday:
|
23
24
|
- "10:00~11:00"
|
24
|
-
|
25
|
+
Weekday:
|
25
26
|
- "12:00~13:00"
|
26
|
-
|
27
|
+
Weekend:
|
27
28
|
- "20:00~21:00"
|
28
|
-
|
29
|
+
Monday:
|
29
30
|
- "16:00~17:00"
|
30
|
-
|
31
|
+
Wednesday:
|
31
32
|
- "16:00~17:00"
|
32
|
-
|
33
|
+
Thursday:
|
33
34
|
- "16:00~17:00"
|
34
35
|
```
|
35
36
|
|
@@ -40,13 +41,13 @@ format:
|
|
40
41
|
schedule: "%{date}(%{wday}) %{time}"
|
41
42
|
date: "%Y/%m/%d"
|
42
43
|
wday:
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
Monday: "月"
|
45
|
+
Tuesday: "火"
|
46
|
+
Wednesday: "水"
|
47
|
+
Thursday: "木"
|
48
|
+
Friday: "金"
|
49
|
+
Saturday: "土"
|
50
|
+
Sunday: "日"
|
50
51
|
```
|
51
52
|
|
52
53
|
## 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/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.1
|
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-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: goldman for generating option list of schedule
|
14
14
|
email:
|