business_pipeline 0.1.3 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f6c7cfe3bbbd5a32ee37665327ebb703287b67f97cd951b5abf18a49d75c299
4
- data.tar.gz: 8b4f0c9d44e2df91a0033c45c56c4b8ab309db5a3638f7397a1e151135232b29
3
+ metadata.gz: 4ccb2870b744ff4ca38731d9281137c8b8606c516d4ca7f7be24162cb42da61f
4
+ data.tar.gz: f8d6460835aa13174688f9464fc8f52073db18cd1ff364e13573385b7e1c1f65
5
5
  SHA512:
6
- metadata.gz: 6e70718b9b7b6876be20c36c3bf7ae5e1a71a1f0c1eff5ed313838029574f07b4af75fe08135b153d87ac337ffdc273d358d55ac268efaefd912eaaf59ebf30a
7
- data.tar.gz: 2fbb00b2e78fede35f85397b81f86dea713337c3d9de47c7d186d4d525634a71d309cb3ab1e2ad54c22ce7b38da3ae18ece642ac5eb6d82eacb0fd0194617b9f
6
+ metadata.gz: d5993f592d9dbfa3a9b28127611bb8c501f5e284a0af340ca9c40310c9cbfafe598edfd30bafb01e32559215c31962e352a4baf892656ed63ebc64a728f747ab
7
+ data.tar.gz: 78c27e1cde5b3a98135793253a251c5d43d5ce396f2831c72b8751dbb2e071328ed20b823215dda8635bc405260693c9ddd57346843a3fa222ec736167e3047b
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ cache: bundler
3
+ before_install:
4
+ - gem install bundler -v $(tail -1 Gemfile.lock)
5
+ rvm:
6
+ - 2.5
7
+ - 2.6
8
+ - 2.7
9
+ - 3.0
10
+ - 3.1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1
4
+
5
+ * Fixing `Config` compatibility with Ruby 3+
6
+
7
+ ## 0.3.0
8
+
9
+ * Adding Ruby 3+ compatibility
10
+
11
+ ## 0.2.0
12
+
13
+ * Adding Ruby 2.7 compatibility
14
+
3
15
  ## 0.1.2
4
16
 
5
17
  * Fixing hooks inheritence to prevent modifying parent class hooks
data/Gemfile.lock CHANGED
@@ -1,24 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- business_pipeline (0.1.3)
4
+ business_pipeline (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.4.0)
10
- coderay (1.1.2)
11
- diff-lcs (1.3)
12
- docile (1.3.1)
13
- ffi (1.10.0)
14
- formatador (0.2.5)
15
- guard (2.15.0)
9
+ ast (2.4.2)
10
+ coderay (1.1.3)
11
+ diff-lcs (1.5.0)
12
+ docile (1.4.0)
13
+ ffi (1.15.5)
14
+ formatador (1.1.0)
15
+ guard (2.18.0)
16
16
  formatador (>= 0.2.4)
17
17
  listen (>= 2.7, < 4.0)
18
18
  lumberjack (>= 1.0.12, < 2.0)
19
19
  nenv (~> 0.1)
20
20
  notiffany (~> 0.0)
21
- pry (>= 0.9.12)
21
+ pry (>= 0.13.0)
22
22
  shellany (~> 0.0)
23
23
  thor (>= 0.18.1)
24
24
  guard-compat (1.2.1)
@@ -26,73 +26,70 @@ GEM
26
26
  guard (~> 2.1)
27
27
  guard-compat (~> 1.1)
28
28
  rspec (>= 2.99.0, < 4.0)
29
- jaro_winkler (1.5.1)
30
- json (2.1.0)
31
- listen (3.1.5)
32
- rb-fsevent (~> 0.9, >= 0.9.4)
33
- rb-inotify (~> 0.9, >= 0.9.7)
34
- ruby_dep (~> 1.2)
35
- lumberjack (1.0.13)
36
- method_source (0.9.2)
29
+ listen (3.7.1)
30
+ rb-fsevent (~> 0.10, >= 0.10.3)
31
+ rb-inotify (~> 0.9, >= 0.9.10)
32
+ lumberjack (1.2.8)
33
+ method_source (1.0.0)
37
34
  nenv (0.3.0)
38
- notiffany (0.1.1)
35
+ notiffany (0.1.3)
39
36
  nenv (~> 0.1)
40
37
  shellany (~> 0.0)
