shifty 0.4.0 → 0.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60586c4caa01e362be844ef009bc5b90419524de80de66a18286bbc71de40b8e
4
- data.tar.gz: fc3d174365d07ed8d202630db19ab316749f42a24947ab549bc503e460fd5478
3
+ metadata.gz: 9e40c676c0313d5e9d68d6f086d288cbe8ff2ab62daec547512ff2a6d88f7137
4
+ data.tar.gz: 4510bcada58be0042ecef3acefb11b8805ca58d309ba5633a0c86ad2d99d8f35
5
5
  SHA512:
6
- metadata.gz: 5c8d7e4c9acec961c018ead8f69b422d25fae27ae69f78fe482eff067153d5c7937a5932e98ac9f941d753c281c221c0ef8e75ca68e70b44904e586909a34cf3
7
- data.tar.gz: a8f3a744fd32368969a609fb64326fc0c60c73efa4e45eb9adaea773efcbb103049ef6dd04dda6fd36bdf1a2c2d2f80e1af4354adacb66ebdfa33a9347e9cd0b
6
+ metadata.gz: 243e0b8aac6babbd44913ece9b7fae08b38aff704f6c5949ad48eb393558cf012c6f49b68dad301bd468f17247c76c0e3e2943ef894f1090806d8e2cfbd53879
7
+ data.tar.gz: 3adca13be889a7b036f6cc670832603f9015b2c6a5f00af54da0398e6c04585b0ce99a651d2867e3c81e36007999de20f9ae1479d41ac70ef97bc05ea5a27e00
data/.gitignore CHANGED
@@ -14,3 +14,5 @@
14
14
  .rubocop.yml
15
15
 
16
16
  Gemfile.lock
17
+
18
+ shifty-*.gem
data/lib/shifty/dsl.rb CHANGED
@@ -10,7 +10,7 @@ module Shifty
10
10
 
11
11
  return Worker.new(&callable) if series.nil?
12
12
 
13
- Worker.new do
13
+ Worker.new(tags: [:source]) do
14
14
  series.each(&callable)
15
15
 
16
16
  loop do
@@ -22,7 +22,7 @@ module Shifty
22
22
  def relay_worker(&block)
23
23
  ensure_regular_arity(block)
24
24
 
25
- Worker.new do |value|
25
+ Worker.new(tags: [:relay]) do |value|
26
26
  value && block.call(value)
27
27
  end
28
28
  end
@@ -32,7 +32,7 @@ module Shifty
32
32
 
33
33
  Worker.new(tags: [:side_effect]) do |value|
34
34
  value.tap do |v|
35
- used_value = mode == :hardened ?
35
+ used_value = (mode == :hardened) ?
36
36
  Marshal.load(Marshal.dump(v)) : v
37
37
 
38
38
  v && block.call(used_value)
@@ -47,7 +47,7 @@ module Shifty
47
47
  callable = argument.respond_to?(:call) ? argument : block
48
48
  ensure_callable(callable)
49
49
 
50
- Worker.new do |value, supply|
50
+ Worker.new(tags: [:filter]) do |value, supply|
51
51
  while value && !callable.call(value)
52
52
  value = supply.shift
53
53
  end
@@ -69,7 +69,7 @@ module Shifty
69
69
 
70
70
  batch_context = BatchContext.new({batch_full: batch_full})
71
71
 
72
- Worker.new(context: batch_context) do |value, supply, context|
72
+ Worker.new(tags: [:batch], context: batch_context) do |value, supply, context|
73
73
  if value
74
74
  context.collection = [value]
