Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FogPublicValue#to_bool #387

Merged
merged 2 commits into from
Jul 25, 2019
Merged

Conversation

pocari
Copy link
Contributor

@pocari pocari commented Jul 24, 2019

Hi, I found a bug when converting to a boolean value with FogPublicValue.

In documentation,

# Possible values: true, false, "default" (default: true)
# config.fog_public = true

but, If false is set, to_bool method returns true
The following is a reproduction ...

% cat Gemfile
source "https://rubygems.org"
gem "asset_sync"
% cat main.rb
require 'asset_sync'

false_value = AssetSync::Config::FogPublicValue.new(false)
nil_value = AssetSync::Config::FogPublicValue.new(nil)
true_value = AssetSync::Config::FogPublicValue.new(true)

p false_value.to_bool
p nil_value.to_bool
p true_value.to_bool
% bundle exec ruby main.rb
true
false
true

I fixed it.

@pocari pocari changed the title Fix fog public value Fix FogPublicValue#to_bool Jul 24, 2019
@coveralls
Copy link

coveralls commented Jul 24, 2019

Pull Request Test Coverage Report for Build 340

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 62.0%

Totals Coverage Status
Change from base Build 338: 0.07%
Covered Lines: 341
Relevant Lines: 550

💛 - Coveralls

@PikachuEXE PikachuEXE merged commit a401204 into AssetSync:master Jul 25, 2019
@PikachuEXE
Copy link
Member

Thanks :)
Will release a new version soon

@PikachuEXE
Copy link
Member

Released as 2.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants