u-service 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.sh +13 -0
- data/.travis.yml +1 -1
- data/Gemfile +15 -2
- data/Gemfile.lock +1 -1
- data/lib/micro/service/version.rb +1 -1
- data/lib/micro/service/with_validation.rb +19 -0
- data/lib/u-service.rb +3 -0
- data/test.sh +7 -0
- metadata +5 -2
- data/lib/micro/u-service.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0a881f3a6544fe98f2384ee40522a44e1fcc2011f60fd1e312d1fbb4afee79f
|
4
|
+
data.tar.gz: 425f39a6977091d5e9303b9fc86f1c261115737bffc693f929f8cb0dafce43bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf65966cfd4ef161f07ff5e97e787afd2afe810420223941a574e1eeb0a236b98f0d83a4c391b374ac53391afaef7f2e23a4abbecf7a0b01adf89b125a3ea08a
|
7
|
+
data.tar.gz: 2c88814614909b674a64ec4c727c5ecaeb2c42e83fae514ee044c085aa0753862529774d872eace7e2106461366d46a9521c94348f8931ce47fa10ab0b6cca4b
|
data/.travis.sh
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
bundle exec rake test
|
4
|
+
|
5
|
+
ruby_v=$(ruby -v)
|
6
|
+
|
7
|
+
ACTIVEMODEL_VERSION='3.2' bundle update
|
8
|
+
ACTIVEMODEL_VERSION='3.2' bundle exec rake test
|
9
|
+
|
10
|
+
if [[ ! $ruby_v =~ '2.2.0' ]]; then
|
11
|
+
ACTIVEMODEL_VERSION='5.2' bundle update
|
12
|
+
ACTIVEMODEL_VERSION='5.2' bundle exec rake test
|
13
|
+
fi
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -2,9 +2,22 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
activemodel_version = ENV.fetch('ACTIVEMODEL_VERSION', '6.1')
|
6
|
+
|
7
|
+
activemodel = case activemodel_version
|
8
|
+
when '3.2' then '3.2.22'
|
9
|
+
when '5.2' then '5.2.3'
|
10
|
+
end
|
11
|
+
|
12
|
+
if activemodel_version < '6.1'
|
13
|
+
gem 'activemodel', activemodel, require: false
|
14
|
+
gem 'activesupport', activemodel, require: false
|
15
|
+
end
|
7
16
|
|
8
17
|
group :test do
|
18
|
+
gem 'minitest', activemodel_version < '4.1' ? '~> 4.2' : '~> 5.0'
|
9
19
|
gem 'simplecov', require: false
|
10
20
|
end
|
21
|
+
|
22
|
+
# Specify your gem's dependencies in micro-service.gemspec
|
23
|
+
gemspec
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'micro/service'
|
4
|
+
|
5
|
+
module Micro
|
6
|
+
class Service::WithValidation < Micro::Service::Base
|
7
|
+
include Micro::Attributes::Features::ActiveModelValidations
|
8
|
+
|
9
|
+
def call
|
10
|
+
return Failure(errors: self.errors) unless valid?
|
11
|
+
|
12
|
+
super
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class Service::Strict::Validation < Service::WithValidation
|
17
|
+
include Micro::Attributes::Features::StrictInitialize
|
18
|
+
end
|
19
|
+
end
|
data/lib/u-service.rb
ADDED
data/test.sh
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: u-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Serradura
|
@@ -74,6 +74,7 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
|
+
- ".travis.sh"
|
77
78
|
- ".travis.yml"
|
78
79
|
- CODE_OF_CONDUCT.md
|
79
80
|
- Gemfile
|
@@ -89,7 +90,9 @@ files:
|
|
89
90
|
- lib/micro/service/result.rb
|
90
91
|
- lib/micro/service/strict.rb
|
91
92
|
- lib/micro/service/version.rb
|
92
|
-
- lib/micro/
|
93
|
+
- lib/micro/service/with_validation.rb
|
94
|
+
- lib/u-service.rb
|
95
|
+
- test.sh
|
93
96
|
- u-service.gemspec
|
94
97
|
homepage: https://github.com/serradura/u-service
|
95
98
|
licenses:
|
data/lib/micro/u-service.rb
DELETED