leash 0.2.1 → 0.2.2

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: 70dfef3206b5f17287ffec1c8914523fac664d527dc48422cf17abe6d14ddb7d
4
- data.tar.gz: 15b4d012fbfe5a78d07f9479a0ba5b2d51975a13c650d902d7d00d632b4f7c66
3
+ metadata.gz: 23d644149171f515659cf6fd3fd2064c604a728f8a12e26827f5aff426b09bdb
4
+ data.tar.gz: 74c824993b871142f333e756183617faa0db57dd3a1fa73c66c5caea4e13bf45
5
5
  SHA512:
6
- metadata.gz: 8bf0c864c2a75813c7b4b4e890edc8eab3c84ca81fe3ea9423d9953818d33e499c5324c81fd0eaadb1ec867fc0843019aaee30e0e35f01bceb6bbf585e146c88
7
- data.tar.gz: a4c6005a18dd629fb89e0668648218181cc15180a0662f94d7436bdff31dcd63b2a89b641f534ed6e77d649c99e04e38123a09d7e8776bc8e768d814383406f9
6
+ metadata.gz: 7ab8f0f2e5b613a76e152ed374e16b0af2bbffa6635e5ea51bd11a0762f713961dd13e5bb5e2c8369ca4d5b35c409c9b1af33d5e26d1a48b2361709ff9732e29
7
+ data.tar.gz: 3f2b562575ad4737989dff02c8dc35d47f0411d1bfe488579ce7d7fcf7c72a793f8b437d7beb526c1a3d6b8e094a23bdf98f01ab779a25e059af2610661eb72c
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.3.1
@@ -0,0 +1,5 @@
1
+ {
2
+ "files.associations": {
3
+ "*.gemfile": "ruby"
4
+ }
5
+ }
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Leash
2
2
 
