goldman 0.1.0 → 0.1.2

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: 313cb238421a3fb15dc26ca2c6ee4ccb12016fa177ffe50070d34c4e71f5c43b
4
+ data.tar.gz: 33440dc517e091c34a781d474eb902e7225e431c99689b7cf4ace6dfa46b2c12
5
5
  SHA512:
6
- metadata.gz: f1a511821fe32070639b8213704db0d5c1f515b9b65f88bfbfa1086a79a92ec0fb88254b83575a4f6383784677f8c4d401ca5ceb63307d94e0c9e493b02da429
7
- data.tar.gz: 5e4bc508cb884737b0c87322513c53c16ebeee262da65050d1c36afe8e1baddcb3651511a10502343c785b99e3886d6880d0dc9fb29c9461874e13e48c0b6f0b
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 `config.yml` in the path `~/.goldman`. If you want to change the config path, please use the environment variable `GOLDMANPATH.`
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
- everyday:
26
+ Everyday:
23
27
  - "10:00~11:00"
24
- weekday:
28
+ Weekday:
25
29
  - "12:00~13:00"
26
- weekend:
30
+ Weekend:
27
31
  - "20:00~21:00"
28
- monday:
32
+ Monday:
29
33
  - "16:00~17:00"
30
- wednesday:
34
+ Wednesday:
31
35
  - "16:00~17:00"
32
- thursday:
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
- monday: "月"
44
- tuesday: "火"
45
- wednesday: "水"
46
- thursday: "木"
47
- friday: "金"
48
- saturday: "土"
49
- sunday: "日"
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
- 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
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 = ">= 2.7.0"
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.
@@ -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.2"
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.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-04-25 00:00:00.000000000 Z
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: 2.7.0
49
+ version: 3.0.0
50
50
  required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="