declarative-builder 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 +5 -5
- data/.github/workflows/ci.yml +17 -0
- data/CHANGES.md +4 -0
- data/declarative-builder.gemspec +1 -1
- data/lib/declarative/builder.rb +6 -6
- data/lib/declarative/builder/version.rb +1 -1
- metadata +12 -13
- data/.travis.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3d962d01fcbf1a78ac25a316bc63d29d15d82ece5016d035e8c795df5534fe25
|
4
|
+
data.tar.gz: def4602a589f3d1cc41adfc2e86017326adacd002632344ca765f82c48403401
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc7b16845cf8d06f461da42485f5a7a3430b1e23f700ec2b867944b8b0afd53db1884dba57eaddeedd3ee486c675343e2b0afba0120ef74db3282e5461a7a8b0
|
7
|
+
data.tar.gz: 1ae0db9f2bac29bb563ff042f86bc2109a09c11b408ee1d1cdd6e76ab051126567962a8fa4f060d3417fb1daa00c6d39a3e5e13227783a41ecc1d3769747e0d6
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
9
|
+
ruby: [2.5, 2.6, 2.7, '3.0', head, jruby, jruby-head]
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- uses: ruby/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: ${{ matrix.ruby }}
|
16
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
17
|
+
- run: bundle exec rake
|
data/CHANGES.md
CHANGED
data/declarative-builder.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Declarative::Builder::VERSION
|
17
17
|
|
18
|
-
gem.add_dependency "
|
18
|
+
gem.add_dependency "trailblazer-option", "~> 0.1.0"
|
19
19
|
|
20
20
|
gem.add_development_dependency "rake"
|
21
21
|
gem.add_development_dependency "minitest"
|
data/lib/declarative/builder.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require "
|
1
|
+
require "trailblazer/option"
|
2
2
|
|
3
3
|
module Declarative
|
4
4
|
module Builder
|
@@ -8,16 +8,16 @@ module Declarative
|
|
8
8
|
end
|
9
9
|
|
10
10
|
class Builders < Array
|
11
|
-
def call(context, *args)
|
11
|
+
def call(context, *args, **options)
|
12
12
|
each do |block|
|
13
|
-
klass = block.(context,
|
13
|
+
klass = block.(*args, exec_context: context, keyword_arguments: options) and return klass # Trailblazer::Option#call()
|
14
14
|
end
|
15
15
|
|
16
16
|
context
|
17
17
|
end
|
18
18
|
|
19
19
|
def <<(proc)
|
20
|
-
super
|
20
|
+
super Trailblazer::Option( proc )
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -33,8 +33,8 @@ module Declarative
|
|
33
33
|
|
34
34
|
module Build
|
35
35
|
# Call this from your class to compute the concrete target class.
|
36
|
-
def build!(context, *args)
|
37
|
-
builders.(context, *args)
|
36
|
+
def build!(context, *args, **options)
|
37
|
+
builders.(context, *args, **options)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: declarative-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: trailblazer-option
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,8 +59,8 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- ".github/workflows/ci.yml"
|
62
63
|
- ".gitignore"
|
63
|
-
- ".travis.yml"
|
64
64
|
- CHANGES.md
|
65
65
|
- Gemfile
|
66
66
|
- LICENSE
|
@@ -76,7 +76,7 @@ homepage: https://github.com/apotonick/declarative-builder
|
|
76
76
|
licenses:
|
77
77
|
- MIT
|
78
78
|
metadata: {}
|
79
|
-
post_install_message:
|
79
|
+
post_install_message:
|
80
80
|
rdoc_options: []
|
81
81
|
require_paths:
|
82
82
|
- lib
|
@@ -91,9 +91,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
|
-
|
95
|
-
|
96
|
-
signing_key:
|
94
|
+
rubygems_version: 3.0.8
|
95
|
+
signing_key:
|
97
96
|
specification_version: 4
|
98
97
|
summary: Generic builder pattern.
|
99
98
|
test_files:
|