3
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/TonyCTHsu/leash/test.yml?style=for-the-badge&logo=github)
4
+ ![Gem Version](https://img.shields.io/gem/v/leash?style=for-the-badge&logo=rubygems&logoColor=orange&color=orange)
5
+
3
6
  `Leash` provides a lightweight framework to implement "Do Nothing Scripting" with Ruby.
4
7
 
5
8
  A "do nothing script" is a script that encodes instructions of a manual procedure and encapsulating each step in a function. Making it easier to start small and gradually increase the level of automation.
@@ -60,7 +63,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
60
63
 
61
64
  ## Contributing
62
65
 
63
- Bug reports and pull requests are welcome on GitHub at https://github.com/TonyCTHsu/leash. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/TonyCTHsu/leash/blob/master/CODE_OF_CONDUCT.md).
66
+ Bug reports and pull requests are welcome on GitHub at https://github.com/TonyCTHsu/leash. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](docs/CODE_OF_CONDUCT.md).
64
67
 
65
68
  ## License
66
69
 
@@ -68,4 +71,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
68
71
 
69
72
  ## Code of Conduct
70
73
 
71
- Everyone interacting in the Leash project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/TonyCTHsu/leash/blob/master/CODE_OF_CONDUCT.md).
74
+ Everyone interacting in the Leash project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](docs/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,10 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
3
+ # load rake tasks from tasks directory
4
+ Dir.glob(File.join(__dir__ || Dir.pwd, "tasks", "**", "*.rake")) { |f| import f }
5
5
 
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require "standard/rake"
9
-
10
- task default: %i[standard spec]
6
+ task default: %i[spec]
data/Steepfile ADDED
@@ -0,0 +1,27 @@
1
+ D = Steep::Diagnostic
2
+
3
+ target :lib do
4
+ signature "sig"
5
+
6
+ check "lib" # Directory name
7
+ # ignore "lib/templates/*.rb"
8
+
9
+ # library "pathname" # Standard libraries
10
+ # library "strong_json" # Gems
11
+
12
+ # configure_code_diagnostics(D::Ruby.default) # `default` diagnostics setting (applies by default)
13
+ # configure_code_diagnostics(D::Ruby.strict) # `strict` diagnostics setting
14
+ # configure_code_diagnostics(D::Ruby.lenient) # `lenient` diagnostics setting
15
+ # configure_code_diagnostics(D::Ruby.silent) # `silent` diagnostics setting
16
+ # configure_code_diagnostics do |hash| # You can setup everything yourself
17
+ # hash[D::Ruby::NoMethod] = :information
18
+ # end
19
+ end
20
+
21
+ # target :test do
22
+ # signature "sig", "sig-private"
23
+ #
24
+ # check "test"
25
+ #
26
+ # # library "pathname" # Standard libraries
27
+ # end
data/docs/CODEOWNERS ADDED
@@ -0,0 +1 @@
1
+ * @TonyCTHsu
@@ -0,0 +1,25 @@
1
+ # How to contribute
2
+
3
+ I'm really glad you're reading this, because we need volunteer developers to help this project come to fruition.
4
+
5
+ ## Testing
6
+
7
+ Most of our testbed consists of RSpec examples. Please write RSpec examples for new code you create.
8
+
9
+ ## Submitting changes
10
+
11
+ Please send a [Pull Request](https://github.com/TonyCTHsu/leash/pull/new/master) with a clear list of what you've done. When you send a pull request, we will love you forever if you include RSpec examples. We can always use more test coverage.
12
+
13
+ Always write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should look like this:
14
+
15
+ $ git commit -m "A brief summary of the commit
16
+ >
17
+ > A paragraph describing what changed and its impact."
18
+
19
+ ## Coding conventions
20
+
21
+ Start reading our code and you'll get the hang of it. To avoid bikeshedding, we use `standard` for linting. Run `bundle exec standardrb` and everything be fine.
22
+
23
+ This is open source software. Consider the people who will read your code, and make it look nice for them. It's sort of like driving a car: Perhaps you love doing donuts when you're alone, but with passengers the goal is to make the ride as smooth as possible.
24
+
25
+ Thanks
data/docs/SECURITY.md ADDED
@@ -0,0 +1,7 @@
1
+ # Reporting Security Issues
2
+
3
+ The team and community take security bugs seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
4
+
5
+ To report a security issue, please use the GitHub Security Advisory ["New draft security advisory"](https://github.com/TonyCTHsu/leash/security/advisories/new) button.
6
+
7
+ The team will send a response indicating the next steps in handling your report. After the initial reply to your report, the team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec path: ".."
6
+
7
+ gem "rake", "~> 13.0"
8
+
9
+ group :test do
10
+ gem "rspec", "~> 3.0", require: false
11
+ gem "datadog-ci", "~> 1.0.0.beta5", require: false
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec path: ".."
6
+
7
+ gem "rake", "~> 13.0"
8
+
9
+ group :test do
10
+ gem "rspec", "~> 3.0", require: false
11
+ gem "datadog-ci", "~> 1.0.0.beta5", require: false
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec path: ".."
6
+
7
+ gem "rake", "~> 13.0"
8
+
9
+ group :test do
10
+ gem "rspec", "~> 3.0", require: false
11
+ gem "datadog-ci", "~> 1.0.0.beta5", require: false
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec path: ".."
6
+
7
+ gem "rake", "~> 13.0"
8
+
9
+ group :test do
10
+ gem "rspec", "~> 3.0", require: false
11
+ gem "datadog-ci", "~> 1.0.0.beta5", require: false
12
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec path: ".."
6
+
7
+ gem "rake", "~> 13.0"
8
+
9
+ group :test do
10
+ gem "rspec", "~> 3.0", require: false
11
+ gem "datadog-ci", "~> 1.0.0.beta5", require: false
12
+ end
13
+
14
+ group :check do
15
+ gem "standard", "~> 1.0", require: false
16
+ gem "steep", "~> 1.6", require: false
17
+ end
data/lib/leash/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leash
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
@@ -0,0 +1,25 @@
1
+ module Leash
2
+ class Procedure
3
+ @title: String
4
+
5
+ @options: Hash[untyped, untyped]
6
+
7
+ @steps: Array[Step]
8
+
9
+ attr_reader title: String
10
+
11
+ attr_reader options: Hash[untyped, untyped]
12
+
13
+ attr_reader steps: Array[Step]
14
+
15
+ def initialize: (String title, ?Hash[untyped, untyped] options) ?{ (self)[self: self] -> void } -> void
16
+
17
+ def step: (String description, ?untyped? action) { () -> untyped } -> untyped
18
+
19
+ def run: () -> void
20
+
21
+ def render: () -> String
22
+
23
+ def length: () -> Integer
24
+ end
25
+ end
@@ -0,0 +1,15 @@
1
+ module Leash
2
+ class Step
3
+ @description: String
4
+
5
+ @action: untyped
6
+
7
+ attr_reader description: String
8
+
9
+ attr_reader action: untyped
10
+
11
+ def initialize: (description: String, action: untyped) -> void
12
+
13
+ def run: () -> void
14
+ end
15
+ end
data/sig/leash.rbs CHANGED
@@ -1,4 +1,7 @@
1
1
  module Leash
2
2
  VERSION: String
3
3
  # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+
5
+ class Error < StandardError
6
+ end
4
7
  end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
data/tasks/rspec.rake ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rspec/core/rake_task"
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require "standard/rake"
5
+ rescue LoadError
6
+ warn "'standard' gem not loaded: skipping tasks..."
7
+ return
8
+ end
data/tmp/.keep ADDED
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Hsu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-06 00:00:00.000000000 Z
11
+ date: 2024-05-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  Leash provides a lightweight framework to implement "Do Nothing Scripting" with Ruby.
@@ -22,18 +22,34 @@ extensions: []
22
22
  extra_rdoc_files: []
23
23
  files:
24
24
  - ".rspec"
25
+ - ".ruby-version"
25
26
  - ".standard.yml"
27
+ - ".vscode/settings.json"
26
28
  - CHANGELOG.md
27
- - CODE_OF_CONDUCT.md
28
29
  - LICENSE
29
- - LICENSE.txt
30
30
  - README.md
31
31
  - Rakefile
32
+ - Steepfile
33
+ - docs/CODEOWNERS
34
+ - docs/CODE_OF_CONDUCT.md
35
+ - docs/CONTRIBUTING.md
36
+ - docs/SECURITY.md
37
+ - gemfiles/ruby-2.7.gemfile
38
+ - gemfiles/ruby-3.0.gemfile
39
+ - gemfiles/ruby-3.1.gemfile
40
+ - gemfiles/ruby-3.2.gemfile
41
+ - gemfiles/ruby-3.3.gemfile
32
42
  - lib/leash.rb
33
43
  - lib/leash/procedure.rb
34
44
  - lib/leash/step.rb
35
45
  - lib/leash/version.rb
36
46
  - sig/leash.rbs
47
+ - sig/leash/procedure.rbs
48
+ - sig/leash/step.rbs
49
+ - tasks/bundler.rake
50
+ - tasks/rspec.rake
51
+ - tasks/standard.rake
52
+ - tmp/.keep
37
53
  homepage: https://github.com/TonyCTHsu/leash
38
54
  licenses:
39
55
  - MIT
@@ -56,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
72
  - !ruby/object:Gem::Version
57
73
  version: '0'
58
74
  requirements: []
59
- rubygems_version: 3.4.19
75
+ rubygems_version: 3.5.9
60
76
  signing_key:
61
77
  specification_version: 4
62
78
  summary: Do Nothing Scripting with Ruby
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 Tony Hsu
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.
File without changes