41
- parallel (1.12.1)
42
- parser (2.5.1.2)
43
- ast (~> 2.4.0)
44
- powerpack (0.1.2)
45
- pry (0.12.2)
46
- coderay (~> 1.1.0)
47
- method_source (~> 0.9.0)
48
- rainbow (3.0.0)
49
- rake (10.5.0)
50
- rb-fsevent (0.10.3)
51
- rb-inotify (0.10.0)
38
+ parallel (1.22.1)
39
+ parser (3.1.2.0)
40
+ ast (~> 2.4.1)
41
+ pry (0.14.1)
42
+ coderay (~> 1.1)
43
+ method_source (~> 1.0)
44
+ rainbow (3.1.1)
45
+ rake (13.0.6)
46
+ rb-fsevent (0.11.1)
47
+ rb-inotify (0.10.1)
52
48
  ffi (~> 1.0)
53
- rspec (3.8.0)
54
- rspec-core (~> 3.8.0)
55
- rspec-expectations (~> 3.8.0)
56
- rspec-mocks (~> 3.8.0)
57
- rspec-core (3.8.0)
58
- rspec-support (~> 3.8.0)
59
- rspec-expectations (3.8.2)
49
+ rexml (3.2.5)
50
+ rspec (3.11.0)
51
+ rspec-core (~> 3.11.0)
52
+ rspec-expectations (~> 3.11.0)
53
+ rspec-mocks (~> 3.11.0)
54
+ rspec-core (3.11.0)
55
+ rspec-support (~> 3.11.0)
56
+ rspec-expectations (3.11.0)
60
57
  diff-lcs (>= 1.2.0, < 2.0)
61
- rspec-support (~> 3.8.0)
62
- rspec-mocks (3.8.0)
58
+ rspec-support (~> 3.11.0)
59
+ rspec-mocks (3.11.1)
63
60
  diff-lcs (>= 1.2.0, < 2.0)
64
- rspec-support (~> 3.8.0)
65
- rspec-support (3.8.0)
66
- rubocop (0.60.0)
67
- jaro_winkler (~> 1.5.1)
61
+ rspec-support (~> 3.11.0)
62
+ rspec-support (3.11.0)
63
+ rubocop (0.84.0)
68
64
  parallel (~> 1.10)
69
- parser (>= 2.5, != 2.5.1.1)
70
- powerpack (~> 0.1)
65
+ parser (>= 2.7.0.1)
71
66
  rainbow (>= 2.2.2, < 4.0)
67
+ rexml
68
+ rubocop-ast (>= 0.0.3)
72
69
  ruby-progressbar (~> 1.7)
73
- unicode-display_width (~> 1.4.0)
74
- ruby-progressbar (1.10.0)
75
- ruby_dep (1.5.0)
70
+ unicode-display_width (>= 1.4.0, < 2.0)
71
+ rubocop-ast (1.18.0)
72
+ parser (>= 3.1.1.0)
73
+ ruby-progressbar (1.11.0)
76
74
  shellany (0.0.1)
77
- simplecov (0.16.1)
75
+ simplecov (0.18.5)
78
76
  docile (~> 1.1)
79
- json (>= 1.8, < 3)
80
- simplecov-html (~> 0.10.0)
81
- simplecov-html (0.10.2)
82
- thor (0.20.3)
83
- unicode-display_width (1.4.0)
77
+ simplecov-html (~> 0.11)
78
+ simplecov-html (0.12.3)
79
+ thor (1.2.1)
80
+ unicode-display_width (1.8.0)
84
81
 
85
82
  PLATFORMS
86
83
  ruby
87
84
 
88
85
  DEPENDENCIES
89
- bundler (~> 1.16)
86
+ bundler (~> 2.1)
90
87
  business_pipeline!
91
88
  guard-rspec (~> 4.7)
92
- rake (~> 10.0)
89
+ rake (~> 13.0)
93
90
  rspec (~> 3.6)
94
- rubocop (~> 0.60.0)
95
- simplecov (~> 0.16.1)
91
+ rubocop (~> 0.84.0)
92
+ simplecov (~> 0.18.5)
96
93
 
97
94
  BUNDLED WITH
