sebastian 0.1.0 → 0.2.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/.circleci/config.yml +60 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +1 -4
- data/README.md +3 -0
- data/lib/sebastian/validation.rb +26 -0
- data/lib/sebastian/version.rb +1 -1
- data/lib/sebastian.rb +1 -0
- data/sebastian.gemspec +4 -1
- metadata +33 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a35d63983f5e2eaedd683ffc4b2c9c3d98a957e8d8e444ba443dcad89d46f08e
|
4
|
+
data.tar.gz: 30d960204eed664fd943d4836db07dec49dea38704f94ff104d93a22e83ad967
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 884b593eddc3e221cdeb10d2e3fe4c2b60b74a6c7199ce6d764e64d0d9e4c5e02b744406ab46d0d2a96e26e55890bfe47bcec8aa410e8429a4f47654d1c07304
|
7
|
+
data.tar.gz: 43bb1ebdf5e098af0e2ebc2d85e3ac433277f1e7954c599eb8f2fb68af29815239940c57c69f69d798b66cbdd0e8d6bc79fc10622adb72a61e785dd5b6ae8390
|
@@ -0,0 +1,60 @@
|
|
1
|
+
defaults: &defaults
|
2
|
+
working_directory: ~/repo
|
3
|
+
|
4
|
+
steps:
|
5
|
+
- checkout
|
6
|
+
|
7
|
+
- run:
|
8
|
+
name: install dependencies
|
9
|
+
command: |
|
10
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
11
|
+
|
12
|
+
- run:
|
13
|
+
name: run rubocop
|
14
|
+
command: bundle exec rubocop
|
15
|
+
|
16
|
+
- run:
|
17
|
+
name: run tests
|
18
|
+
command: |
|
19
|
+
mkdir /tmp/test-results
|
20
|
+
bundle exec rspec --format progress \
|
21
|
+
--format RspecJunitFormatter \
|
22
|
+
--out /tmp/test-results/rspec.xml \
|
23
|
+
--format progress
|
24
|
+
|
25
|
+
- store_test_results:
|
26
|
+
path: /tmp/test-results
|
27
|
+
- store_artifacts:
|
28
|
+
path: /tmp/test-results
|
29
|
+
destination: test-results
|
30
|
+
|
31
|
+
version: 2
|
32
|
+
jobs:
|
33
|
+
build-ruby-2.5.0:
|
34
|
+
<<: *defaults
|
35
|
+
docker:
|
36
|
+
- image: circleci/ruby:2.5.0
|
37
|
+
|
38
|
+
build-ruby-2.4.3:
|
39
|
+
<<: *defaults
|
40
|
+
docker:
|
41
|
+
- image: circleci/ruby:2.4.3
|
42
|
+
|
43
|
+
build-ruby-2.3.6:
|
44
|
+
<<: *defaults
|
45
|
+
docker:
|
46
|
+
- image: circleci/ruby:2.3.6
|
47
|
+
|
48
|
+
build-ruby-2.2.9:
|
49
|
+
<<: *defaults
|
50
|
+
docker:
|
51
|
+
- image: circleci/ruby:2.2.9
|
52
|
+
|
53
|
+
workflows:
|
54
|
+
version: 2
|
55
|
+
build:
|
56
|
+
jobs:
|
57
|
+
- build-ruby-2.5.0
|
58
|
+
- build-ruby-2.4.3
|
59
|
+
- build-ruby-2.3.6
|
60
|
+
- build-ruby-2.2.9
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.
|
2
|
+
TargetRubyVersion: 2.2.2
|
3
3
|
Metrics/LineLength:
|
4
4
|
Enabled: true
|
5
5
|
Max: 120
|
6
|
-
Style/FrozenStringLiteralComment:
|
7
|
-
Description: 'Ruby 3.0 transition for frozen string literals'
|
8
|
-
Enabled: false
|
9
6
|
Style/BlockLength:
|
10
7
|
Exclude:
|
11
8
|
- 'spec/**/*.rb'
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Sebastian
|
2
2
|
|
3
|
+
[](https://rubygems.org/gems/sebastian)
|
4
|
+
[](https://circleci.com/gh/paypronl/sebastian)
|
5
|
+
|
3
6
|
Sebastian makes it easy for you to have service objects in Ruby. It gives you a place to put your business logic.
|
4
7
|
It also helps you write safer code by validating that your inputs conform to your expectations.
|
5
8
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sebastian
|
4
|
+
# Provides service functionality. Subclass this to create an service.
|
5
|
+
#
|
6
|
+
# Example:
|
7
|
+
# class ExampleValidator < Sebastian::Validation
|
8
|
+
# # Required
|
9
|
+
# attr_accessor :foo
|
10
|
+
# attr_accessor :bar
|
11
|
+
#
|
12
|
+
# validates :foo, presence: true
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
# result = ExampleValidator.perform(foo: 10, bar: 5)
|
16
|
+
# if result.ok?
|
17
|
+
# result.value
|
18
|
+
# else
|
19
|
+
# result.errors
|
20
|
+
# end
|
21
|
+
class Validation < Base
|
22
|
+
def perform
|
23
|
+
Result.new(value: valid?, errors: errors)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/sebastian/version.rb
CHANGED
data/lib/sebastian.rb
CHANGED
data/sebastian.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
lib = File.expand_path('
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
3
|
|
4
4
|
require 'sebastian/version'
|
@@ -26,4 +26,7 @@ Gem::Specification.new do |gem|
|
|
26
26
|
gem.add_development_dependency 'pry', '~> 0.11'
|
27
27
|
gem.add_development_dependency 'rake', '~> 10.0'
|
28
28
|
gem.add_development_dependency 'rspec', '~> 3.0'
|
29
|
+
|
30
|
+
gem.add_development_dependency 'rspec_junit_formatter', '~> 0.3'
|
31
|
+
gem.add_development_dependency 'rubocop', '~> 0.52.0'
|
29
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sebastian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sander Tuin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -86,6 +86,34 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '3.0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rspec_junit_formatter
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0.3'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0.3'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: rubocop
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.52.0
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 0.52.0
|
89
117
|
description:
|
90
118
|
email:
|
91
119
|
- sander@paypro.nl
|
@@ -93,6 +121,7 @@ executables: []
|
|
93
121
|
extensions: []
|
94
122
|
extra_rdoc_files: []
|
95
123
|
files:
|
124
|
+
- ".circleci/config.yml"
|
96
125
|
- ".gitignore"
|
97
126
|
- ".rspec"
|
98
127
|
- ".rubocop.yml"
|
@@ -106,6 +135,7 @@ files:
|
|
106
135
|
- lib/sebastian/base.rb
|
107
136
|
- lib/sebastian/errors.rb
|
108
137
|
- lib/sebastian/result.rb
|
138
|
+
- lib/sebastian/validation.rb
|
109
139
|
- lib/sebastian/version.rb
|
110
140
|
- sebastian.gemspec
|
111
141
|
homepage: https://github.com/paypronl/sebastian
|
@@ -128,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
158
|
version: '0'
|
129
159
|
requirements: []
|
130
160
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.7.
|
161
|
+
rubygems_version: 2.7.6
|
132
162
|
signing_key:
|
133
163
|
specification_version: 4
|
134
164
|
summary: Your personal demon butler at your services.
|