Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.10
ruby-version: 3.2.8
bundler-cache: true
- name: Run tests
run: bundle exec rake test
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.10
3.2.8
8 changes: 3 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "http://rubygems.org"
source "https://rubygems.org"

ruby '2.6.10'
ruby '3.2.8'

# Add dependencies required to use your gem here.
# Example:
Expand All @@ -12,16 +12,14 @@ gem 'httparty', '~> 0.21.0'

group :development do
gem "bundler"
gem "jeweler"
gem "simplecov"
gem "rdoc"
gem "shoulda"
gem "minitest"
gem "minitest", "~> 5.0"
end

group :test do
gem 'webmock'
gem 'vcr'
gem 'turn'
gem 'rake'
end
142 changes: 61 additions & 81 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,114 +1,94 @@
GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
activesupport (5.2.4.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
ansi (1.5.0)
builder (3.2.4)
concurrent-ruby (1.1.7)
crack (0.4.3)
safe_yaml (~> 1.0.0)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
docile (1.3.2)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
git (1.7.0)
rchardet (~> 1.8)
github_api (0.11.3)
addressable (~> 2.3)
descendants_tracker (~> 0.0.1)
faraday (~> 0.8, < 0.10)
hashie (>= 1.2)
multi_json (>= 1.7.5, < 2.0)
nokogiri (~> 1.6.0)
oauth2
hashdiff (1.0.1)
hashie (4.1.0)
highline (2.0.3)
activesupport (8.0.2)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.2.2)
concurrent-ruby (1.3.5)
connection_pool (2.5.3)
crack (1.0.0)
bigdecimal
rexml
date (3.4.1)
docile (1.4.1)
drb (2.2.3)
erb (5.0.2)
hashdiff (1.2.0)
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.8.5)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
jeweler (2.3.5)
builder
bundler (>= 1.0)
git (>= 1.2.5)
github_api (~> 0.11.0)
highline (>= 1.6.15)
nokogiri (>= 1.5.10)
psych (~> 2.2)
rake
rdoc
semver2
jwt (2.2.2)
logger (1.7.0)
mini_mime (1.1.5)
mini_portile2 (2.1.0)
minitest (5.14.1)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
psych (2.2.4)
public_suffix (4.0.5)
rack (2.2.3)
rake (13.0.1)
rchardet (1.8.0)
rdoc (6.2.1)
safe_yaml (1.0.5)
semver2 (3.4.2)
minitest (5.25.5)
multi_xml (0.7.2)
bigdecimal (~> 3.1)
psych (5.2.6)
date
stringio
public_suffix (6.0.2)
rake (13.3.0)
rdoc (6.14.2)
erb
psych (>= 4.0.0)
rexml (3.4.1)
securerandom (0.4.1)
shoulda (4.0.0)
shoulda-context (~> 2.0)
shoulda-matchers (~> 4.0)
shoulda-context (2.0.0)
shoulda-matchers (4.4.0)
shoulda-matchers (4.5.1)
activesupport (>= 4.2.0)
simplecov (0.18.5)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov-html (0.12.2)
thread_safe (0.3.6)
turn (0.9.6)
ansi
tzinfo (1.2.7)
thread_safe (~> 0.1)
vcr (6.0.0)
webmock (3.8.3)
addressable (>= 2.3.6)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.2)
simplecov_json_formatter (0.1.4)
stringio (3.1.7)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uri (1.0.3)
vcr (6.3.1)
base64
webmock (3.25.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)

PLATFORMS
arm64-darwin-24
ruby

DEPENDENCIES
bundler
httparty (~> 0.21.0)
jeweler
minitest
minitest (~> 5.0)
rake
rdoc
shoulda
simplecov
turn
vcr
webmock

RUBY VERSION
ruby 2.6.10p210
ruby 3.2.8p263

BUNDLED WITH
2.0.2
2.7.0
14 changes: 0 additions & 14 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ rescue Bundler::BundlerError => e
end
require 'rake'

require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
gem.name = "enrico"
gem.homepage = "https://github.com/easyPEP/enrico"
gem.license = "MIT"
gem.summary = "A ruby wrapper around enrico holiday API"
gem.description = "https://github.com/easyPEP/enrico"
gem.email = "kalle@easypep.de"
gem.authors = ["Kalle Saas"]
# dependencies defined in Gemfile
end
Jeweler::RubygemsDotOrgTasks.new

require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
Expand Down
1 change: 0 additions & 1 deletion lib/enrico.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require "httparty"
require 'json'
require 'active_support/all'
require "addressable/uri"

Dir[File.dirname(__FILE__) + '/enrico/*.rb'].each do |file|
Expand Down
12 changes: 6 additions & 6 deletions lib/enrico/country.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def is_public_holiday?(date)
end

def method_missing(name, *args, &block)
method_name = name.to_s.camelize(:lower)
method_name = name.to_s.gsub(/_([a-z])/) { $1.upcase }
details.has_key?(method_name) ? details[method_name] : super
end

Expand All @@ -60,13 +60,13 @@ def vacation_days_from_response(response)
end

def country_parameters(params, holiday_type: nil)
{
result = {
country: self.country_code,
region: self.region
}
.merge(params)
.tap { |result| result[:holidayType] = holiday_type if holiday_type.present? }
.to_query
}.merge(params)
result[:holidayType] = holiday_type if holiday_type && !holiday_type.empty?

URI.encode_www_form(result.compact)
end

def is_public_holiday(date)
Expand Down
2 changes: 1 addition & 1 deletion lib/enrico/vacation_day.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class VacationDay
def initialize(args)
self.date = Date.new( args["date"]["year"].to_i, args["date"]["month"].to_i, args["date"]["day"].to_i )
self.local_name = args["name"][0]["text"]
self.english_name = args["name"][1].present? ? args["name"][1]["text"] : args["name"][0]["text"]
self.english_name = args["name"][1] && !args["name"][1].empty? ? args["name"][1]["text"] : args["name"][0]["text"]
end
end
end
2 changes: 1 addition & 1 deletion mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[tools]
ruby = "2.6.10"
ruby = "3.2.8"
70 changes: 4 additions & 66 deletions spec/fixtures/vcr_cassettes/holidays_in_date_range.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading