lite-commands 1.0.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: 9952df6f6c22e9cbdaea749ace14c516a4fdbe10a317c930940b810ab575a3e9
4
+ data.tar.gz: 10ef372dc0d547329ea0f05dd0f0f0e04dba9eed3536728600b28ab0d457e1c9
5
+ SHA512:
6
+ metadata.gz: 847f62bfadd9aa8256a8d31e7d42d111d6055a793b33c471e314f0330cfcd73cef3d44318dda2dd1e047182931bf65429e9765b498b60a8481c816055de4bc40
7
+ data.tar.gz: 181b2d0b438ed2665a9b404e8f3b36c58b67319be693a2bd63fa1fb4d7ee6d9ce6fb0f4b987b0ed7c68133b9f0dc27a6aa0b3028ab8a8301abed8a04025596a1
data/.fasterer.yml ADDED
@@ -0,0 +1,19 @@
1
+ speedups:
2
+ block_vs_symbol_to_proc: true
3
+ each_with_index_vs_while: false
4
+ fetch_with_argument_vs_block: true
5
+ for_loop_vs_each: true
6
+ getter_vs_attr_reader: true
7
+ gsub_vs_tr: true
8
+ hash_merge_bang_vs_hash_brackets: true
9
+ keys_each_vs_each_key: true
10
+ map_flatten_vs_flat_map: true
11
+ module_eval: true
12
+ proc_call_vs_yield: true
13
+ rescue_vs_respond_to: true
14
+ reverse_each_vs_reverse_each: true
15
+ select_first_vs_detect: true
16
+ select_last_vs_reverse_detect: true
17
+ setter_vs_attr_writer: true
18
+ shuffle_first_vs_sample: true
19
+ sort_vs_sort_by: true
data/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
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,4 @@
1
+ --backtrace
2
+ --color
3
+ --format progress
4
+ --order random
data/.rubocop.yml ADDED
@@ -0,0 +1,24 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+ AllCops:
5
+ TargetRubyVersion: 2.6
6
+ DisplayCopNames: true
7
+ DisplayStyleGuide: true
8
+ LineLength:
9
+ Max: 100
10
+ Layout/EmptyLinesAroundBlockBody:
11
+ Exclude:
12
+ - 'spec/**/**/*'
13
+ Layout/EmptyLinesAroundClassBody:
14
+ EnforcedStyle: empty_lines_except_namespace
15
+ Layout/EmptyLinesAroundModuleBody:
16
+ EnforcedStyle: empty_lines_except_namespace
17
+ Metrics/BlockLength:
18
+ Exclude:
19
+ - 'spec/**/**/*'
20
+ - '*.gemspec'
21
+ Style/Documentation:
22
+ Enabled: false
23
+ Style/ExpandPathArguments:
24
+ Enabled: false
data/.travis.yml ADDED
@@ -0,0 +1,24 @@
1
+ sudo: false
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.5
6
+ - 2.6
7
+ - ruby-head
8
+ matrix:
9
+ fast_finish: true
10
+ allow_failures:
11
+ - rvm: ruby-head
12
+ before_install:
13
+ - gem update --system
14
+ - gem install bundler
15
+ install:
16
+ - bundle install --jobs=3 --retry=3
17
+ script:
18
+ - bundle exec rspec
19
+ - bundle exec rubocop
20
+ - bundle exec fasterer
21
+ notifications:
22
+ email: false
23
+ slack:
24
+ secure: GGLBlk2ILEkNtXY/qiWoSlow8HYz1+RG+1OgXyI5pySDmmlsDfFijGOtoz/tcdcdANiTyzMNb0pBQRaYFjbNld7YQ6DttRbTdAnd2TIRxaQ2+2ttZ+kHpHMGG+9lKiDvoy3+4j7KLH4H/j/Ls6NrNAl0NfY87ZAVA+WjcRBCPKelyAYlWQy8Lj/b+8aMtlWF4YSft6A96Y8YK64uWPadHJI6d7W3pNF7L3S+N+PjMqEgryb0L8IXuobV6bA+rbGNqT14ytku3nDTN2d2WMLms6hsaA53h+LAgAniIOBYuFWrjJXZ2My7Tcba7sk2oIoqi7cePFUUQ+lZD1PvFEiCQCO5aIekVWrbUepWW5DobCENOBsv7gwxV4sJqzo3JLXufj+ia5U+VFpVPYkBPStrCqK2Yy/VGFwzkyjXf5qV3HXpDaMA5z1As0PvWtcegYZMTh4BfYaz8BBmFPdYAgOQHkMPgldttETgWb8xd4etBdK3ZUvlMBi+opBsjHDu5s2kf6og0Pf2/YBKRBZmUAch/+c+HCCBiK7RdXs4NsAeXEld2/fWW9+JgOumQ9DyiQBqmXgTSdRNnoxvlLTTDPBgjzimFh2qDNQycgbQRPpIcqe4f1p6Oe3lm96lguwai22enU2iXmBa0hfd80f/l7iQIshwxLAam/ovUq2TFIuERac=
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [1.0.0] - 2019-07-18
10
+ ### Added
11
+ - Initial project version
@@ -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 j.gomez@drexed.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
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in lite-commands.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,69 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ lite-commands (1.0.0)
5
+ lite-errors
6
+ lite-memoize
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ast (2.4.0)
12
+ colorize (0.8.1)
13
+ diff-lcs (1.3)
14
+ fasterer (0.5.1)
15
+ colorize (~> 0.7)
16
+ ruby_parser (>= 3.13.0)
17
+ jaro_winkler (1.5.3)
18
+ lite-errors (1.0.1)
19
+ lite-memoize (1.0.0)
20
+ parallel (1.17.0)
21
+ parser (2.6.3.0)
22
+ ast (~> 2.4.0)
23
+ rainbow (3.0.0)
24
+ rake (12.3.2)
25
+ rspec (3.8.0)
26
+ rspec-core (~> 3.8.0)
27
+ rspec-expectations (~> 3.8.0)
28
+ rspec-mocks (~> 3.8.0)
29
+ rspec-core (3.8.1)
30
+ rspec-support (~> 3.8.0)
31
+ rspec-expectations (3.8.4)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.8.0)
34
+ rspec-mocks (3.8.1)
35
+ diff-lcs (>= 1.2.0, < 2.0)
36
+ rspec-support (~> 3.8.0)
37
+ rspec-support (3.8.2)
38
+ rubocop (0.71.0)
39
+ jaro_winkler (~> 1.5.1)
40
+ parallel (~> 1.10)
41
+ parser (>= 2.6)
42
+ rainbow (>= 2.2.2, < 4.0)
43
+ ruby-progressbar (~> 1.7)
44
+ unicode-display_width (>= 1.4.0, < 1.7)
45
+ rubocop-performance (1.4.0)
46
+ rubocop (>= 0.71.0)
47
+ rubocop-rspec (1.33.0)
48
+ rubocop (>= 0.60.0)
49
+ ruby-progressbar (1.10.1)
50
+ ruby_parser (3.13.1)
51
+ sexp_processor (~> 4.9)
52
+ sexp_processor (4.12.1)
53
+ unicode-display_width (1.6.0)
54
+
55
+ PLATFORMS
56
+ ruby
57
+
58
+ DEPENDENCIES
59
+ bundler
60
+ fasterer
61
+ lite-commands!
62
+ rake
63
+ rspec
64
+ rubocop
65
+ rubocop-performance
66
+ rubocop-rspec
67
+
68
+ BUNDLED WITH
69
+ 2.0.1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Juan Gomez
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,184 @@
1
+ # Lite::Commands
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/lite-commands.svg)](http://badge.fury.io/rb/lite-commands)
4
+ [![Build Status](https://travis-ci.org/drexed/lite-commands.svg?branch=master)](https://travis-ci.org/drexed/lite-commands)
5
+
6
+ Lite::Commands provides an API for building command based service objects.
7
+ It provides mixins for handling errors and memoization to improve your
8
+ object workflow productivity.
9
+
10
+ ## Installation
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ ```ruby
15
+ gem 'lite-commands'
16
+ ```
17
+
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Or install it yourself as:
23
+
24
+ $ gem install lite-commands
25
+
26
+ ## Table of Contents
27
+
28
+ * [Setup](#setup)
29
+ * [Base](#base)
30
+ * [Errors](#errors)
31
+ * [Memoize](#memoize)
32
+
33
+ ## Setup
34
+
35
+ Setting up the command based object is very easy using a very simple API for setting up and
36
+ executing commands.
37
+
38
+ ```ruby
39
+ class SearchMovies < Lite::Commands::Base
40
+
41
+ def initialize(name)
42
+ @name = name
43
+ end
44
+
45
+ # NOTE: This method is required
46
+ def command
47
+ { generate_fingerprint => movies_by_name }
48
+ end
49
+
50
+ private
51
+
52
+ def movies_by_name
53
+ HTTP.get("http://movies.com?title=#{title}")
54
+ end
55
+
56
+ def generate_fingerprint
57
+ Digest::MD5.hexdigest(movies_by_name)
58
+ end
59
+
60
+ end
61
+ ```
62
+
63
+ **Caller**
64
+
65
+ ```ruby
66
+ commands = SearchMovies.new('Toy Story')
67
+ commands.called? #=> false
68
+ commands.call #=> { 'fingerprint_1' => [ 'Toy Story 1', ... ] }
69
+ commands.called? #=> true
70
+
71
+ # - or -
72
+
73
+ commands = SearchMovies.call('Toy Story')
74
+ commands.called? #=> true
75
+ commands.call #=> { 'fingerprint_1' => [ 'Toy Story 1', ... ] }
76
+
77
+ # - or -
78
+
79
+ # Useful when you are not using the Errors mixin as its a one time access call.
80
+ SearchMovies.run('Toy Story') #=> { 'fingerprint_1' => [ 'Toy Story 1', ... ] }
81
+ ```
82
+
83
+ **Result**
84
+
85
+ ```ruby
86
+ commands = SearchMovies.new('Toy Story')
87
+ commands.result #=> nil
88
+
89
+ commands.call #=> { 'fingerprint_1' => [ 'Toy Story 1', ... ] }
90
+ commands.result #=> { 'fingerprint_1' => [ 'Toy Story 1', ... ] }
91
+
92
+ commands.recall! #=> Clears the call, cache, errors, and then re-performs the call
93
+ commands.result #=> { 'fingerprint_2' => [ 'Toy Story 2', ... ] }
94
+ ```
95
+
96
+ ## Errors (optional)
97
+
98
+ Learn more about using [Lite::Errors](https://github.com/drexed/lite-errors)
99
+
100
+ ```ruby
101
+ class SearchMovies < Lite::Commands::Base
102
+ include Lite::Commands::Errors
103
+
104
+ # ... ommited ...
105
+
106
+ private
107
+
108
+ # Add a fingerprint error to the error pool
109
+ def generate_fingerprint
110
+ Digest::MD5.hexdigest(movies_by_name)
111
+ rescue
112
+ errors.add(:fingerprint, 'invalid md5 request value')
113
+ end
114
+
115
+ end
116
+ ```
117
+
118
+ **Methods**
119
+
120
+ ```ruby
121
+ commands = SearchMovies.call('Toy Story')
122
+ commands.errors #=> Lite::Errors::Messages object
123
+
124
+ commands.validate! #=> Raises Lite::Commands::ValidationError if it has any errors
125
+ commands.valid? #=> Alias for validate!
126
+
127
+ commands.errored? #=> false
128
+ commands.success? #=> true
129
+ commands.failure? #=> Checks that it has been called and has errors
130
+
131
+ commands.result! #=> Raises Lite::Commands::ValidationError if it has any errors, if not it returns the result
132
+ ```
133
+
134
+ ## Memoize (optional)
135
+
136
+ Learn more about using [Lite::Memoize](https://github.com/drexed/lite-memoize)
137
+
138
+ ```ruby
139
+ class SearchMovies < Lite::Commands::Base
140
+ include Lite::Commands::Memoize
141
+
142
+ # ... ommited ...
143
+
144
+ private
145
+
146
+ # Sets the value in the cache
147
+ # Subsequent method calls gets the cached value
148
+ # This saves you the extra external HTTP.get call
149
+ def movies_by_name
150
+ cache.memoize { HTTP.get("http://movies.com?title=#{title}") }
151
+ end
152
+
153
+ # Gets the value in the cache
154
+ def generate_fingerprint
155
+ Digest::MD5.hexdigest(movies_by_name)
156
+ end
157
+
158
+ end
159
+ ```
160
+
161
+ **Methods**
162
+
163
+ ```ruby
164
+ commands = SearchMovies.call('Toy Story')
165
+ commands.cache #=> Lite::Memoize::Instance object
166
+ ```
167
+
168
+ ## Development
169
+
170
+ 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.
171
+
172
+ 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).
173
+
174
+ ## Contributing
175
+
176
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lite-commands. 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.
177
+
178
+ ## License
179
+
180
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
181
+
182
+ ## Code of Conduct
183
+
184
+ Everyone interacting in the Lite::Commands project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lite-commands/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
data/_config.yml ADDED
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-leap-day
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'lite/commands'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ 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,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lite
4
+ module Commands
5
+ class Base
6
+
7
+ class << self
8
+
9
+ def call(*args)
10
+ klass = new(*args)
11
+ klass.call
12
+ klass
13
+ end
14
+
15
+ def run(*args)
16
+ klass = new(*args)
17
+ klass.call
18
+ end
19
+
20
+ end
21
+
22
+ attr_reader :result
23
+
24
+ def initialize(*args)
25
+ @args = args
26
+ end
27
+
28
+ def call
29
+ raise Lite::Commands::NotImplementedError unless defined?(command)
30
+ return @result if called?
31
+
32
+ @called = true
33
+ @result = command
34
+ end
35
+
36
+ def called?
37
+ @called ||= false
38
+ end
39
+
40
+ def recall!
41
+ @called = false
42
+ %i[cache errors].each { |mixin| send(mixin).clear if respond_to?(mixin) }
43
+ call
44
+ end
45
+
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lite/errors'
4
+
5
+ module Lite
6
+ module Commands
7
+ module Errors
8
+
9
+ def errors
10
+ @errors ||= Lite::Errors::Messages.new
11
+ end
12
+
13
+ def errored?
14
+ !errors.empty?
15
+ end
16
+
17
+ def fail!
18
+ raise Lite::Commands::ValidationError
19
+ end
20
+
21
+ def failure?
22
+ called? && errored?
23
+ end
24
+
25
+ def result!
26
+ result if valid?
27
+ end
28
+
29
+ def success?
30
+ called? && !errored?
31
+ end
32
+
33
+ def validate!
34
+ return true if success?
35
+
36
+ fail!
37
+ end
38
+
39
+ alias valid? validate!
40
+
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lite
4
+ module Commands
5
+
6
+ class NotImplementedError < StandardError; end
7
+ class ValidationError < StandardError; end
8
+
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lite/memoize'
4
+
5
+ module Lite
6
+ module Commands
7
+ module Memoize
8
+
9
+ def cache
10
+ @cache ||= Lite::Memoize::Instance.new
11
+ end
12
+
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lite
4
+ module Commands
5
+
6
+ VERSION ||= '1.0.0'
7
+
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ %w[version exception errors memoize base].each do |name|
4
+ require "lite/commands/#{name}"
5
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'lite/commands/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'lite-commands'
9
+ spec.version = Lite::Commands::VERSION
10
+ spec.authors = ['Juan Gomez']
11
+ spec.email = %w[j.gomez@drexed.com]
12
+
13
+ spec.summary = 'Ruby Commands based framework (aka service objects)'
14
+ spec.homepage = 'http://drexed.github.io/lite-commands'
15
+ spec.license = 'MIT'
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata.merge(
21
+ 'allowed_push_host' => 'https://rubygems.org',
22
+ 'changelog_uri' => 'https://github.com/drexed/lite-commands/blob/master/CHANGELOG.md',
23
+ 'homepage_uri' => spec.homepage,
24
+ 'source_code_uri' => 'https://github.com/drexed/lite-commands'
25
+ )
26
+ else
27
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
28
+ 'public gem pushes.'
29
+ end
30
+
31
+ # Specify which files should be added to the gem when it is released.
32
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
33
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
34
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
35
+ end
36
+ spec.bindir = 'exe'
37
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
38
+ spec.require_paths = %w[lib]
39
+
40
+ spec.add_dependency 'lite-errors'
41
+ spec.add_dependency 'lite-memoize'
42
+
43
+ spec.add_development_dependency 'bundler'
44
+ spec.add_development_dependency 'fasterer'
45
+ spec.add_development_dependency 'rake'
46
+ spec.add_development_dependency 'rspec'
47
+ spec.add_development_dependency 'rubocop'
48
+ spec.add_development_dependency 'rubocop-performance'
49
+ spec.add_development_dependency 'rubocop-rspec'
50
+ end
metadata ADDED
@@ -0,0 +1,192 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lite-commands
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Juan Gomez
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-07-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: lite-errors
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
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: lite-memoize
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
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: bundler
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: fasterer
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: rake
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
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
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: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-performance
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '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'
139
+ description:
140
+ email:
141
+ - j.gomez@drexed.com
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - ".fasterer.yml"
147
+ - ".gitattributes"
148
+ - ".gitignore"
149
+ - ".rspec"
150
+ - ".rubocop.yml"
151
+ - ".travis.yml"
152
+ - CHANGELOG.md
153
+ - CODE_OF_CONDUCT.md
154
+ - Gemfile
155
+ - Gemfile.lock
156
+ - LICENSE.txt
157
+ - README.md
158
+ - Rakefile
159
+ - _config.yml
160
+ - bin/console
161
+ - bin/setup
162
+ - lib/lite/commands.rb
163
+ - lib/lite/commands/base.rb
164
+ - lib/lite/commands/errors.rb
165
+ - lib/lite/commands/exception.rb
166
+ - lib/lite/commands/memoize.rb
167
+ - lib/lite/commands/version.rb
168
+ - lite-commands.gemspec
169
+ homepage: http://drexed.github.io/lite-commands
170
+ licenses:
171
+ - MIT
172
+ metadata: {}
173
+ post_install_message:
174
+ rdoc_options: []
175
+ require_paths:
176
+ - lib
177
+ required_ruby_version: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ required_rubygems_version: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ requirements: []
188
+ rubygems_version: 3.0.4
189
+ signing_key:
190
+ specification_version: 4
191
+ summary: Ruby Commands based framework (aka service objects)
192
+ test_files: []