mu-result 1.0.0 → 1.1.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
  SHA256:
3
- metadata.gz: 66c2f073332bdb1c48fdb2f64230c8f4d6f00b4f7131ae12b2d88fede4409aa8
4
- data.tar.gz: 90f6420883ca8d40ed5cc8f0b1d006d27f8b88e441e927dce4c2261923448a3c
3
+ metadata.gz: ec6059760dd74a847a598f17b84dee0ad3028a2c5c6e7afd5b8bf5a8815c0922
4
+ data.tar.gz: fde0c2077ce8690b98bba79c9b8a9654c11f3db221a7220807c8840e9b9a9140
5
5
  SHA512:
6
- metadata.gz: 9d56cc528a0e37f3c96487e679b6276649738069005b2495b78740257116d2ecef1720417c2b0dc8b324e6dd3ddf88121d4a3fe7940507ffceb0e81497ed957d
7
- data.tar.gz: b74a9e5440305dc532cb0b265d3a9d93c8ff79fcac940e1c52c9b40c1fa16ba445312da9306e41c8aca6ff5e97f040e7e9e740095d253525d59a29b2ab7b8039
6
+ metadata.gz: e7976d5f7fa13447ce500aa913327a02440cf3590e2e01543e6c7362d096cf91beeca8693cfc9bad11bd6dc892c35279865d8ebf25fd06b808202b2bdd9f058c
7
+ data.tar.gz: eeb98d41c5add154fe3abe0878f0ea0417f842498e1d9904c1582e31e168f81baeec4b6e745466fd9d1e7f9d424268ec08ab5c5f98661982b844bc3c9a8d3ee3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mu-result (1.0.0)
4
+ mu-result (1.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -32,4 +32,4 @@ DEPENDENCIES
32
32
  rspec (~> 3.0)
33
33
 
34
34
  BUNDLED WITH
35
- 1.16.6
35
+ 1.17.3
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Mu::Result
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/mu-result.svg)](https://badge.fury.io/rb/mu-result)
4
+
3
5
  This is a really tiny implementation of the Result object.
4
6
 
5
7
  ## Installation
@@ -40,8 +42,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
40
42
 
41
43
  ## Contributing
42
44
 
43
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/mu-result. 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.
45
+ Bug reports and pull requests are welcome at https://source.olisti.co/olistik/mu-result. 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.
44
46
 
45
47
  ## Code of Conduct
46
48
 
47
- Everyone interacting in the Mu::Result project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/mu-result/blob/master/CODE_OF_CONDUCT.md).
49
+ Everyone interacting in the Mu::Result project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://source.olisti.co/olistik/mu-result/blob/master/CODE_OF_CONDUCT.md).
@@ -1,34 +1,8 @@
1
1
  require 'mu/result/version'
2
+ require 'mu/result/base_result'
2
3
 
3
4
  module Mu
4
5
  module Result
5
- class BaseResult
6
- def initialize(code: :ok, data: nil)
7
- @code = code
8
- @data = data
9
- end
10
-
11
- def code!(value)
12
- @code = value
13
- self
14
- end
15
-
16
- def code
17
- @code
18
- end
19
-
20
- def data
21
- @data
22
- end
23
-
24
- def success?
25
- @code == :ok
26
- end
27
-
28
- def error?
29
- !success?
30
- end
31
- end
32
6
 
33
7
  def self.success(data = nil)
34
8
  BaseResult.new(code: :ok, data: data)
@@ -37,5 +11,6 @@ module Mu
37
11
  def self.error(data = nil)
38
12
  BaseResult.new(code: :ko, data: data)
39
13
  end
14
+
40
15
  end
41
16
  end
@@ -0,0 +1,33 @@
1
+ module Mu
2
+ module Result
3
+
4
+ class BaseResult
5
+ def initialize(code: :ok, data: nil)
6
+ @code = code
7
+ @data = data
8
+ end
9
+
10
+ def code!(value)
11
+ @code = value
12
+ self
13
+ end
14
+
15
+ def code
16
+ @code
17
+ end
18
+
19
+ def data
20
+ @data
21
+ end
22
+
23
+ def success?
24
+ @code == :ok
25
+ end
26
+
27
+ def error?
28
+ !success?
29
+ end
30
+ end
31
+
32
+ end
33
+ end
@@ -1,5 +1,5 @@
1
1
  module Mu
2
2
  module Result
3
- VERSION = '1.0.0'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mu-result
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - olistik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-09 00:00:00.000000000 Z
11
+ date: 2020-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,6 +70,7 @@ files:
70
70
  - bin/console
71
71
  - bin/setup
72
72
  - lib/mu/result.rb
73
+ - lib/mu/result/base_result.rb
73
74
  - lib/mu/result/version.rb
74
75
  - mu-result.gemspec
75
76
  homepage: https://source.olisti.co/olistik/mu-result
@@ -91,8 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
92
  - !ruby/object:Gem::Version
92
93
  version: '0'
93
94
  requirements: []
94
- rubyforge_project:
95
- rubygems_version: 2.7.8
95
+ rubygems_version: 3.0.6
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: μResult is a small Result object