sea_food 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e1fadef17caded8e4d217abcf4cacb11a668661557b90945daec7c6248c3016d
4
+ data.tar.gz: 07ba588fb09dd2488095aff9149840decba53751351929195ce21fc490257756
5
+ SHA512:
6
+ metadata.gz: 43027c029c2c6b39625303d3ec828b5327c9231864902aef30cbde651229bb03b897b6bec31912c06e97234b3e8a8b9a944d80d75a3f15df185245322dcd72d9
7
+ data.tar.gz: 4a4a56b87d4c8944da926dc59c26ed634ca398fd1127af54cb9df7141def7520f456b577c50f3e78268722fd82ba4c92ddd47ef5840bcfcd0ba946c16f5f0491
data/.gitignore ADDED
@@ -0,0 +1,11 @@
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
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,105 @@
1
+ Layout/BlockAlignment:
2
+ # Rubocop had a bug in ruby3.1 and this is a workaround to fix it.
3
+ # 1.22.3 and above are fixed, but must be 1.2 or lower for ruby 2.4 support
4
+ Enabled: false
5
+
6
+ Layout/LineLength:
7
+ Max: 100
8
+ # To make it possible to copy or click on URIs in the code, we allow lines
9
+ # containing a URI to be longer than Max.
10
+ AllowURI: true
11
+ URISchemes:
12
+ - http
13
+ - https
14
+
15
+ Layout/SpaceBeforeFirstArg:
16
+ Exclude:
17
+
18
+ Lint/AmbiguousBlockAssociation:
19
+ Exclude:
20
+ - spec/**/*
21
+
22
+ Lint/RescueException:
23
+ Exclude:
24
+
25
+ Lint/UnreachableCode:
26
+ Exclude:
27
+ - 'spec/sea_food/service/service_spec.rb'
28
+
29
+ Lint/UselessAssignment:
30
+ Exclude:
31
+ - 'lib/sea_food/service.rb'
32
+
33
+ Metrics/AbcSize:
34
+ # The ABC size is a calculated magnitude, so this number can be an Integer or
35
+ # a Float.
36
+ Max: 15
37
+
38
+ Metrics/BlockLength:
39
+ CountComments: false # count full line comments?
40
+ Max: 25
41
+ Exclude:
42
+ - 'sea_food.gemspec'
43
+ - config/**/*
44
+ - spec/**/*
45
+ ExcludedMethods:
46
+ - class_methods
47
+
48
+ Metrics/BlockNesting:
49
+ Max: 4
50
+
51
+ Metrics/ClassLength:
52
+ CountComments: false # count full line comments?
53
+ Max: 200
54
+
55
+ # Avoid complex methods.
56
+ Metrics/CyclomaticComplexity:
57
+ Max: 7
58
+
59
+ Metrics/MethodLength:
60
+ CountComments: false # count full line comments?
61
+ Max: 24
62
+
63
+ Metrics/ModuleLength:
64
+ CountComments: false # count full line comments?
65
+ Max: 200
66
+
67
+ Metrics/ParameterLists:
68
+ Max: 5
69
+ CountKeywordArgs: true
70
+
71
+ Metrics/PerceivedComplexity:
72
+ Max: 12
73
+
74
+ Style/Documentation:
75
+ Enabled: false
76
+
77
+ Style/FrozenStringLiteralComment:
78
+ Enabled: false
79
+
80
+ Style/HashEachMethods:
81
+ Enabled: true
82
+
83
+ Style/HashTransformKeys:
84
+ Enabled: true
85
+
86
+ Style/HashTransformValues:
87
+ Enabled: true
88
+
89
+ Style/ModuleFunction:
90
+ Enabled: false
91
+
92
+ Style/RescueModifier:
93
+ Exclude:
94
+ - spec/**/*
95
+
96
+ Style/MissingRespondToMissing:
97
+ Exclude:
98
+ - 'lib/sea_food/service.rb'
99
+
100
+ Style/MethodMissingSuper:
101
+ Exclude:
102
+ - 'lib/sea_food/service.rb'
103
+
104
+ Naming/PredicateName:
105
+ Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.2
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.10
7
+ before_install: gem install bundler -v 1.17.2
@@ -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 federico.aldunatec@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,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in sea_food.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,96 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sea_food (0.1.0)
5
+ activemodel (>= 5.2)
6
+ activesupport (>= 5.2)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activemodel (6.1.7.8)
12
+ activesupport (= 6.1.7.8)
13
+ activerecord (6.1.7.8)
14
+ activemodel (= 6.1.7.8)
15
+ activesupport (= 6.1.7.8)
16
+ activesupport (6.1.7.8)
17
+ concurrent-ruby (~> 1.0, >= 1.0.2)
18
+ i18n (>= 1.6, < 2)
19
+ minitest (>= 5.1)
20
+ tzinfo (~> 2.0)
21
+ zeitwerk (~> 2.3)
22
+ ast (2.4.2)
23
+ concurrent-ruby (1.3.4)
24
+ database_cleaner-active_record (2.2.0)
25
+ activerecord (>= 5.a)
26
+ database_cleaner-core (~> 2.0.0)
27
+ database_cleaner-core (2.0.1)
28
+ debug (1.8.0)
29
+ irb (>= 1.5.0)
30
+ reline (>= 0.3.1)
31
+ diff-lcs (1.5.1)
32
+ i18n (1.14.5)
33
+ concurrent-ruby (~> 1.0)
34
+ io-console (0.7.2)
35
+ irb (1.6.3)
36
+ reline (>= 0.3.0)
37
+ jaro_winkler (1.5.6)
38
+ mini_portile2 (2.8.7)
39
+ minitest (5.24.1)
40
+ parallel (1.24.0)
41
+ parser (3.3.4.2)
42
+ ast (~> 2.4.1)
43
+ racc
44
+ racc (1.8.1)
45
+ rainbow (3.1.1)
46
+ rake (10.5.0)
47
+ reline (0.5.9)
48
+ io-console (~> 0.5)
49
+ rexml (3.3.5)
50
+ strscan
51
+ rspec (3.13.0)
52
+ rspec-core (~> 3.13.0)
53
+ rspec-expectations (~> 3.13.0)
54
+ rspec-mocks (~> 3.13.0)
55
+ rspec-core (3.13.0)
56
+ rspec-support (~> 3.13.0)
57
+ rspec-expectations (3.13.1)
58
+ diff-lcs (>= 1.2.0, < 2.0)
59
+ rspec-support (~> 3.13.0)
60
+ rspec-mocks (3.13.1)
61
+ diff-lcs (>= 1.2.0, < 2.0)
62
+ rspec-support (~> 3.13.0)
63
+ rspec-support (3.13.1)
64
+ rubocop (0.80.1)
65
+ jaro_winkler (~> 1.5.1)
66
+ parallel (~> 1.10)
67
+ parser (>= 2.7.0.1)
68
+ rainbow (>= 2.2.2, < 4.0)
69
+ rexml
70
+ ruby-progressbar (~> 1.7)
71
+ unicode-display_width (>= 1.4.0, < 1.7)
72
+ ruby-progressbar (1.13.0)
73
+ sqlite3 (1.5.4)
74
+ mini_portile2 (~> 2.8.0)
75
+ strscan (3.1.0)
76
+ tzinfo (2.0.6)
77
+ concurrent-ruby (~> 1.0)
78
+ unicode-display_width (1.6.1)
79
+ zeitwerk (2.6.17)
80
+
81
+ PLATFORMS
82
+ ruby
83
+
84
+ DEPENDENCIES
85
+ activerecord (>= 5.2)
86
+ bundler (~> 2.0)
87
+ database_cleaner-active_record (~> 2.2.0)
88
+ debug
89
+ rake (~> 10.0)
90
+ rspec (~> 3.0)
91
+ rubocop (~> 0.80.0)
92
+ sea_food!
93
+ sqlite3 (~> 1.5.0)
94
+
95
+ BUNDLED WITH
96
+ 2.1.4
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Federico
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # SeaFood
2
+
3
+ The sea_food gem is a Ruby library designed to enhance the development of service and form objects in Ruby applications. Representing SErvice Objects And Form Object Design patterns, this gem facilitates the separation of business logic and data validations from ActiveRecord models.
4
+ P.S. Jian Yang would be proud; Erlich Bachman, not so much.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'sea_food'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install sea_food
21
+
22
+ ## Usage
23
+
24
+ TODO: Write usage instructions here
25
+
26
+ ## Development
27
+
28
+ 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.
29
+
30
+ 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).
31
+
32
+ ## Contributing
33
+
34
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/sea_food. 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.
35
+
36
+ ## License
37
+
38
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
39
+
40
+ ## Code of Conduct
41
+
42
+ Everyone interacting in the SeaFood project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/sea_food/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'sea_food'
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/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,19 @@
1
+ module SeaFood
2
+ class Configuration
3
+ attr_accessor :enforce_interface
4
+
5
+ def initialize
6
+ @enforce_interface = false # Default value
7
+ end
8
+ end
9
+
10
+ # Method to access the configuration
11
+ def self.configuration
12
+ @configuration ||= Configuration.new
13
+ end
14
+
15
+ # Method to configure the gem
16
+ def self.configure
17
+ yield(configuration) if block_given?
18
+ end
19
+ end
@@ -0,0 +1,10 @@
1
+ module SeaFood
2
+ class Error < StandardError
3
+ attr_reader :result
4
+
5
+ def initialize(message, params = {})
6
+ @result = params[:result]
7
+ super(message)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,29 @@
1
+ module SeaFood
2
+ class Form
3
+ include ::ActiveModel::Model
4
+
5
+ def validate(options = {})
6
+ valid? && validate_model(options)
7
+ end
8
+
9
+ def save(options = {})
10
+ model.save(options) if valid?
11
+ end
12
+
13
+ def save!(options = {})
14
+ model.save!(options) if valid?
15
+ end
16
+
17
+ private
18
+
19
+ attr_accessor :model
20
+
21
+ def validate_model
22
+ promote_errors(model) if model.invalid?
23
+ end
24
+
25
+ def promote_errors(model)
26
+ SeaFood::Error.new(model.errors.full_message, model.errors)
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,127 @@
1
+ # SeaFood::Service class serves as a base for creating services.
2
+ # It standardizes the way services are called.
3
+ module SeaFood
4
+ class Service
5
+ attr_reader :params, :result
6
+
7
+ # Initializes the service.
8
+ # @param params [Hash] The parameters to be passed to the service.
9
+ def initialize(params = {})
10
+ if SeaFood.configuration.enforce_interface
11
+ raise NotImplementedError,
12
+ 'Subclasses must implement the initialize method ' \
13
+ 'because `enforce_interface` is set to true'
14
+ end
15
+ @params = params
16
+ @result = ServiceResult.new
17
+ end
18
+
19
+ class << self
20
+ # Calls the service and handles any exceptions.
21
+ # @param args [Hash] Arguments to pass to the service.
22
+ # @return [ServiceResult] The result of the service call.
23
+ def call(params = {})
24
+ service = new(params)
25
+ service.call
26
+ service.result || ServiceResult.new
27
+ rescue ServiceError => e
28
+ service.result
29
+ end
30
+ end
31
+
32
+ # The main method to be implemented by subclasses.
33
+ def call
34
+ raise NotImplementedError, 'Subclasses must implement the call method'
35
+ end
36
+
37
+ protected
38
+
39
+ # Marks the service as failed.
40
+ # @param data [Any] Optional data to be returned in the result.
41
+ def fail(errors = nil)
42
+ @result = ServiceResult.new(success: false, errors: errors)
43
+ end
44
+
45
+ # Marks the service as successful.
46
+ # @param data [Any] Optional data to be returned in the result.
47
+ def success(data = nil)
48
+ @result = ServiceResult.new(success: true, data: data)
49
+ end
50
+
51
+ # Marks the service as failed and stop the execution of the service.
52
+ # @param errors [Any] Errors to be returned in the result.
53
+ def fail!(errors = nil)
54
+ @result = ServiceResult.new(success: false, errors: errors)
55
+ raise ServiceError, @result
56
+ end
57
+
58
+ # Validates the service using form objects.
59
+ # @param [ { key: form [ActiveModel::Model] }] The form objects to validate.
60
+ def validate_with(key, form)
61
+ fail({ key => form.errors.messages }) unless form.valid?
62
+ end
63
+
64
+ # Validates the service using form objects.
65
+ # @param [ { key: form [ActiveModel::Model] }] The form objects to validate.
66
+ def validate_with!(key, form)
67
+ fail!({ key => form.errors.messages }) unless form.valid?
68
+ end
69
+
70
+ def validate_pipeline(pipeline)
71
+ pipeline.each do |key, form|
72
+ fail_and_merge({ key => form.errors.messages }) unless form.valid?
73
+ end
74
+ fail!(@result.errors) if @result.failed?
75
+ end
76
+
77
+ class ServiceResult
78
+ attr_reader :success, :data, :errors
79
+
80
+ # Initializes the ServiceResult.
81
+ # @param success [Boolean] Indicates if the service call was successful.
82
+ # @param data [Any] The data returned by the service.
83
+ def initialize(success: true, data: nil, errors: nil)
84
+ @success = success
85
+ @data = (data || {}).with_indifferent_access
86
+ @errors = (errors.to_h || {}).with_indifferent_access
87
+ end
88
+
89
+ # Checks if the service call was successful.
90
+ # @return [Boolean] True if successful, false otherwise.
91
+ def succeeded?
92
+ success
93
+ end
94
+
95
+ alias success? succeeded?
96
+
97
+ # Checks if the service call failed.
98
+ # @return [Boolean] True if failed, false otherwise.
99
+ def failed?
100
+ !success
101
+ end
102
+
103
+ alias fail? failed?
104
+
105
+ # :rubocop:disable Style/MissingRespondToMissing
106
+ def method_missing(key)
107
+ if succeeded?
108
+ @data[key]
109
+ else
110
+ @errors[key]
111
+ end
112
+ end
113
+ end
114
+
115
+ class ServiceError < StandardError; end
116
+
117
+ private
118
+
119
+ def fail_and_merge(errors)
120
+ @result = if @result.blank?
121
+ ServiceResult.new(success: false, errors: errors)
122
+ else
123
+ ServiceResult.new(success: false, errors: errors.merge!(@result.errors))
124
+ end
125
+ end
126
+ end
127
+ end
@@ -0,0 +1,3 @@
1
+ module SeaFood
2
+ VERSION = '0.1.0'.freeze
3
+ end
data/lib/sea_food.rb ADDED
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_model'
4
+ require 'sea_food/version'
5
+ require 'sea_food/configuration'
6
+
7
+ # Namespace for all objects in SeaFood
8
+ module SeaFood
9
+ autoload :Error, 'sea_food/error'
10
+ autoload :Form, 'sea_food/form'
11
+ autoload :Service, 'sea_food/service'
12
+
13
+ # Yields SeaFood::Configuration instance.
14
+ def configure
15
+ yield configuration if block_given?
16
+ end
17
+
18
+ # Public: Returns SeaFood::Configuration instance.
19
+ def configuration
20
+ @configuration ||= Configuration.new
21
+ end
22
+
23
+ # Public: Sets SeaFood::Configuration instance.
24
+ def configuration=(configuration)
25
+ # need to reset SeaFood instance if configuration changes
26
+ self.instance = nil
27
+ @configuration = configuration
28
+ end
29
+ end
data/sea_food.gemspec ADDED
@@ -0,0 +1,48 @@
1
+ lib = File.expand_path('lib', __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'sea_food/version'
4
+
5
+ # :rubocop:disable
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'sea_food'
8
+ spec.version = SeaFood::VERSION
9
+ spec.authors = ['Federico Aldunate']
10
+ spec.email = ['federico.aldunatec@gmail.com']
11
+
12
+ spec.summary = 'A Ruby gem for seamlessly integrating form and service object patterns.'
13
+ spec.homepage = 'https://github.com/eagerworks/sea_food'
14
+ spec.license = 'MIT'
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ if spec.respond_to?(:metadata)
19
+ spec.metadata['homepage_uri'] = spec.homepage
20
+ spec.metadata['source_code_uri'] = 'https://github.com/eagerworks/sea_food/'
21
+ spec.metadata['changelog_uri'] = 'https://github.com/eagerworks/sea_food/releases'
22
+ spec.metadata['bug_tracker_uri'] = 'https://github.com/eagerworks/sea_food/issues'
23
+ else
24
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
25
+ 'public gem pushes.'
26
+ end
27
+
28
+ # Specify which files should be added to the gem when it is released.
29
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
31
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
+ end
33
+ spec.bindir = 'exe'
34
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
+ spec.require_paths = ['lib']
36
+
37
+ spec.add_dependency 'activemodel', '>= 5.2'
38
+ spec.add_dependency 'activesupport', '>= 5.2'
39
+
40
+ spec.add_development_dependency 'activerecord', '>= 5.2'
41
+ spec.add_development_dependency 'bundler', '~> 2.0'
42
+ spec.add_development_dependency 'database_cleaner-active_record', '~> 2.2.0'
43
+ spec.add_development_dependency 'debug'
44
+ spec.add_development_dependency 'rake', '~> 10.0'
45
+ spec.add_development_dependency 'rspec', '~> 3.0'
46
+ spec.add_development_dependency 'rubocop', '~> 0.80.0'
47
+ spec.add_development_dependency 'sqlite3', '~> 1.5.0'
48
+ end
metadata ADDED
@@ -0,0 +1,207 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sea_food
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Federico Aldunate
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-10-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activemodel
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '5.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '5.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '5.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '5.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: activerecord
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '5.2'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '5.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: database_cleaner-active_record
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 2.2.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 2.2.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: debug
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '10.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '10.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '3.0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '3.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.80.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.80.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: sqlite3
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 1.5.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 1.5.0
153
+ description:
154
+ email:
155
+ - federico.aldunatec@gmail.com
156
+ executables: []
157
+ extensions: []
158
+ extra_rdoc_files: []
159
+ files:
160
+ - ".gitignore"
161
+ - ".rspec"
162
+ - ".rubocop.yml"
163
+ - ".ruby-version"
164
+ - ".travis.yml"
165
+ - CODE_OF_CONDUCT.md
166
+ - Gemfile
167
+ - Gemfile.lock
168
+ - LICENSE.txt
169
+ - README.md
170
+ - Rakefile
171
+ - bin/console
172
+ - bin/setup
173
+ - lib/sea_food.rb
174
+ - lib/sea_food/configuration.rb
175
+ - lib/sea_food/error.rb
176
+ - lib/sea_food/form.rb
177
+ - lib/sea_food/service.rb
178
+ - lib/sea_food/version.rb
179
+ - sea_food.gemspec
180
+ homepage: https://github.com/eagerworks/sea_food
181
+ licenses:
182
+ - MIT
183
+ metadata:
184
+ homepage_uri: https://github.com/eagerworks/sea_food
185
+ source_code_uri: https://github.com/eagerworks/sea_food/
186
+ changelog_uri: https://github.com/eagerworks/sea_food/releases
187
+ bug_tracker_uri: https://github.com/eagerworks/sea_food/issues
188
+ post_install_message:
189
+ rdoc_options: []
190
+ require_paths:
191
+ - lib
192
+ required_ruby_version: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: '0'
197
+ required_rubygems_version: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ requirements: []
203
+ rubygems_version: 3.1.4
204
+ signing_key:
205
+ specification_version: 4
206
+ summary: A Ruby gem for seamlessly integrating form and service object patterns.
207
+ test_files: []