98
- 1.17.2
95
+ 2.2.22
data/README.md CHANGED
@@ -1,3 +1,9 @@
1
+ [![Build Status](https://travis-ci.org/simonc/business_pipeline.svg?branch=master)](https://travis-ci.org/simonc/business_pipeline)
2
+
3
+ ## Deprecated
4
+
5
+ This gem is no longer active and the recommended alternative is [dry-transactions](https://dry-rb.org/gems/dry-transaction).
6
+
1
7
  # BusinessPipeline
2
8
 
3
9
  BusinessPipeline (BP) aim is to help organize your app's logic in a generic way. You define business bricks that you can then plug together to build more eveolved pipelines.
@@ -76,7 +82,7 @@ end
76
82
  class SortUsers
77
83
  include BusinessPipeline::Step
78
84
 
79
- def call
85
+ def call
80
86
  context.users = context.users.order(context.sort)
81
87
  end
82
88
  end
@@ -84,7 +90,7 @@ end
84
90
  class PaginateUsers
85
91
  include BusinessPipeline::Step
86
92
 
87
- def call
93
+ def call
88
94
  context.users = context.user.page(context.page)
89
95
  end
90
96
  end
data/Rakefile CHANGED
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
4
7
 
5
8
  task default: :spec
@@ -22,10 +22,10 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_development_dependency 'bundler', '~> 1.16'
25
+ spec.add_development_dependency 'bundler', '~> 2.1'
26
26
  spec.add_development_dependency 'guard-rspec', '~> 4.7'
27
- spec.add_development_dependency 'rake', '~> 10.0'
27
+ spec.add_development_dependency 'rake', '~> 13.0'
28
28
  spec.add_development_dependency 'rspec', '~> 3.6'
29
- spec.add_development_dependency 'rubocop', '~> 0.60.0'
30
- spec.add_development_dependency 'simplecov', '~> 0.16.1'
29
+ spec.add_development_dependency 'rubocop', '~> 0.84.0'
30
+ spec.add_development_dependency 'simplecov', '~> 0.18.5'
31
31
  end
@@ -3,14 +3,15 @@
3
3
  require 'ostruct'
4
4
 
5
5
  module BusinessPipeline
6
- class Config < OpenStruct
6
+ class Config
7
7
  def initialize(hash = nil, &block)
8
- super(hash)
8
+ @data = OpenStruct.new(hash)
9
+
9
10
  instance_eval(&block) if block
10
11
  end
11
12
 
12
13
  def fetch(key)
13
- value = self[key.to_sym]
14
+ value = data[key.to_sym]
14
15
 
15
16
  return value unless value.nil?
16
17
  return yield(key) if block_given?
@@ -18,15 +19,17 @@ module BusinessPipeline
18
19
  fail KeyError, key
19
20
  end
20
21
 
21
- # rubocop:disable Style/MissingRespondToMissing
22
22
  def method_missing(meth, *args, &block)
23
23
  if args.size.zero? || meth.to_s.end_with?('=')
24
- super
24
+ data.public_send(meth, *args, &block)
25
25
  else
26
- self[meth] = args.first
26
+ data[meth] = args.first
27
27
  end
28
28
  end
29
- # rubocop:enable Style/MissingRespondToMissing
29
+
30
+ def respond_to_missing?(meth, include_private = false)
31
+ data.respond_to?(meth, include_private) || super
32
+ end
30
33
 
31
34
  attr_reader :data
32
35
  private :data
@@ -37,7 +37,7 @@ module BusinessPipeline
37
37
  end
38
38
 
39
39
  private def update!(context)
40
- context.each { |key, value| modifiable[key.to_sym] = value }
40
+ context.each { |key, value| self[key.to_sym] = value }
41
41
  end
42
42
  end
43
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BusinessPipeline
4
- VERSION = -'0.1.3'
4
+ VERSION = -'0.3.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: business_pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Courtois
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-07 00:00:00.000000000 Z
11
+ date: 2022-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
19
+ version: '2.1'
20
20
  type: :development
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: '1.16'
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: guard-rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '13.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,29 +72,29 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.60.0
75
+ version: 0.84.0
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: 0.60.0
82
+ version: 0.84.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.16.1
89
+ version: 0.18.5
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.16.1
97
- description:
96
+ version: 0.18.5
97
+ description:
98
98
  email:
99
99
  - scourtois_github@cubyx.fr
100
100
  executables: []
@@ -104,6 +104,7 @@ files:
104
104
  - ".gitignore"
105
105
  - ".rspec"
106
106
  - ".rubocop.yml"
107
+ - ".travis.yml"
107
108
  - CHANGELOG.md
108
109
  - CODE_OF_CONDUCT.md
109
110
  - Gemfile
@@ -123,11 +124,11 @@ files:
123
124
  - lib/business_pipeline/process.rb
124
125
  - lib/business_pipeline/step.rb
125
126
  - lib/business_pipeline/version.rb
126
- homepage:
127
+ homepage:
127
128
  licenses:
128
129
  - MIT
129
130
  metadata: {}
130
- post_install_message:
131
+ post_install_message:
131
132
  rdoc_options: []
132
133
  require_paths:
133
134
  - lib
@@ -142,9 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  - !ruby/object:Gem::Version
143
144
  version: '0'
144
145
  requirements: []
145
- rubyforge_project:
146
- rubygems_version: 2.7.6
147
- signing_key:
146
+ rubygems_version: 3.2.22
147
+ signing_key:
148
148
  specification_version: 4
149
149
  summary: A new business pipeline architecture for Rails applications
150
150
  test_files: []