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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94e9f4694277445b718dc5efec92c4b621540ac8800802980c795e6fb2998060
4
- data.tar.gz: cf7dc5372d1f68547e08ebe11dd3216e304e933a29e3e84d4ef338c40bfbbca5
3
+ metadata.gz: 52be477a4632324c453bacd8f3e748bb0c02873642e4ee7498c819e6282f3f06
4
+ data.tar.gz: 619eabb3703eef463ed164e27cccff677fa521b46b12527d6dc374bbb25ad3b9
5
5
  SHA512:
6
- metadata.gz: f1a511821fe32070639b8213704db0d5c1f515b9b65f88bfbfa1086a79a92ec0fb88254b83575a4f6383784677f8c4d401ca5ceb63307d94e0c9e493b02da429
7
- data.tar.gz: 5e4bc508cb884737b0c87322513c53c16ebeee262da65050d1c36afe8e1baddcb3651511a10502343c785b99e3886d6880d0dc9fb29c9461874e13e48c0b6f0b
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 `config.yml` in the path `~/.goldman`. If you want to change the config path, please use the environment variable `GOLDMANPATH.`
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
- everyday:
23
+ Everyday:
23
24
  - "10:00~11:00"
24
- weekday:
25
+ Weekday:
25
26
  - "12:00~13:00"
26
- weekend:
27
+ Weekend:
27
28
  - "20:00~21:00"
28
- monday:
29
+ Monday:
29
30
  - "16:00~17:00"
30
- wednesday:
31
+ Wednesday:
31
32
  - "16:00~17:00"
32
- thursday:
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
- monday: "月"
44
- tuesday: "火"
45
- wednesday: "水"
46
- thursday: "木"
47
- friday: "金"
48
- saturday: "土"
49
- sunday: "日"
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
- GOLDMANPATH = ENV["GOLDMANPATH"] || File.expand_path("~/.goldman")
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: GOLDMANPATH + "/" + CONFIG_FILENAME
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
@@ -31,15 +31,15 @@ module Goldman
31
31
  end
32
32
 
33
33
  def weekday
34
- @raw_data[:weekday]
34
+ @raw_data[:Weekday]
35
35
  end
36
36
 
37
37
  def weekend
38
- @raw_data[:weekend]
38
+ @raw_data[:Weekend]
39
39
  end
40
40
 
41
41
  def everyday
42
- @raw_data[:everyday]
42
+ @raw_data[:Everyday]
43
43
  end
44
44
  end
45
45
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Goldman
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
 
6
6
  def self.version
7
7
  puts "Goldman version #{VERSION}"
data/lib/goldman/wday.rb CHANGED
@@ -3,13 +3,13 @@
3
3
  module Goldman
4
4
  module Wday
5
5
  DATA = {
6
- monday: 1,
7
- tuesday: 2,
8
- wednesday: 3,
9
- thursday: 4,
10
- friday: 5,
11
- saturday: 6,
12
- sunday: 7
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
- monday: "Mon",
17
- tuesday: "Tue",
18
- wednesday: "Wed",
19
- thursday: "Thu",
20
- friday: "Fri",
21
- saturday: "Sat",
22
- sunday: "Sun"
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.0
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-04-25 00:00:00.000000000 Z
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: