-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make hanami-validation a soft-dependency
- Loading branch information
Showing
13 changed files
with
149 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
require 'hanami/action/base_params' | ||
|
||
module Hanami | ||
module Action | ||
module Callable | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,10 @@ module Exposable | |
# | ||
# @see http://www.ruby-doc.org/core-2.1.2/Module.html#method-i-included | ||
def self.included(base) | ||
base.extend ClassMethods | ||
base.class_eval do | ||
extend ClassMethods | ||
expose :params | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jodosha
Author
Member
|
||
end | ||
end | ||
|
||
# Exposures API class methods | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
run_unit_tests() { | ||
bundle exec rake test:coverage | ||
} | ||
|
||
run_integration_tests() { | ||
local pwd=$PWD | ||
local root="$pwd/test/isolation" | ||
|
||
for test in $(find $root -name '*_test.rb') | ||
do | ||
run_test $test | ||
|
||
if [ $? -ne 0 ]; then | ||
local exit_code=$? | ||
echo "Failing test: $test" | ||
exit $exit_code | ||
fi | ||
done | ||
} | ||
|
||
run_test() { | ||
local test=$1 | ||
|
||
printf "\n\n\nRunning: $test\n" | ||
ruby -Itest $test | ||
} | ||
|
||
main() { | ||
run_unit_tests && | ||
run_integration_tests | ||
} | ||
|
||
main |
Oops, something went wrong.
@jodosha did you intend for this to make
params
available everywhere? This makesdef call(params)
redundant, because it's available regardless and might as well bedef call
. Of course, I'd rather thatparams
wasn't magically available throughout the class, so can we revisit this please? ❤️