russian_holidays_checkup 0.1.4 → 0.1.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c84b2de4137990fcbcae89919ae7948512adf5c4
4
- data.tar.gz: 9498d0a251c90ae807e3d7c577a429efdd09d702
3
+ metadata.gz: 0cdb0be5768d9737c8192b4951bbadf3f2f2f68a
4
+ data.tar.gz: 4e1096154a550a3ea2ba6b1e6566f9afc24d99f1
5
5
  SHA512:
6
- metadata.gz: 9c1c08fdf19a90d6f2a74dc13f49e45568e6e18add92625eab94564365db7a04ae7d6067bcf13427b83937fbffe7519e9d970f1e52741338f76dd52f88499ac1
7
- data.tar.gz: 5b3ec17953d2bee1a814a5a0413cf8e60f8b329ab9888e08605a8384bf4466e1894f2fdced1d880f8c0ba203162020fe5925101de7fe545fff98dbd7d58b6782
6
+ metadata.gz: a40ce2b8ff5e02149d31de29cb44fc3abf73d92115f64570c4e447a2e2cc0ed677fa293d108bd34577a5230e1785b0326162e5bdc2011c96eaad2e243fea5531
7
+ data.tar.gz: 5532aaf2638029ab4923aa599eecad1eb59cce1b3d84e424ee151b9d5fa92c3e102f2a140e1bdb776db8e487f5f808238e4b1bc9aa9ec59ea4d9a1a1a898d6dc
data/README.md CHANGED
@@ -21,11 +21,31 @@ Or install it yourself as:
21
21
 
22
22
  ## Usage
23
23
 
24
- this gem has update DateTime class with method russian_holiday?
24
+ in version 0.1.8. - two methods added
25
+
26
+ this gem has update DateTime class with two methods russian_holiday? and redday?
25
27
  after require just use it
26
28
 
29
+ week began from Monday, that russian tradition like vodka
30
+
27
31
  for Example :
28
- DateTime.new(2015,1,1,12,13,4).russian_holiday?
32
+
33
+ - Holiday check only
34
+ that case : DateTime.new(2020,1,1,12,14,16).russian_holiday?
35
+
36
+ - Completely workday or weekend include holidays check
37
+ this case : DateTime.new(2020,1,1,12,14,16).redday?
38
+
39
+ you've got true : false on return
40
+
41
+ p.s.
42
+ srry for my english, and thnX Matz for Ruby ! .)
43
+ it is lost paradise for programmers, for me )
44
+
45
+ privet from moscow ! .)
46
+ stay Metal or on Ultimate Records project wave!
47
+
48
+ and off course Jet Brains lot of thanXXX for RubyMine - it is Perfect !!!!
29
49
 
30
50
  ## Development
31
51
 
@@ -16,10 +16,28 @@ class DateTime
16
16
  Date.new(2015, 6, 12),
17
17
  Date.new(2015, 11, 4)
18
18
  ]
19
- if all_russian_holidays.index(self.to_date).nil?
20
- false
21
- else
22
- true
23
- end
19
+
20
+ all_russian_holidays.index(self.to_date).nil? ? false : true
21
+ end
22
+
23
+ def redday?
24
+ all_russian_holidays = [
25
+ Date.new(2015, 1, 1),
26
+ Date.new(2015, 1, 2),
27
+ Date.new(2015, 1, 5),
28
+ Date.new(2015, 1, 6),
29
+ Date.new(2015, 1, 7),
30
+ Date.new(2015, 1, 8),
31
+ Date.new(2015, 1, 9),
32
+ Date.new(2015, 2, 23),
33
+ Date.new(2015, 3, 9),
34
+ Date.new(2015, 5, 1),
35
+ Date.new(2015, 5, 4),
36
+ Date.new(2015, 5, 11),
37
+ Date.new(2015, 6, 12),
38
+ Date.new(2015, 11, 4)
39
+ ]
40
+
41
+ ((6..7).include? self.strftime('%u').to_i) || all_russian_holidays.index(self.to_date) ? true : false
24
42
  end
25
43
  end
@@ -1,3 +1,3 @@
1
1
  module RussianHolidaysCheckup
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.8"
3
3
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["nikolay martynov"]
10
10
  spec.email = ["shadows.of.unevenness@gmail.com"]
11
11
 
12
- spec.summary = "extends DateTime class by method russian_holiday?"
12
+ spec.summary = "extends DateTime class by methods russian_holiday? and redday? see documentation part for additional info"
13
13
  spec.homepage = "https://github.com/fearlessstar/russian_holidays_checkup.git"
14
14
  spec.license = "MIT"
15
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: russian_holidays_checkup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - nikolay martynov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-04 00:00:00.000000000 Z
11
+ date: 2015-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,5 +86,6 @@ rubyforge_project:
86
86
  rubygems_version: 2.4.8
87
87
  signing_key:
88
88
  specification_version: 4
89
- summary: extends DateTime class by method russian_holiday?
89
+ summary: extends DateTime class by methods russian_holiday? and redday? see documentation
90
+ part for additional info
90
91
  test_files: []