Skip to content

Commit

Permalink
update gems; fail if required and ensure returns nil
Browse files Browse the repository at this point in the history
  • Loading branch information
bsharpe committed May 7, 2020
1 parent 1aa9a13 commit e3a12f7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
36 changes: 18 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
PATH
remote: .
specs:
light_service_object (0.1.8)
dry-initializer (~> 2.0)
light_service_object (0.1.10)
dry-initializer (~> 3.0)
dry-monads (~> 1.0)

GEM
remote: https://rubygems.org/
specs:
concurrent-ruby (1.1.5)
concurrent-ruby (1.1.6)
diff-lcs (1.3)
dry-core (0.4.9)
concurrent-ruby (~> 1.0)
dry-equalizer (0.2.2)
dry-initializer (2.5.0)
dry-monads (1.3.1)
dry-equalizer (0.3.0)
dry-initializer (3.0.3)
dry-monads (1.3.5)
concurrent-ruby (~> 1.0)
dry-core (~> 0.4, >= 0.4.4)
dry-equalizer
rake (10.5.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.4)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.1)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.2)
rspec-support (~> 3.9.0)
rspec-support (3.9.3)

PLATFORMS
ruby
Expand All @@ -43,4 +43,4 @@ DEPENDENCIES
rspec (~> 3.0)

BUNDLED WITH
2.0.2
2.1.4
5 changes: 4 additions & 1 deletion lib/light_service_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
end
klass = klass.klass if klass.is_a?(ActiveRecord::Relation)

coercer = ->(value) { klass.ensure(value) }
coercer = options[:private] ?
->(value) { klass.ensure!(value) } :
->(value) { klass.ensure(value) }

options.merge(type: coercer)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/light_service_object/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module LightServiceObject
VERSION = "0.1.9"
VERSION = "0.1.10"
end
2 changes: 1 addition & 1 deletion light_service_object.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"

spec.add_dependency "dry-initializer", "~> 2.0"
spec.add_dependency "dry-initializer", "~> 3.0"
spec.add_dependency "dry-monads", "~> 1.0"
end

0 comments on commit e3a12f7

Please sign in to comment.