holiday_tools 0.0.13 → 0.0.14
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.
- data/README.md +39 -3
- data/bin/holiday_tools +1 -0
- data/lib/holiday_tools/locator.rb +0 -1
- data/lib/holiday_tools/version.rb +1 -1
- data/spec/holiday_tools/locator_spec.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,12 +1,36 @@
|
|
1
1
|
# HolidayTools
|
2
2
|
|
3
|
-
|
3
|
+
This is a wrapper around the alexdunae/holidays gem with a more intuitive API (at least IMO). It uses the region-id's of that gem to filter the results.
|
4
|
+
|
5
|
+
## API Description
|
6
|
+
|
7
|
+
### Class methods
|
8
|
+
|
9
|
+
* **show_regions**
|
10
|
+
generates a list of region-id's and names of that region (country in Englich and sub-region in local name, e.g. Germany/Sachsen)
|
11
|
+
|
12
|
+
### Instance methods
|
13
|
+
|
14
|
+
* **new(filter=[])**
|
15
|
+
You may supply an array of region-id's (see show_regions)
|
16
|
+
|
17
|
+
* **show\_holiday( date )**
|
18
|
+
Generates a list of all public holidays for _date_, which is a Date object (e.g. Date.today)
|
19
|
+
|
20
|
+
* **show\_week( date )**
|
21
|
+
Generates the list of holidays for the week (sunday to saturday), which contains the date
|
22
|
+
|
23
|
+
* **show\_month( date )**
|
24
|
+
Generates the list of holidays for the month, which contains the date
|
25
|
+
|
26
|
+
* **show\_year( date )**
|
27
|
+
Generates the list of holidays for the year, which contains the date
|
4
28
|
|
5
29
|
## Installation
|
6
30
|
|
7
31
|
Add this line to your application's Gemfile:
|
8
32
|
|
9
|
-
gem 'holiday_tools'
|
33
|
+
$ gem 'holiday_tools'
|
10
34
|
|
11
35
|
And then execute:
|
12
36
|
|
@@ -18,8 +42,20 @@ Or install it yourself as:
|
|
18
42
|
|
19
43
|
## Usage
|
20
44
|
|
21
|
-
|
45
|
+
Included in the gem is an executable, which can be used as CLI command. Examples:
|
46
|
+
|
47
|
+
$ holiday_tools
|
48
|
+
shows all regions which observe today a public holiday
|
49
|
+
|
50
|
+
$ holiday_tools --date 2013-05-01 --mode m
|
51
|
+
shows all holidays in all regions in May, 2013
|
52
|
+
|
53
|
+
$ holiday_tools --mode y at ge
|
54
|
+
shows all holidays in the current year in Austria and Germany
|
22
55
|
|
56
|
+
$ holiday_tools --help
|
57
|
+
shows the usage hints
|
58
|
+
|
23
59
|
## Contributing
|
24
60
|
|
25
61
|
1. Fork it
|
data/bin/holiday_tools
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: holiday_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: holidays
|