75
75
  until context.batch_complete?(
@@ -86,7 +86,7 @@ module Shifty
86
86
  def splitter_worker(&block)
87
87
  ensure_regular_arity(block)
88
88
 
89
- Worker.new do |value|
89
+ Worker.new(tags: [:splitter]) do |value|
90
90
  if value.nil?
91
91
  value
92
92
  else
@@ -101,7 +101,7 @@ module Shifty
101
101
 
102
102
  def trailing_worker(trail_length = 2)
103
103
  trail = []
104
- Worker.new do |value, supply|
104
+ Worker.new(tags: [:trailing]) do |value, supply|
105
105
  if value
106
106
  trail.unshift value
107
107
  if trail.size >= trail_length
@@ -1,3 +1,3 @@
1
1
  module Shifty
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.2"
3
3
  end
data/shifty.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
- f.match(%r{^(test|spec|features)/})
17
+ f.match(%r{^(test|spec|features|\.github|\.standard\.yml|Guardfile|_config\.yml)/})
18
18
  end
19
19
  spec.bindir = "exe"
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "rspec", "~> 3.9"
25
25
  spec.add_development_dependency "rspec-given", "~> 3.8"
26
26
  spec.add_development_dependency "pry"
27
- spec.add_development_dependency "standard", "~> 1.1"
27
+ spec.add_development_dependency "standard", ">= 1.28.2"
28
28
  spec.add_development_dependency "codeclimate-test-reporter"
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shifty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Helbling
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-03 00:00:00.000000000 Z
11
+ date: 2023-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: standard
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '1.1'
75
+ version: 1.28.2
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '1.1'
82
+ version: 1.28.2
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: codeclimate-test-reporter
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -103,9 +103,6 @@ executables: []
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
- - ".github/dependabot.yml"
107
- - ".github/workflows/codeql-analysis.yml"
108
- - ".github/workflows/ruby.yml"
109
106
  - ".gitignore"
110
107
  - ".rspec"
111
108
  - ".standard.yml"
@@ -1,8 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: bundler
4
- directory: "/"
5
- schedule:
6
- interval: daily
7
- time: "10:00"
8
- open-pull-requests-limit: 10
@@ -1,74 +0,0 @@
1
- # For most projects, this workflow file will not need changing; you simply need
2
- # to commit it to your repository.
3
- #
4
- # You may wish to alter this file to override the set of languages analyzed,
5
- # or to provide custom queries or build logic.
6
- #
7
- # ******** NOTE ********
8
- # We have attempted to detect the languages in your repository. Please check
9
- # the `language` matrix defined below to confirm you have the correct set of
10
- # supported CodeQL languages.
11
- #
12
- name: "CodeQL"
13
-
14
- on:
15
- push:
16
- branches: [ "main" ]
17
- pull_request:
18
- # The branches below must be a subset of the branches above
19
- branches: [ "main" ]
20
- schedule:
21
- - cron: '29 13 * * 5'
22
-
23
- jobs:
24
- analyze:
25
- name: Analyze
26
- runs-on: ubuntu-latest
27
- permissions:
28
- actions: read
29
- contents: read
30
- security-events: write
31
-
32
- strategy:
33
- fail-fast: false
34
- matrix:
35
- language: [ 'ruby' ]
36
- # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
- # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38
-
39
- steps:
40
- - name: Checkout repository
41
- uses: actions/checkout@v3
42
-
43
- # Initializes the CodeQL tools for scanning.
44
- - name: Initialize CodeQL
45
- uses: github/codeql-action/init@v2
46
- with:
47
- languages: ${{ matrix.language }}
48
- # If you wish to specify custom queries, you can do so here or in a config file.
49
- # By default, queries listed here will override any specified in a config file.
50
- # Prefix the list here with "+" to use these queries and those in the config file.
51
-
52
- # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53
- # queries: security-extended,security-and-quality
54
-
55
-
56
- # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57
- # If this step fails, then you should remove it and run the build manually (see below)
58
- - name: Autobuild
59
- uses: github/codeql-action/autobuild@v2
60
-
61
- # ℹ️ Command-line programs to run using the OS shell.
62
- # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63
-
64
- # If the Autobuild fails above, remove it and uncomment the following three lines.
65
- # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66
-
67
- # - run: |
68
- # echo "Run, Build Application using script"
69
- # ./location_of_script_within_repo/buildscript.sh
70
-
71
- - name: Perform CodeQL Analysis
72
- uses: github/codeql-action/analyze@v2
73
- with:
74
- category: "/language:${{matrix.language}}"
@@ -1,36 +0,0 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support
4
- # documentation.
5
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
-
8
- name: tests
9
-
10
- on:
11
- push:
12
- branches: [ main ]
13
- pull_request:
14
- branches: [ main ]
15
-
16
- jobs:
17
- test:
18
- runs-on: ubuntu-latest
19
- strategy:
20
- matrix:
21
- ruby-version: ['2.6', '2.7', '3.0']
22
-
23
- steps:
24
- - uses: actions/checkout@v2
25
- - name: Set up Ruby
26
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
27
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
28
- # uses: ruby/setup-ruby@v1
29
- uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
30
- with:
31
- ruby-version: ${{ matrix.ruby-version }}
32
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
33
- - name: Check code style
34
- run: bundle exec standardrb
35
- - name: Run tests
36
- run: bundle exec rake