attr-gather 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/deploy.yml +15 -0
  3. data/.github/workflows/doc.yml +25 -0
  4. data/.github/workflows/ruby.yml +20 -0
  5. data/.gitignore +12 -0
  6. data/.ignore +1 -0
  7. data/.rspec +3 -0
  8. data/.rubocop.yml +38 -0
  9. data/.ruby-version +1 -0
  10. data/.travis.yml +7 -0
  11. data/.vim/coc-settings.json +12 -0
  12. data/.vim/install.sh +38 -0
  13. data/.yardopts +4 -0
  14. data/CODE_OF_CONDUCT.md +74 -0
  15. data/Gemfile +19 -0
  16. data/Gemfile.lock +147 -0
  17. data/LICENSE.txt +21 -0
  18. data/README.md +63 -0
  19. data/Rakefile +21 -0
  20. data/attr-gather.gemspec +38 -0
  21. data/bin/console +15 -0
  22. data/bin/setup +8 -0
  23. data/bin/solargraph +29 -0
  24. data/examples/post_enhancer.rb +119 -0
  25. data/examples/post_enhancer.svg +55 -0
  26. data/lib/attr-gather.rb +3 -0
  27. data/lib/attr/gather.rb +16 -0
  28. data/lib/attr/gather/aggregators.rb +31 -0
  29. data/lib/attr/gather/aggregators/base.rb +38 -0
  30. data/lib/attr/gather/aggregators/deep_merge.rb +50 -0
  31. data/lib/attr/gather/aggregators/shallow_merge.rb +40 -0
  32. data/lib/attr/gather/concerns/identifiable.rb +24 -0
  33. data/lib/attr/gather/concerns/registrable.rb +50 -0
  34. data/lib/attr/gather/filters.rb +34 -0
  35. data/lib/attr/gather/filters/base.rb +20 -0
  36. data/lib/attr/gather/filters/contract.rb +60 -0
  37. data/lib/attr/gather/filters/filtering.rb +27 -0
  38. data/lib/attr/gather/filters/noop.rb +14 -0
  39. data/lib/attr/gather/filters/result.rb +23 -0
  40. data/lib/attr/gather/version.rb +7 -0
  41. data/lib/attr/gather/workflow.rb +29 -0
  42. data/lib/attr/gather/workflow/async_task_executor.rb +17 -0
  43. data/lib/attr/gather/workflow/callable.rb +84 -0
  44. data/lib/attr/gather/workflow/dot_serializer.rb +46 -0
  45. data/lib/attr/gather/workflow/dsl.rb +184 -0
  46. data/lib/attr/gather/workflow/graphable.rb +50 -0
  47. data/lib/attr/gather/workflow/task.rb +29 -0
  48. data/lib/attr/gather/workflow/task_execution_result.rb +58 -0
  49. data/lib/attr/gather/workflow/task_executor.rb +31 -0
  50. data/lib/attr/gather/workflow/task_graph.rb +107 -0
  51. metadata +150 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 07b0cde44c4761c85df967f235497ee50b8970940907fce14a2690edd94c17db
