cristiano 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: 904f672eb06fd9cbc52b9c7319033a7b0cde527e13b15212768d2896d8ca8b99
4
+ data.tar.gz: 602efaf95c5410153fe499c7fc72c762c034455e3c5441cfbe63b8081cd7fc69
5
+ SHA512:
6
+ metadata.gz: 2f059c86723476068fcaac0d9382f543d3e714535b3aa60592b76df5b7f284e6494e7eff102fbd26d400fe388ad2f8565e2ef436c7dc3d1426172741c82c8132
7
+ data.tar.gz: d31ba8d3f4003b596e64b611b46d424ea489524af4a97350e1fab98bdaa1fa0dff163d6cf95754f46b81d829e6f21951e5c5b1c8631d5d6c1a37d590fb72a753
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --format=documentation
3
+ --require=spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,37 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rake
4
+ - rubocop-rspec
5
+
6
+ inherit_gem:
7
+ syntax_tree: config/rubocop.yml
8
+
9
+ AllCops:
10
+ NewCops: enable
11
+ TargetRubyVersion: 3.1
12
+
13
+ Gemspec/RequireMFA:
14
+ Enabled: false
15
+
16
+ Layout/LineLength:
17
+ Max: 120
18
+
19
+ Lint/StructNewOverride:
20
+ Enabled: false
21
+
22
+ Metrics/MethodLength:
23
+ Enabled: false
24
+
25
+ Style/Documentation:
26
+ Enabled: false
27
+
28
+ Style/ModuleFunction:
29
+ Enabled: false
30
+
31
+ Style/StringLiterals:
32
+ Enabled: true
33
+ EnforcedStyle: double_quotes
34
+
35
+ Style/StringLiteralsInInterpolation:
36
+ Enabled: true
37
+ EnforcedStyle: double_quotes
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-3.2.2
data/.streerc ADDED
@@ -0,0 +1,4 @@
1
+ --ignore-files='Gemfile'
2
+ --ignore-files='vendor/bundle/**/*'
3
+ --print-width=120
4
+ --plugins=plugin/trailing_comma
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at ikhurramraza@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Khurram Raza
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,23 @@
1
+ # Cristiano
2
+
3
+ Outputs ASCII art to celebrate the G.O.A.T. 🐐
4
+
5
+ ## 💿 Installation
6
+
7
+ ```bash
8
+ gem install cristiano
9
+ ```
10
+
11
+ ## 🚀 Publishing
12
+
13
+ 1. Bump the version in `lib/cristiano/version.rb` file in a PR.
14
+
15
+ 2. Create and push tag to GitHub.
16
+
17
+ ```bash
18
+ git tag --sing -a "v[VERSION_TAG]" -m "[VERSION_TAG]"
19
+
20
+ git push origin "v[VERSION_TAG]"
21
+ ```
22
+
23
+ 3. Wait for Release GitHub action to complete.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
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
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/exe/cristiano ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require "cristiano"
6
+
7
+ Cristiano::CLI.run(ARGV)
data/lefthook.yml ADDED
@@ -0,0 +1,17 @@
1
+ skip_output:
2
+ - meta
3
+ - summary
4
+ - success
5
+ - execution
6
+
7
+ pre-commit:
8
+ parallel: true
9
+ commands:
10
+ rspec:
11
+ run: bundle exec rspec
12
+ rubocop:
13
+ files: git ls-files **/*.rb
14
+ run: bundle exec rubocop --fail-fast {files}
15
+ stree:
16
+ files: git ls-files **/*.rb
17
+ run: bundle exec stree check {files}
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cristiano
4
+ ART = <<~TEXT
5
+ ⣴⣿⣦⠀⠀⠀⠀⠀⠀⠀⠀
6
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⠂⠀⠀⠀⠀⠀⠀⠀⠀
7
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣀⠀⠀⠀⠀⠀⠀⠀⠀
8
+ ⠀⠀⠀⠀⠀⠀⠀⢠⣾⣿⣿⣿⣿⣿⣿⣦⠀
9
+ ⠀⠀⠀⠀⠀⠀⣴⣿⢿⣷⠒⠲⣾⣾⣿⣿
10
+ ⠀⠀⠀⠀⣴⣿⠟⠁⠀⢿⣿⠁⣿⣿⣿⠻⣿⣄⠀⠀⠀⠀
11
+ ⠀⠀⣠⡾⠟⠁⠀⠀⠀⢸⣿⣸⣿⣿⣿⣆⠙⢿⣷⡀⠀⠀
12
+ ⣰⡿⠋⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⠀⠀⠉⠻⣿⡀
13
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣆⠂⠀
14
+ ⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⡿⣿⣿⣿⣿⡄⠀⠀⠀⠀
15
+ ⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⠿⠟⠀⠀⠻⣿⣿⡇⠀⠀⠀⠀
16
+ ⠀⠀⠀⠀⠀⠀⢀⣾⡿⠃⠀⠀⠀⠀⠀⠘⢿⣿⡀⠀⠀⠀
17
+ ⠀⠀⠀⠀⠀⣰⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣷⡀⠀⠀
18
+ ⠀⠀⠀⠀⢠⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⣿⣧⠀⠀
19
+ ⠀⠀⠀⢀⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣆⠀
20
+ ⠀⠀⠠⢾⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣷⡤⠄
21
+ TEXT
22
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cristiano
4
+ module CLI
5
+ Options =
6
+ Struct.new(:count, :help, :version) do
7
+ def self.default = new(count: 1, help: false, version: false)
8
+ def self.from(args) = default.tap { |options| Parser.parse(args, into: options) }
9
+
10
+ def help? = help
11
+ def version? = version
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cristiano
4
+ module CLI
5
+ Parser =
6
+ OptionParser.new do |opts|
7
+ opts.banner = "USAGE: #{PROGRAM_NAME} [OPTIONS]"
8
+ opts.separator ""
9
+
10
+ opts.version = "#{PROGRAM_NAME} #{VERSION}"
11
+
12
+ opts.separator "OPTIONS:"
13
+ opts.on("-n", "--count COUNT", Integer, "Number of times the art should be printed")
14
+ opts.on("-v", "--version", "Show the version")
15
+ opts.on("-h", "--help", "Show this help message")
16
+ opts.separator ""
17
+
18
+ opts.separator "EXAMPLES:"
19
+ opts.separator " #{PROGRAM_NAME}"
20
+ opts.separator " #{PROGRAM_NAME} -n10"
21
+ opts.separator " #{PROGRAM_NAME} -count=10"
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cristiano
4
+ module CLI
5
+ class Runner
6
+ def initialize(args)
7
+ @args = args
8
+ @options = Options.from(args)
9
+ end
10
+
11
+ def call
12
+ case options
13
+ in help: true
14
+ Parser.help.display
15
+ in version: true
16
+ Parser.version.display
17
+ else
18
+ options.count.times { ART.display }
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ attr_reader :options, :args
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cristiano
4
+ module CLI
5
+ PROGRAM_NAME = "cristiano"
6
+
7
+ def self.run(args)
8
+ Runner.new(args).call
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cristiano
4
+ VERSION = "1.0.0"
5
+ end
data/lib/cristiano.rb ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ autoload(:OptionParser, "optparse")
4
+
5
+ module Cristiano
6
+ autoload(:ART, "cristiano/art")
7
+ autoload(:CLI, "cristiano/cli")
8
+ autoload(:VERSION, "cristiano/version")
9
+
10
+ module CLI
11
+ autoload(:Parser, "cristiano/cli/parser")
12
+ autoload(:Runner, "cristiano/cli/runner")
13
+ autoload(:Options, "cristiano/cli/options")
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cristiano
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Khurram Raza
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-11-11 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: CLI tool to celebrate the G.O.A.T.
14
+ email:
15
+ - ikhurramraza@gmail.com
16
+ executables:
17
+ - cristiano
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - ".rspec"
22
+ - ".rubocop.yml"
23
+ - ".ruby-version"
24
+ - ".streerc"
25
+ - CODE_OF_CONDUCT.md
26
+ - LICENSE.txt
27
+ - README.md
28
+ - Rakefile
29
+ - exe/cristiano
30
+ - lefthook.yml
31
+ - lib/cristiano.rb
32
+ - lib/cristiano/art.rb
33
+ - lib/cristiano/cli.rb
34
+ - lib/cristiano/cli/options.rb
35
+ - lib/cristiano/cli/parser.rb
36
+ - lib/cristiano/cli/runner.rb
37
+ - lib/cristiano/version.rb
38
+ homepage: https://github.com/ikhurramraza/cristiano.git
39
+ licenses:
40
+ - MIT
41
+ metadata:
42
+ homepage_uri: https://github.com/ikhurramraza/cristiano.git
43
+ source_code_uri: https://github.com/ikhurramraza/cristiano.git
44
+ rubygems_mfa_required: 'false'
45
+ post_install_message:
46
+ rdoc_options: []
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '3.1'
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ requirements: []
60
+ rubygems_version: 3.4.10
61
+ signing_key:
62
+ specification_version: 4
63
+ summary: CLI tool to celebrate the G.O.A.T.
64
+ test_files: []