|
1 | | -[](https://github.com/nikukyugamer/prekin/actions/workflows/config.yml) |
2 | | - |
3 | 1 | # Prekin |
4 | 2 |
|
| 3 | +[](https://github.com/nikukyugamer/prekin/actions/workflows/config.yml) |
| 4 | + |
5 | 5 | ## What is Prekin? |
6 | 6 |
|
7 | 7 | ### Naming |
8 | 8 |
|
9 | 9 | - `Prekin` means `PREMIUM FRIDAY` |
10 | | - - `kin` means FRIDAY (`kin-yo-bi`) in Japanese |
11 | | - - So `PRE`mium `KIN`-yo-bi is `Prekin` |
| 10 | + - `kin` means FRIDAY (`kin-yo-bi`) in Japanese |
| 11 | + - So `PRE`mium `KIN`-yo-bi is `Prekin` |
12 | 12 |
|
13 | 13 | ### Webpage |
14 | 14 |
|
15 | 15 | - A webpage by Ministry of Economy, Trade and Industry in Japan |
16 | | - - http://www.meti.go.jp/policy/mono_info_service/service/premium-friday/ |
| 16 | + - <http://www.meti.go.jp/policy/mono_info_service/service/premium-friday/> |
17 | 17 | - A webpage by Premium Friday Committee |
18 | | - - https://premium-friday.com/ |
| 18 | + - <https://web.archive.org/web/20230411145908if_/https://premium-friday.com/> |
19 | 19 |
|
20 | 20 | ## Installation |
21 | 21 |
|
22 | | -Add this line to your application's Gemfile: |
| 22 | +Add this line to your application's `Gemfile`: |
23 | 23 |
|
24 | 24 | ```ruby |
25 | 25 | gem 'prekin' |
26 | 26 | ``` |
27 | 27 |
|
28 | 28 | And then execute: |
29 | 29 |
|
30 | | - $ bundle |
| 30 | +```bash |
| 31 | +$ bundle |
| 32 | +``` |
31 | 33 |
|
32 | 34 | Or install it yourself as: |
33 | 35 |
|
34 | | - $ gem install prekin |
| 36 | +```bash |
| 37 | +$ gem install prekin |
| 38 | +``` |
35 | 39 |
|
36 | 40 | ## Usage |
37 | 41 |
|
38 | 42 | ### 1. require |
| 43 | + |
39 | 44 | - `require 'prekin'` |
40 | 45 |
|
41 | 46 | ### 2. call |
42 | 47 |
|
43 | 48 | #### 2-1. Time class |
| 49 | + |
44 | 50 | - `Time.local(2020, 10, 30, 0, 0, 0).prekin? #=> true` |
45 | 51 |
|
46 | 52 | #### 2-2. Date class |
| 53 | + |
47 | 54 | - `Date.new(2020, 10, 30).prekin? #=> true` |
48 | 55 |
|
49 | 56 | #### 2-3. DateTime class |
| 57 | + |
50 | 58 | - `DateTime.new(2020, 10, 30, 0, 0, 0, '+09:00').prekin? #=> true` |
51 | 59 |
|
52 | 60 | #### 2-4. String class |
| 61 | + |
53 | 62 | - `'2020/10/30 00:00:00 +09:00'.prekin? #=> true` |
54 | 63 |
|
55 | 64 | #### 2-5. Next Prekin |
| 65 | + |
56 | 66 | - `Prekin.next #=> "2020-10-30"` |
57 | 67 | - `Prekin.next('2023-12-28') #=> "2023-12-29"` |
58 | 68 | - `Prekin.next('2023-12-29') #=> "2023-12-29"` |
59 | 69 | - `Prekin.next('2023-12-30') #=> "2024-01-26"` |
60 | 70 |
|
61 | 71 | ## Note |
62 | | -- This gem overwrites `Time`, `Date`, `DateTime` and `String` class. |
63 | | - - So if you use `Time`, `Date`, `DateTime` and `String` class in your code, you should be careful. |
64 | | - |
65 | | -## Development |
66 | 72 |
|
67 | | -#### 1. bundle install |
68 | | -- `bundle install` |
69 | | - |
70 | | -#### 2. irb |
71 | | -- `bundle exec irb` |
72 | | - |
73 | | -#### 3. require |
74 | | -- `require 'prekin'` |
| 73 | +- This gem overwrites `Time`, `Date`, `DateTime` and `String` class. |
| 74 | + - So if you use `Time`, `Date`, `DateTime` and `String` class in your code, you should be careful. |
75 | 75 |
|
76 | 76 | ## License |
77 | 77 |
|
|
0 commit comments