4
+ data.tar.gz: bd01757a8ef862482555d1ed0d10c4ea5e935712f68ab9cad835a01e1d0ed6f5
5
+ SHA512:
6
+ metadata.gz: 2d6687e01237ef8f573bb67dadf413eab97a448367d8d16773db6e8a855a388d1ee768d0f171c11f5afdd5109799aa2635f5b23ce2f2c9e9956875a6291313f1
7
+ data.tar.gz: 5c46841afea4865187f23674a25ff0c3a0db79f826ca11d62b4c29df0bfcfe5e2833ae39520cb616005f59e1fee8f43dc5fccede3d355ac8a387eb5d415c3090
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: Deploy
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+ jobs:
8
+ build-test-lint:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v1
12
+ - uses: "cadwallion/publish-rubygems-action@master"
13
+ env:
14
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15
+ RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: Doc
3
+ on: [push]
4
+ jobs:
5
+ doc:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v1
9
+ - name: Set up Ruby 2.6
10
+ uses: actions/setup-ruby@v1
11
+ with:
12
+ ruby-version: 2.6.x
13
+ - name: Build
14
+ run: |
15
+ gem install bundler
16
+ bundle install --without=local --jobs 4 --retry 3
17
+ bundle exec yard
18
+ - name: Deploy Docs
19
+ uses: JamesIves/github-pages-deploy-action@master
20
+ if: github.ref == 'master'
21
+ env:
22
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23
+ BASE_BRANCH: master # The branch the action should deploy from.
24
+ BRANCH: gh-pages # The branch the action should deploy to.
25
+ FOLDER: doc # The folder the action should deploy.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Build + Test + Lint
3
+ on: [push]
4
+ jobs:
5
+ build-test-lint:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v1
9
+ - name: Set up Ruby 2.6
10
+ uses: actions/setup-ruby@v1
11
+ with:
12
+ ruby-version: 2.6.x
13
+ - name: Build
14
+ run: |
15
+ gem install bundler
16
+ bundle install --without=local --jobs 4 --retry 3
17
+ - name: Test
18
+ run: bundle exec rake spec
19
+ - name: Lint
20
+ run: bundle exec rake lint
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ ;
data/.ignore ADDED
@@ -0,0 +1 @@
1
+ doc
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,38 @@
1
+ require:
2
+ - rubocop-performance
3
+
4
+ AllCops:
5
+ UseCache: true
6
+ CacheRootDirectory: './tmp/cache'
7
+ TargetRubyVersion: 2.5
8
+
9
+ Metrics/BlockLength:
10
+ Exclude:
11
+ - spec/**/*.rb
12
+
13
+ Metrics/ModuleLength:
14
+ Exclude:
15
+ - spec/**/*.rb
16
+
17
+ Metrics/LineLength:
18
+ Exclude:
19
+ - ./attr-gather.gemspec
20
+ - ./bin/**/*
21
+ - ./examples/**/*
22
+
23
+ Naming/FileName:
24
+ Exclude:
25
+ - ./lib/attr-gather.rb
26
+
27
+ Style/Documentation:
28
+ Exclude:
29
+ - ./examples/**/*
30
+ - ./spec/**/*
31
+
32
+ Metrics/CyclomaticComplexity:
33
+ Exclude:
34
+ - ./lib/attr/gather/workflow/dsl.rb
35
+
36
+ Metrics/PerceivedComplexity:
37
+ Exclude:
38
+ - ./lib/attr/gather/workflow/dsl.rb
@@ -0,0 +1 @@
1
+ 2.6.5
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.3
7
+ before_install: gem install bundler -v 2.0.2
@@ -0,0 +1,12 @@
1
+ {
2
+ "solargraph.commandPath": "./bin/solargraph",
3
+ "coc.preferences.formatOnSaveFiletypes": [
4
+ "ruby"
5
+ ],
6
+ "solargraph.autoformat": true,
7
+ "solargraph.formatting": true,
8
+ "solargraph.diagnostics": true,
9
+ "suggest.autoTrigger": "always",
10
+ "suggest.minTriggerInputLength": 2,
11
+ "suggest.triggerAfterInsertEnter": true
12
+ }
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -ex
4
+
5
+ setup_coc() {
6
+ # for neovim
7
+ mkdir -p ~/.local/share/nvim/site/pack/coc/start
8
+ pushd ~/.local/share/nvim/site/pack/coc/start
9
+ curl --fail -L https://github.com/neoclide/coc.nvim/archive/release.tar.gz|tar xzfv -
10
+ popd
11
+ }
12
+
13
+ install_coc_extensions() {
14
+ # Install extensions
15
+ mkdir -p ~/.config/coc/extensions
16
+ pushd ~/.config/coc/extensions
17
+ if [ ! -f package.json ]; then
18
+ echo '{"dependencies":{}}'> package.json
19
+ fi
20
+
21
+ # COC plugins
22
+ npm install --global-style --ignore-scripts --no-bin-links --no-package-lock --only=prod \
23
+ coc-solargraph \
24
+ coc-tag \
25
+ coc-diagnostic
26
+ popd
27
+ }
28
+
29
+
30
+ setup_solargraph() {
31
+ # Solargraph docs
32
+ bundle exec solargraph download-core
33
+ bundle exec yard gems
34
+ }
35
+
36
+ setup_coc
37
+ install_coc_extensions
38
+ setup_solargraph
@@ -0,0 +1,4 @@
1
+ --readme README.md
2
+ --title 'attr-gather api docs'
3
+ --fail-on-warning
4
+ --embed-mixins
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at i.kerseymer@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in attr-gather.gemspec
6
+ gemspec
7
+
8
+ group :development, :test do
9
+ gem 'dry-validation', '~> 1.3'
10
+ gem 'pry'
11
+ gem 'rubocop'
12
+ gem 'rubocop-performance'
13
+ gem 'yard'
14
+ end
15
+
16
+ group :local do
17
+ gem 'http'
18
+ gem 'solargraph'
19
+ end
@@ -0,0 +1,147 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ attr-gather (1.0.0)
5
+ dry-container (~> 0.7)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.7.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
12
+ ast (2.4.0)
13
+ backport (1.1.2)
14
+ coderay (1.1.2)
15
+ concurrent-ruby (1.1.5)
16
+ diff-lcs (1.3)
17
+ domain_name (0.5.20190701)
18
+ unf (>= 0.0.5, < 1.0.0)
19
+ dry-configurable (0.8.3)
20
+ concurrent-ruby (~> 1.0)
21
+ dry-core (~> 0.4, >= 0.4.7)
22
+ dry-container (0.7.2)
23
+ concurrent-ruby (~> 1.0)
24
+ dry-configurable (~> 0.1, >= 0.1.3)
25
+ dry-core (0.4.9)
26
+ concurrent-ruby (~> 1.0)
27
+ dry-equalizer (0.2.2)
28
+ dry-inflector (0.2.0)
29
+ dry-initializer (3.0.1)
30
+ dry-logic (1.0.3)
31
+ concurrent-ruby (~> 1.0)
32
+ dry-core (~> 0.2)
33
+ dry-equalizer (~> 0.2)
34
+ dry-schema (1.4.1)
35
+ concurrent-ruby (~> 1.0)
36
+ dry-configurable (~> 0.8, >= 0.8.3)
37
+ dry-core (~> 0.4)
38
+ dry-equalizer (~> 0.2)
39
+ dry-initializer (~> 3.0)
40
+ dry-logic (~> 1.0)
41
+ dry-types (~> 1.2)
42
+ dry-types (1.2.0)
43
+ concurrent-ruby (~> 1.0)
44
+ dry-container (~> 0.3)
45
+ dry-core (~> 0.4, >= 0.4.4)
46
+ dry-equalizer (~> 0.2, >= 0.2.2)
47
+ dry-inflector (~> 0.1, >= 0.1.2)
48
+ dry-logic (~> 1.0, >= 1.0.2)
49
+ dry-validation (1.3.1)
50
+ concurrent-ruby (~> 1.0)
51
+ dry-container (~> 0.7, >= 0.7.1)
52
+ dry-core (~> 0.4)
53
+ dry-equalizer (~> 0.2)
54
+ dry-initializer (~> 3.0)
55
+ dry-schema (~> 1.0, >= 1.3.1)
56
+ ffi (1.11.1)
57
+ ffi-compiler (1.0.1)
58
+ ffi (>= 1.0.0)
59
+ rake
60
+ htmlentities (4.3.4)
61
+ http (4.2.0)
62
+ addressable (~> 2.3)
63
+ http-cookie (~> 1.0)
64
+ http-form_data (~> 2.0)
65
+ http-parser (~> 1.2.0)
66
+ http-cookie (1.0.3)
67
+ domain_name (~> 0.5)
68
+ http-form_data (2.1.1)
69
+ http-parser (1.2.1)
70
+ ffi-compiler (>= 1.0, < 2.0)
71
+ jaro_winkler (1.5.3)
72
+ method_source (0.9.2)
73
+ mini_portile2 (2.4.0)
74
+ nokogiri (1.10.4)
75
+ mini_portile2 (~> 2.4.0)
76
+ parallel (1.18.0)
77
+ parser (2.6.5.0)
78
+ ast (~> 2.4.0)
79
+ pry (0.12.2)
80
+ coderay (~> 1.1.0)
81
+ method_source (~> 0.9.0)
82
+ public_suffix (4.0.1)
83
+ rainbow (3.0.0)
84
+ rake (10.5.0)
85
+ reverse_markdown (1.3.0)
86
+ nokogiri
87
+ rspec (3.9.0)
88
+ rspec-core (~> 3.9.0)
89
+ rspec-expectations (~> 3.9.0)
90
+ rspec-mocks (~> 3.9.0)
91
+ rspec-core (3.9.0)
92
+ rspec-support (~> 3.9.0)
93
+ rspec-expectations (3.9.0)
94
+ diff-lcs (>= 1.2.0, < 2.0)
95
+ rspec-support (~> 3.9.0)
96
+ rspec-mocks (3.9.0)
97
+ diff-lcs (>= 1.2.0, < 2.0)
98
+ rspec-support (~> 3.9.0)
99
+ rspec-support (3.9.0)
100
+ rubocop (0.75.1)
101
+ jaro_winkler (~> 1.5.1)
102
+ parallel (~> 1.10)
103
+ parser (>= 2.6)
104
+ rainbow (>= 2.2.2, < 4.0)
105
+ ruby-progressbar (~> 1.7)
106
+ unicode-display_width (>= 1.4.0, < 1.7)
107
+ rubocop-performance (1.5.1)
108
+ rubocop (>= 0.71.0)
109
+ ruby-progressbar (1.10.1)
110
+ solargraph (0.37.2)
111
+ backport (~> 1.1)
112
+ bundler (>= 1.17.2)
113
+ htmlentities (~> 4.3, >= 4.3.4)
114
+ jaro_winkler (~> 1.5)
115
+ nokogiri (~> 1.9, >= 1.9.1)
116
+ parser (~> 2.3)
117
+ reverse_markdown (~> 1.0, >= 1.0.5)
118
+ rubocop (~> 0.52)
119
+ thor (~> 0.19, >= 0.19.4)
120
+ tilt (~> 2.0)
121
+ yard (~> 0.9)
122
+ thor (0.20.3)
123
+ tilt (2.0.10)
124
+ unf (0.1.4)
125
+ unf_ext
126
+ unf_ext (0.0.7.6)
127
+ unicode-display_width (1.6.0)
128
+ yard (0.9.20)
129
+
130
+ PLATFORMS
131
+ ruby
132
+
133
+ DEPENDENCIES
134
+ attr-gather!
135
+ bundler (~> 2.0)
136
+ dry-validation (~> 1.3)
137
+ http
138
+ pry
139
+ rake (~> 10.0)
140
+ rspec (~> 3.0)
141
+ rubocop
142
+ rubocop-performance
143
+ solargraph
144
+ yard
145
+
146
+ BUNDLED WITH
147
+ 2.1.4