process_chain 0.1.0 → 0.2.0

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
  SHA1:
3
- metadata.gz: bc609b40693758b3ae7c341f8204f49d14a7335a
4
- data.tar.gz: a57d992dd7747b0a10713a0218586e85d4f700d7
3
+ metadata.gz: 930db88dff70eb643cf8f446a35c917e1fa62cf6
4
+ data.tar.gz: 5d684897a3d3221f614e0cd4c896a6f3c719de42
5
5
  SHA512:
6
- metadata.gz: 2e6f4f2d3dde7b83e9329dfc4885eca6d383b0c4bf11f0aa602230c1d285886cfaad9dbf2edd6ba31cf6b8606c8a546f1a5c1ce53ed5847f95aa1665583f0f08
7
- data.tar.gz: 6c228cbb851a1e99c94968a7862d9a6d0400195a1a11063a077386a57667d24f59dd24d05256ae6fb169e245f8ce2a9132fd99133b7b4c773e8c33242bbddc7b
6
+ metadata.gz: 5a81fd64ebdc1660431fab8d3a26208a2ce5ac151a1debbfcd93c8a0f7046245c56f2ff4fabd970999fe8efd4b70968544ae6c81efef9832ae1dd96bc16157f4
7
+ data.tar.gz: ad73c8e57a89ecdd5060ca29cc637ec4fc1830bf1a911f5e6ac0deba67b560cf13f5516fd9116c39ed8eb6c84dee919ad67117a6343267b62343daa9b42816c0
@@ -0,0 +1 @@
1
+ service_name: travis-ci
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ /coverage
data/Gemfile CHANGED
@@ -7,6 +7,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
7
7
  # Specify your gem's dependencies in process_chain.gemspec
8
8
  gemspec
9
9
 
10
+
10
11
  group :development, :test do
11
12
  gem 'bundler'
12
13
  gem 'rake'
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- process_chain (0.1.0)
5
- hashie (~> 3.5)
4
+ process_chain (0.2.0)
6
5
 
7
6
  GEM
8
7
  remote: https://rubygems.org/
@@ -16,7 +15,6 @@ GEM
16
15
  tins (~> 1.6)
17
16
  diff-lcs (1.3)
18
17
  docile (1.3.1)
19
- hashie (3.5.6)
20
18
  json (2.1.0)
21
19
  parallel (1.12.1)
22
20
  parser (2.5.1.0)
data/README.md CHANGED
@@ -1,4 +1,8 @@
1
1
  # ProcessChain
2
+ [![Build Status](https://travis-ci.org/max-konin/process_chain.svg?branch=master)](https://travis-ci.org/max-konin/process_chain)
3
+ [![Coverage Status](https://coveralls.io/repos/github/max-konin/process_chain/badge.svg?branch=master)](https://coveralls.io/github/max-konin/process_chain?branch=master)
4
+ [![Inline docs](http://inch-ci.org/github/max-konin/process_chain.svg?branch=master)](http://inch-ci.org/github/max-konin/process_chain)
5
+
2
6
 
3
7
  ProcessChain gives you a simple way to using the Railsway oriented programming pattern. And allows you to write code in a more functional style.
4
8
 
@@ -27,14 +31,14 @@ class UpdateUserProcess
27
31
 
28
32
  def assignee_attributes(attrs)
29
33
  if_success do
30
- return_success user: results.user.assigne_attributes(attrs)
34
+ return_success user: results[:user].assigne_attributes(attrs)
31
35
  end
32
36
  end
33
37
 
34
38
  def validate_user
35
39
  if_success do
36
40
  if results.user.valid?
37
- return_fail errors: results.user.errors, user: results.user
41
+ return_fail errors: results[:user].errors, user: results.user
38
42
  else
39
43
  return_success
40
44
  end
@@ -42,12 +46,12 @@ class UpdateUserProcess
42
46
  end
43
47
 
44
48
  def save_user
45
- user = results.user
49
+ user = results[:user]
46
50
  if_success do
47
51
  if user.save
48
52
  return_success user: user
49
53
  else
50
- return_fail user: results.user
54
+ return_fail user: user
51
55
  end
52
56
  end
53
57
  end
@@ -60,9 +64,9 @@ def create
60
64
  .validate_user
61
65
  .save_user
62
66
  if process.success?
63
- render status: :ok, json: process.results.user
67
+ render status: :ok, json: process.results[:user]
64
68
  else
65
- render status: :bad_request, json: process.results.errors
69
+ render status: :bad_request, json: process.results[:errors]
66
70
  end
67
71
  end
68
72
  ```
@@ -75,7 +79,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
75
79
 
76
80
  ## Contributing
77
81
 
78
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/process_chain. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
82
+ Bug reports and pull requests are welcome on GitHub at https://github.com/max-konin/process_chain. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
79
83
 
80
84
  ## License
81
85
 
@@ -83,4 +87,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
83
87
 
84
88
  ## Code of Conduct
85
89
 
86
- Everyone interacting in the ProcessChain project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/process_chain/blob/master/CODE_OF_CONDUCT.md).
90
+ Everyone interacting in the ProcessChain project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/max-konin/process_chain/blob/master/CODE_OF_CONDUCT.md).
@@ -2,8 +2,6 @@
2
2
 
3
3
  require 'process_chain/version'
4
4
 
5
- require 'hashie'
6
-
7
5
  # Base module for process chains
8
6
  module ProcessChain
9
7
  # :nodoc:
@@ -25,7 +23,7 @@ module ProcessChain
25
23
  def initialize(input: {}, success: true)
26
24
  raise ArgumentError, '"input" should be a Hash' unless input.is_a? Hash
27
25
  @success = success
28
- @results = Hashie::Mash.new input
26
+ @results = input
29
27
  end
30
28
 
31
29
  # @return [true false]
@@ -2,5 +2,5 @@
2
2
 
3
3
  module ProcessChain
4
4
  # :nodoc:
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
@@ -26,6 +26,4 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'bundler', '~> 1.16'
27
27
  spec.add_development_dependency 'rake', '~> 10.0'
28
28
  spec.add_development_dependency 'rspec', '~> 3.0'
29
-
30
- spec.add_dependency 'hashie', '~> 3.5'
31
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: process_chain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Konin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-10 00:00:00.000000000 Z
11
+ date: 2018-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
- - !ruby/object:Gem::Dependency
56
- name: hashie
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '3.5'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '3.5'
69
55
  description: Simple railway programming implementation for Ruby. To allow describe
70
56
  business logic in Elixir style
71
57
  email:
@@ -74,6 +60,7 @@ executables: []
74
60
  extensions: []
75
61
  extra_rdoc_files: []
76
62
  files:
63
+ - ".coveralls.yml"
77
64
  - ".gitignore"
78
65
  - ".rspec"
79
66
  - ".rubocop.yml"