Skip to content

Commit

Permalink
Change dependency to google-apis-calendar_v3 (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: necojackarc <necojackarc@gmail.com>
Co-authored-by: Taka <necojackarc@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 27, 2022
1 parent c7c2c0e commit e400bc5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ AllCops:
Exclude:
- 'bin/*'
- 'Gemfile'
NewCops: enable

# Accept single-line methods with no body
SingleLineMethods:
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require "rspec/core/rake_task"

Expand Down
4 changes: 2 additions & 2 deletions holidays_from_google_calendar.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "google-api-client", "~> 0.9"
spec.add_dependency "activesupport"
spec.add_dependency "google-apis-calendar_v3"

spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
spec.add_development_dependency "pry"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
spec.add_development_dependency "rspec-its"
spec.add_development_dependency "simplecov"
Expand Down
3 changes: 3 additions & 0 deletions lib/holidays_from_google_calendar.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "active_support"
require "active_support/core_ext"
require "google/apis/calendar_v3"
Expand Down Expand Up @@ -33,6 +35,7 @@ def in_month(date)

def holiday?(date)
return true if date.wday.in?([0, 6]) # If Sunday or Saturday

@client.retrieve(date_min: date, date_max: date).size > 0
end
end
Expand Down

0 comments on commit e400bc5

Please sign in to comment.