resulting 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3da1dbc393fe607cb6285fb6e0a3c5fb2c932bd7e50e7312ef17e7896232a85b
4
+ data.tar.gz: 87eb2836ec966a6db44d0aa16a8aa4ae46a838e07cd65ba963f5e63249fa22c0
5
+ SHA512:
6
+ metadata.gz: 581c7a452f0bda593ea2659dcf9bae700e4d1695057cc93d9224119f5c14b682c1c8fd10117b7833a52413468714cfcd5ecf90815f26d94c8f6326f56fab86e2
7
+ data.tar.gz: 86bcf54897b14ea11ccc04082c7b58dece2f7fd09ece466dd2d74fb748d8f4f9a7f788cf465a2046e03fd397267c3592fb4b561db8e00bc346e6f267b133fbca
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /vendor/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --color
2
+ --format documentation
3
+ --order random
4
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,90 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+
5
+ AllCops:
6
+ DisplayCopNames: true
7
+ Exclude:
8
+ - bin/*
9
+ - vendor/**/*
10
+ - Gemfile.lock
11
+
12
+ Layout/CommentIndentation:
13
+ Enabled: false
14
+
15
+ Layout/MultilineMethodCallIndentation:
16
+ Enabled: false
17
+
18
+ Layout/LineLength:
19
+ Max: 100
20
+ Exclude:
21
+ - Rakefile
22
+
23
+ Lint/RaiseException:
24
+ Enabled: true
25
+
26
+ Lint/StructNewOverride:
27
+ Enabled: true
28
+
29
+ Metrics/AbcSize:
30
+ Enabled: false
31
+
32
+ Metrics/BlockLength:
33
+ Enabled: false
34
+
35
+ Metrics/ClassLength:
36
+ Enabled: false
37
+
38
+ Metrics/CyclomaticComplexity:
39
+ Enabled: false
40
+
41
+ Metrics/MethodLength:
42
+ Enabled: false
43
+
44
+ Performance/TimesMap:
45
+ Enabled: false
46
+
47
+ RSpec/ExampleLength:
48
+ Enabled: false
49
+
50
+ RSpec/MessageSpies:
51
+ EnforcedStyle: receive
52
+
53
+ RSpec/MultipleExpectations:
54
+ Enabled: false
55
+
56
+ RSpec/NotToNot:
57
+ EnforcedStyle: to_not
58
+
59
+ Style/Documentation:
60
+ Enabled: false
61
+
62
+ Style/ExpandPathArguments:
63
+ Enabled: false
64
+
65
+ Style/FrozenStringLiteralComment:
66
+ Enabled: false
67
+
68
+ Style/HashEachMethods:
69
+ Enabled: true
70
+
71
+ Style/HashTransformKeys:
72
+ Enabled: true
73
+
74
+ Style/HashTransformValues:
75
+ Enabled: true
76
+
77
+ Style/NegatedIf:
78
+ Enabled: false
79
+
80
+ Style/StringLiterals:
81
+ EnforcedStyle: double_quotes
82
+
83
+ Style/TrailingCommaInArguments:
84
+ EnforcedStyleForMultiline: comma
85
+
86
+ Style/TrailingCommaInArrayLiteral:
87
+ EnforcedStyleForMultiline: comma
88
+
89
+ Style/TrailingCommaInHashLiteral:
90
+ EnforcedStyleForMultiline: comma
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.7.0
6
+ before_install: gem install bundler -v 2.1.4
data/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ # 2020-04-14
2
+ Initial commit and release.
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in resulting.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,68 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ resulting (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.0)
10
+ byebug (11.1.1)
11
+ coderay (1.1.2)
12
+ diff-lcs (1.3)
13
+ jaro_winkler (1.5.4)
14
+ method_source (1.0.0)
15
+ parallel (1.19.1)
16
+ parser (2.7.1.0)
17
+ ast (~> 2.4.0)
18
+ pry (0.13.1)
19
+ coderay (~> 1.1)
20
+ method_source (~> 1.0)
21
+ pry-byebug (3.9.0)
22
+ byebug (~> 11.0)
23
+ pry (~> 0.13.0)
24
+ rainbow (3.0.0)
25
+ rake (12.3.3)
26
+ rexml (3.2.4)
27
+ rspec (3.9.0)
28
+ rspec-core (~> 3.9.0)
29
+ rspec-expectations (~> 3.9.0)
30
+ rspec-mocks (~> 3.9.0)
31
+ rspec-core (3.9.1)
32
+ rspec-support (~> 3.9.1)
33
+ rspec-expectations (3.9.1)
34
+ diff-lcs (>= 1.2.0, < 2.0)
35
+ rspec-support (~> 3.9.0)
36
+ rspec-mocks (3.9.1)
37
+ diff-lcs (>= 1.2.0, < 2.0)
38
+ rspec-support (~> 3.9.0)
39
+ rspec-support (3.9.2)
40
+ rubocop (0.81.0)
41
+ jaro_winkler (~> 1.5.1)
42
+ parallel (~> 1.10)
43
+ parser (>= 2.7.0.1)
44
+ rainbow (>= 2.2.2, < 4.0)
45
+ rexml
46
+ ruby-progressbar (~> 1.7)
47
+ unicode-display_width (>= 1.4.0, < 2.0)
48
+ rubocop-performance (1.5.2)
49
+ rubocop (>= 0.71.0)
50
+ rubocop-rspec (1.38.1)
51
+ rubocop (>= 0.68.1)
52
+ ruby-progressbar (1.10.1)
53
+ unicode-display_width (1.7.0)
54
+
55
+ PLATFORMS
56
+ ruby
57
+
58
+ DEPENDENCIES
59
+ pry-byebug
60
+ rake (~> 12.0)
61
+ resulting!
62
+ rspec (~> 3.0)
63
+ rubocop
64
+ rubocop-performance
65
+ rubocop-rspec
66
+
67
+ BUNDLED WITH
68
+ 2.1.4
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 John DeWyze
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # Resulting
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be
4
+ able to package up your Ruby library into a gem. Put your Ruby code in the file
5
+ `lib/resulting`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ TODO: Delete this and the text above, and describe your gem
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'resulting'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle install
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install resulting
24
+
25
+ ## Usage
26
+
27
+ TODO: Write usage instructions here
28
+
29
+ ## Development
30
+
31
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
32
+
33
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
34
+
35
+ ## Contributing
36
+
37
+ Bug reports and pull requests are welcome on GitHub at
38
+ https://github.com/[USERNAME]/resulting.
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+ require "rubocop/rake_task"
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ desc "Rubocop changed"
8
+ task :rubocop_changed do
9
+ puts "Running rubocop on changed files..."
10
+ system("bundle exec rubocop --force-exclusion -a $(git diff HEAD --name-only --diff-filter=MA & git ls-files --other --exclude-standard | sort | uniq)")
11
+ end
12
+
13
+ task default: %w[spec rubocop_changed]
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "resulting"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/rake ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rake' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rake", "rake")
data/bin/rubocop ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rubocop' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rubocop", "rubocop")
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,3 @@
1
+ module Resulting
2
+ VERSION = "0.0.1".freeze
3
+ end
data/lib/resulting.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "resulting/version"
2
+
3
+ module Resulting
4
+ class Error < StandardError; end
5
+ # Your code goes here...
6
+ end
data/resulting.gemspec ADDED
@@ -0,0 +1,40 @@
1
+ require_relative "lib/resulting/version"
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "resulting"
5
+ spec.version = Resulting::VERSION
6
+ spec.authors = ["John DeWyze"]
7
+ spec.email = ["john@dewyze.dev"]
8
+
9
+ spec.summary = "Library for result handling and graceful saving"
10
+ spec.description = <<~DESCRIPTION
11
+ Resulting is a library for graceful result handling. It provides a result
12
+ class with a few methods that can be used as a mixin. Using these results,
13
+ they can be passed to save and validation services which handle them
14
+ gracefully, returning early when there is a failure, or ensuring success
15
+ for all objects before returning success.
16
+ DESCRIPTION
17
+ spec.homepage = "https://github.com/dewyze/resulting"
18
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
19
+
20
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
+
22
+ spec.metadata["homepage_uri"] = spec.homepage
23
+ spec.metadata["source_code_uri"] = "https://github.com/dewyze/resulting"
24
+ spec.metadata["changelog_uri"] = "https://github.com/dewyze/resulting/CHANGELOG.md"
25
+
26
+ # Specify which files should be added to the gem when it is released.
27
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
28
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
29
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
30
+ end
31
+ spec.bindir = "exe"
32
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
+ spec.require_paths = ["lib"]
34
+
35
+ spec.add_development_dependency "pry-byebug"
36
+ spec.add_development_dependency "rspec"
37
+ spec.add_development_dependency "rubocop"
38
+ spec.add_development_dependency "rubocop-performance"
39
+ spec.add_development_dependency "rubocop-rspec"
40
+ end
metadata ADDED
@@ -0,0 +1,138 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: resulting
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - John DeWyze
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-04-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry-byebug
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-performance
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: |
84
+ Resulting is a library for graceful result handling. It provides a result
85
+ class with a few methods that can be used as a mixin. Using these results,
86
+ they can be passed to save and validation services which handle them
87
+ gracefully, returning early when there is a failure, or ensuring success
88
+ for all objects before returning success.
89
+ email:
90
+ - john@dewyze.dev
91
+ executables: []
92
+ extensions: []
93
+ extra_rdoc_files: []
94
+ files:
95
+ - ".gitignore"
96
+ - ".rspec"
97
+ - ".rubocop.yml"
98
+ - ".travis.yml"
99
+ - CHANGELOG.md
100
+ - Gemfile
101
+ - Gemfile.lock
102
+ - LICENSE
103
+ - README.md
104
+ - Rakefile
105
+ - bin/console
106
+ - bin/rake
107
+ - bin/rubocop
108
+ - bin/setup
109
+ - lib/resulting.rb
110
+ - lib/resulting/version.rb
111
+ - resulting.gemspec
112
+ homepage: https://github.com/dewyze/resulting
113
+ licenses: []
114
+ metadata:
115
+ allowed_push_host: https://rubygems.org
116
+ homepage_uri: https://github.com/dewyze/resulting
117
+ source_code_uri: https://github.com/dewyze/resulting
118
+ changelog_uri: https://github.com/dewyze/resulting/CHANGELOG.md
119
+ post_install_message:
120
+ rdoc_options: []
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: 2.5.0
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ requirements: []
134
+ rubygems_version: 3.1.2
135
+ signing_key:
136
+ specification_version: 4
137
+ summary: Library for result handling and graceful saving
138
+ test_files: []