dry-effects 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +23 -45
- data/.github/workflows/sync_configs.yml +29 -7
- data/.rspec +1 -1
- data/.rubocop.yml +11 -5
- data/CHANGELOG.md +8 -0
- data/Gemfile +2 -5
- data/Gemfile.devtools +14 -0
- data/LICENSE +1 -1
- data/README.md +18 -11
- data/docsite/source/effects/current_time.html.md +1 -1
- data/docsite/source/effects/timeout.html.md +2 -0
- data/lib/dry/effects/all.rb +1 -1
- data/lib/dry/effects/effects/env.rb +1 -1
- data/lib/dry/effects/effects/implicit.rb +1 -1
- data/lib/dry/effects/effects/interrupt.rb +1 -1
- data/lib/dry/effects/effects/lock.rb +5 -5
- data/lib/dry/effects/effects/parallel.rb +1 -1
- data/lib/dry/effects/effects/random.rb +2 -2
- data/lib/dry/effects/initializer.rb +1 -0
- data/lib/dry/effects/version.rb +1 -1
- data/project.yml +2 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b0de29697072219c4159b2d7eb371b04ee20ae17895cd06158ea4d7bc29bf1e
|
4
|
+
data.tar.gz: 0021bd3593b13b70da9780acc2b66f11f32b2bf61a7878f5b88ca7e168590b08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9900386d6f4ca0d157d4514f15c4229ed611540186be2f821b0cc80c909fcc838c9a91806c369b4d21d300a6b9ecaccc62adfa0b16458a5732a7d477fa59efca
|
7
|
+
data.tar.gz: 9c4ebd87d7b929941b43699dbd466e282e7636b7c06c064088a2203461febd81396bf749863eda6829034c1b579702a59637bee4a750464f28cb8efd3cf3cbd1
|
data/.github/workflows/ci.yml
CHANGED
@@ -8,67 +8,45 @@ on:
|
|
8
8
|
- .github/workflows/ci.yml
|
9
9
|
- lib/**
|
10
10
|
- spec/**
|
11
|
+
- Rakefile
|
11
12
|
- Gemfile
|
13
|
+
- Gemfile.devtools
|
12
14
|
- "*.gemspec"
|
15
|
+
- ".rubocop.yml"
|
16
|
+
pull_request:
|
17
|
+
branches:
|
18
|
+
- master
|
13
19
|
|
14
20
|
jobs:
|
15
|
-
tests
|
21
|
+
tests:
|
16
22
|
runs-on: ubuntu-latest
|
17
23
|
strategy:
|
18
24
|
fail-fast: false
|
19
25
|
matrix:
|
20
|
-
ruby:
|
26
|
+
ruby:
|
27
|
+
- "2.7"
|
28
|
+
- "2.6"
|
29
|
+
- "2.5"
|
30
|
+
- "2.4"
|
31
|
+
- "jruby"
|
21
32
|
include:
|
22
|
-
- ruby: "2.6
|
33
|
+
- ruby: "2.6"
|
23
34
|
coverage: "true"
|
24
35
|
steps:
|
25
36
|
- uses: actions/checkout@v1
|
26
37
|
- name: Set up Ruby
|
27
|
-
uses:
|
38
|
+
uses: eregon/use-ruby-action@master
|
28
39
|
with:
|
29
40
|
ruby-version: ${{matrix.ruby}}
|
30
|
-
- name:
|
31
|
-
if: "matrix.coverage == 'true'"
|
41
|
+
- name: Install latest bundler
|
32
42
|
run: |
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
43
|
+
gem install bundler
|
44
|
+
bundle config set without 'tools benchmarks docs'
|
45
|
+
- name: Bundle install
|
46
|
+
run: bundle install --jobs 4 --retry 3
|
37
47
|
- name: Run all tests
|
38
48
|
env:
|
39
49
|
COVERAGE: ${{matrix.coverage}}
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
bundle exec rake
|
44
|
-
- name: Send coverage results
|
45
|
-
if: "matrix.coverage == 'true'"
|
46
|
-
env:
|
47
|
-
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
|
48
|
-
GIT_COMMIT_SHA: ${{github.sha}}
|
49
|
-
GIT_BRANCH: ${{github.ref}}
|
50
|
-
GIT_COMMITTED_AT: ${{github.event.head_commit.timestamp}}
|
51
|
-
run: |
|
52
|
-
GIT_BRANCH=`ruby -e "puts ENV['GITHUB_REF'].split('/', 3).last"` \
|
53
|
-
GIT_COMMITTED_AT=`ruby -r time -e "puts Time.iso8601(ENV['GIT_COMMITTED_AT']).to_i"` \
|
54
|
-
./tmp/cc-test-reporter after-build
|
55
|
-
|
56
|
-
tests-others:
|
57
|
-
runs-on: ubuntu-latest
|
58
|
-
strategy:
|
59
|
-
fail-fast: false
|
60
|
-
matrix:
|
61
|
-
image: ["jruby:9.2.8", "ruby:rc"]
|
62
|
-
container:
|
63
|
-
image: ${{matrix.image}}
|
64
|
-
steps:
|
65
|
-
- uses: actions/checkout@v1
|
66
|
-
- name: Install git
|
67
|
-
run: |
|
68
|
-
apt-get update
|
69
|
-
apt-get install -y --no-install-recommends git
|
70
|
-
- name: Run all tests
|
71
|
-
run: |
|
72
|
-
gem install bundler
|
73
|
-
bundle install --jobs 4 --retry 3 --without tools docs benchmarks
|
74
|
-
bundle exec rspec
|
50
|
+
CODACY_RUN_LOCAL: true
|
51
|
+
CODACY_PROJECT_TOKEN: ${{secrets.CODACY_PROJECT_TOKEN}}
|
52
|
+
run: bundle exec rake
|
@@ -11,23 +11,45 @@ jobs:
|
|
11
11
|
if: github.event.action == 'sync_configs'
|
12
12
|
steps:
|
13
13
|
- uses: actions/checkout@v1
|
14
|
-
- name:
|
14
|
+
- name: Set up Ruby
|
15
|
+
uses: eregon/use-ruby-action@master
|
16
|
+
with:
|
17
|
+
ruby-version: 2.6
|
18
|
+
- name: Install latest bundler
|
19
|
+
run: |
|
20
|
+
gem install bundler
|
21
|
+
bundle config set without 'tools benchmarks docs'
|
22
|
+
- name: Install dependencies
|
23
|
+
run: bundle install --jobs 4 --retry 3 --without tools test benchmarks docs
|
24
|
+
- name: Symlink ossy
|
25
|
+
run: ln -sf "$(bundle info ossy --path)/bin/ossy" bin/ossy
|
26
|
+
- name: Clone devtools
|
27
|
+
run: git clone https://github.com/dry-rb/devtools.git tmp/devtools
|
28
|
+
- name: Compile file templates
|
15
29
|
env:
|
16
30
|
GITHUB_LOGIN: dry-bot
|
17
31
|
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
18
32
|
run: |
|
19
|
-
|
20
|
-
|
33
|
+
if [ -f "project.yml" ]; then
|
34
|
+
for t in `ls tmp/devtools/templates`
|
35
|
+
do
|
36
|
+
bin/ossy t c tmp/devtools/templates/$t $(basename $t .erb) project.yml
|
37
|
+
done
|
38
|
+
fi
|
39
|
+
- name: Update configuration files from devtools
|
40
|
+
run: |
|
21
41
|
if [ -f ".github/workflows/custom_ci.yml" ]; then
|
22
|
-
rsync -
|
42
|
+
rsync -arv --exclude '.github/workflows/ci.yml' tmp/devtools/shared/ . ;
|
23
43
|
else
|
24
|
-
rsync -
|
44
|
+
rsync -arv tmp/devtools/shared/ . ;
|
25
45
|
fi
|
26
|
-
|
46
|
+
- name: Commit changes
|
47
|
+
run: |
|
48
|
+
rm bin/ossy
|
27
49
|
git config --local user.email "dry-bot@dry-rb.org"
|
28
50
|
git config --local user.name "dry-bot"
|
29
51
|
git add -A
|
30
|
-
git commit -m "[devtools]
|
52
|
+
git commit -m "[devtools] sync configs" || echo "nothing changed"
|
31
53
|
- name: Push changes
|
32
54
|
uses: ad-m/github-push-action@master
|
33
55
|
with:
|
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
@@ -10,6 +10,9 @@ Style/StringLiterals:
|
|
10
10
|
Enabled: true
|
11
11
|
EnforcedStyle: single_quotes
|
12
12
|
|
13
|
+
Style/ParallelAssignment:
|
14
|
+
Enabled: false
|
15
|
+
|
13
16
|
Style/Alias:
|
14
17
|
Enabled: false
|
15
18
|
|
@@ -36,17 +39,17 @@ Metrics/LineLength:
|
|
36
39
|
Max: 100
|
37
40
|
|
38
41
|
Metrics/MethodLength:
|
39
|
-
|
42
|
+
Enabled: false
|
40
43
|
|
41
44
|
Metrics/ClassLength:
|
42
|
-
|
43
|
-
|
44
|
-
Metrics/AbcSize:
|
45
|
-
Max: 20
|
45
|
+
Enabled: false
|
46
46
|
|
47
47
|
Metrics/BlockLength:
|
48
48
|
Enabled: false
|
49
49
|
|
50
|
+
Metrics/AbcSize:
|
51
|
+
Max: 20
|
52
|
+
|
50
53
|
Metrics/CyclomaticComplexity:
|
51
54
|
Enabled: true
|
52
55
|
Max: 10
|
@@ -71,6 +74,9 @@ Lint/HandleExceptions:
|
|
71
74
|
Exclude:
|
72
75
|
- "spec/spec_helper.rb"
|
73
76
|
|
77
|
+
Naming/PredicateName:
|
78
|
+
Enabled: false
|
79
|
+
|
74
80
|
Naming/FileName:
|
75
81
|
Exclude:
|
76
82
|
- "lib/dry-*.rb"
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# v0.1.4 - 2020-01-07
|
2
|
+
|
3
|
+
## Fixed
|
4
|
+
|
5
|
+
- Some calls of effect builders were updated to prevent keyword warnings on 2.7 (flash-gordon)
|
6
|
+
|
7
|
+
[Compare v0.1.3...v0.1.4](https://github.com/dry-rb/dry-effects/compare/v0.1.3...v0.1.4)
|
8
|
+
|
1
9
|
# v0.1.3 - 2019-12-20
|
2
10
|
|
3
11
|
## Added
|
data/Gemfile
CHANGED
@@ -2,21 +2,18 @@
|
|
2
2
|
|
3
3
|
source 'https://rubygems.org'
|
4
4
|
|
5
|
-
|
5
|
+
eval_gemfile 'Gemfile.devtools'
|
6
6
|
|
7
7
|
gemspec
|
8
8
|
|
9
9
|
group :test do
|
10
10
|
gem 'dry-auto_inject', require: false
|
11
|
-
gem 'dry-system', github: 'dry-system', branch: 'master', require: false
|
12
|
-
gem 'simplecov', require: false, platform: :mri
|
11
|
+
gem 'dry-system', github: 'dry-rb/dry-system', branch: 'master', require: false
|
13
12
|
gem 'warning'
|
14
13
|
end
|
15
14
|
|
16
15
|
group :tools do
|
17
16
|
gem 'pry-byebug', platform: :mri
|
18
|
-
gem 'rubocop'
|
19
|
-
gem 'ossy', git: 'https://github.com/solnic/ossy.git', branch: 'master'
|
20
17
|
end
|
21
18
|
|
22
19
|
gem 'dry-struct'
|
data/Gemfile.devtools
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
2
|
+
|
3
|
+
gem "ossy", github: "solnic/ossy", branch: "master", platforms: :ruby
|
4
|
+
|
5
|
+
group :test do
|
6
|
+
gem 'codacy-coverage', require: false, platforms: :ruby
|
7
|
+
gem 'simplecov', require: false, platforms: :ruby
|
8
|
+
gem 'warning'
|
9
|
+
end
|
10
|
+
|
11
|
+
group :tools do
|
12
|
+
# this is the same version that we use on codacy
|
13
|
+
gem 'rubocop', '0.71.0'
|
14
|
+
end
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,22 +1,29 @@
|
|
1
1
|
[gem]: https://rubygems.org/gems/dry-effects
|
2
|
-
[
|
3
|
-
[
|
4
|
-
[coverage]: https://codeclimate.com/github/dry-rb/dry-effects/test_coverage
|
2
|
+
[actions]: https://github.com/dry-rb/dry-effects/actions
|
3
|
+
[codacy]: https://www.codacy.com/gh/dry-rb/dry-effects
|
5
4
|
[chat]: https://dry-rb.zulipchat.com
|
5
|
+
[inchpages]: http://inch-ci.org/github/dry-rb/dry-effects
|
6
6
|
|
7
7
|
# dry-effects [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
|
8
8
|
|
9
9
|
[![Gem Version](https://badge.fury.io/rb/dry-effects.svg)][gem]
|
10
|
-
[![
|
11
|
-
[![
|
12
|
-
[![
|
10
|
+
[![CI Status](https://github.com/dry-rb/dry-effects/workflows/ci/badge.svg)][actions]
|
11
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/158a8a584a3845eba4a67a71ad540210)][codacy]
|
12
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/158a8a584a3845eba4a67a71ad540210)][codacy]
|
13
|
+
[![Inline docs](http://inch-ci.org/github/dry-rb/dry-effects.svg?branch=master)][inchpages]
|
13
14
|
|
14
|
-
##
|
15
|
+
## Links
|
15
16
|
|
16
|
-
|
17
|
+
* [User documentation](http://dry-rb.org/gems/dry-effects)
|
18
|
+
* [API documentation](http://rubydoc.info/gems/dry-effects)
|
17
19
|
|
18
|
-
|
20
|
+
## Supported Ruby versions
|
19
21
|
|
20
|
-
|
22
|
+
This library officially supports the following Ruby versions:
|
21
23
|
|
22
|
-
|
24
|
+
* MRI >= `2.4`
|
25
|
+
* jruby >= `9.2`
|
26
|
+
|
27
|
+
## License
|
28
|
+
|
29
|
+
See `LICENSE` file.
|
data/lib/dry/effects/all.rb
CHANGED
@@ -34,7 +34,7 @@ module Dry
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
if ::File.
|
37
|
+
if ::File.exist?("#{__dir__}/providers/#{key}.rb")
|
38
38
|
providers.register(key, memoize: true) do
|
39
39
|
require "dry/effects/providers/#{key}"
|
40
40
|
Providers.const_get(Inflector.camelize(key))
|
@@ -16,13 +16,13 @@ module Dry
|
|
16
16
|
define_method(:lock) do |key, meta: Undefined, &block|
|
17
17
|
if block
|
18
18
|
begin
|
19
|
-
handle = ::Dry::Effects.yield(Lock.(key, meta))
|
19
|
+
handle = ::Dry::Effects.yield(Lock.payload(key, meta))
|
20
20
|
block.(!handle.nil?)
|
21
21
|
ensure
|
22
|
-
::Dry::Effects.yield(Unlock.(handle)) if handle
|
22
|
+
::Dry::Effects.yield(Unlock.payload(handle)) if handle
|
23
23
|
end
|
24
24
|
else
|
25
|
-
::Dry::Effects.yield(Lock.(key, meta))
|
25
|
+
::Dry::Effects.yield(Lock.payload(key, meta))
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -31,11 +31,11 @@ module Dry
|
|
31
31
|
end
|
32
32
|
|
33
33
|
define_method(:locked?) do |key|
|
34
|
-
::Dry::Effects.yield(Locked.(key))
|
34
|
+
::Dry::Effects.yield(Locked.payload(key))
|
35
35
|
end
|
36
36
|
|
37
37
|
define_method(:lock_meta) do |key|
|
38
|
-
::Dry::Effects.yield(Meta.(key))
|
38
|
+
::Dry::Effects.yield(Meta.payload(key))
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -11,7 +11,7 @@ module Dry
|
|
11
11
|
|
12
12
|
def initialize
|
13
13
|
define_method(:par) { |&block| ::Dry::Effects.yield(Par).(&block) }
|
14
|
-
define_method(:join) { |xs| ::Dry::Effects.yield(Join.(xs)) }
|
14
|
+
define_method(:join) { |xs| ::Dry::Effects.yield(Join.payload(xs)) }
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -6,11 +6,11 @@ module Dry
|
|
6
6
|
module Effects
|
7
7
|
module Effects
|
8
8
|
class Random < ::Module
|
9
|
-
|
9
|
+
Rand = Effect.new(type: :random, name: :rand)
|
10
10
|
|
11
11
|
def initialize
|
12
12
|
module_eval do
|
13
|
-
define_method(:rand) { |n = nil| ::Dry::Effects.yield(
|
13
|
+
define_method(:rand) { |n = nil| ::Dry::Effects.yield(Rand.payload(n)) }
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
data/lib/dry/effects/version.rb
CHANGED
data/project.yml
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-effects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikita Shilnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -181,6 +181,7 @@ files:
|
|
181
181
|
- CODE_OF_CONDUCT.md
|
182
182
|
- CONTRIBUTING.md
|
183
183
|
- Gemfile
|
184
|
+
- Gemfile.devtools
|
184
185
|
- LICENSE
|
185
186
|
- README.md
|
186
187
|
- Rakefile
|
@@ -258,6 +259,7 @@ files:
|
|
258
259
|
- lib/dry/effects/providers/timestamp.rb
|
259
260
|
- lib/dry/effects/stack.rb
|
260
261
|
- lib/dry/effects/version.rb
|
262
|
+
- project.yml
|
261
263
|
homepage: https://github.com/dry-rb/dry-effects
|
262
264
|
licenses:
|
263
265
|
- MIT
|
@@ -281,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
283
|
- !ruby/object:Gem::Version
|
282
284
|
version: '0'
|
283
285
|
requirements: []
|
284
|
-
rubygems_version: 3.
|
286
|
+
rubygems_version: 3.1.2
|
285
287
|
signing_key:
|
286
288
|
specification_version: 4
|
287
289
|
summary: Algebraic effects.
|