Navigation Menu

Skip to content

Commit

Permalink
Add initial gem setup
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Jan 25, 2020
0 parents commit 204b8ac
Show file tree
Hide file tree
Showing 23 changed files with 432 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
@@ -0,0 +1 @@
github: piotrmurach
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,23 @@
### Are you in the right place?
* For issues or feature requests file a GitHub issue in this repository
* For general questions or discussion post in [Gitter](https://gitter.im/piotrmurach/tty)

### Describe the problem
A brief description of the issue/feature.

### Steps to reproduce the problem
```
Your code here to reproduce the issue
```

### Actual behaviour
What happened? This could be a description, log output, error raised etc...

### Expected behaviour
What did you expect to happen?

### Describe your environment

* OS version:
* Ruby version:
* TTY::Exit version:
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,18 @@
### Describe the change
What does this Pull Request do?

### Why are we doing this?
Any related context as to why is this is a desirable change.

### Benefits
How will the library improve?

### Drawbacks
Possible drawbacks applying this change.

### Requirements
Put an X between brackets on each line if you have done the item:
[] Tests written & passing locally?
[] Code style checked?
[] Rebased with `master` branch?
[] Documentation updated?
12 changes: 12 additions & 0 deletions .gitignore
@@ -0,0 +1,12 @@
/.bundle/
/Gemfile.lock
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/

# rspec failure tracking
.rspec_status
3 changes: 3 additions & 0 deletions .rspec
@@ -0,0 +1,3 @@
--format documentation
--color
--require spec_helper
26 changes: 26 additions & 0 deletions .travis.yml
@@ -0,0 +1,26 @@
---
language: ruby
before_install: "gem install bundler -v '< 2.0'"
script: bundle exec rake ci
rvm:
- 2.0.0
- 2.1.10
- 2.2.10
- 2.3.8
- 2.4.9
- 2.5.7
- 2.6.5
- 2.7.0
- ruby-head
- jruby-9.2.6.0
- jruby-head
matrix:
allow_failures:
- rvm: ruby-head
- rvm: jruby-head
- rvm: jruby-9.2.6.0
fast_finish: true
branches:
only: master
notifications:
email: false
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,7 @@
# Change log

## [v0.1.0] - 2020-01-xx

* Initial implementation and release

[v0.1.0]: https://github.com/piotrmurach/tty-exit/compare/v0.1.0
74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers 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, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at piotr@piotrmurach.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [https://contributor-covenant.org/version/1/4][version]

[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/
20 changes: 20 additions & 0 deletions Gemfile
@@ -0,0 +1,20 @@
source "https://rubygems.org"

gemspec

gem "rake", "~> 12.0"
gem "rspec", "~> 3.0"


group :test do
gem 'benchmark-ips', '~> 2.7.2'
gem 'simplecov', '~> 0.16.1'
gem 'coveralls', '~> 0.8.22'
if RUBY_VERSION.split(".")[1].to_i > 0
gem "rspec-benchmark", git: "https://github.com/piotrmurach/rspec-benchmark"
end
end

group :metrics do
gem 'yardstick', '~> 0.9.9'
end
21 changes: 21 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Piotr Murach

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
50 changes: 50 additions & 0 deletions README.md
@@ -0,0 +1,50 @@
<div align="center">
<a href="https://piotrmurach.github.io/tty" target="_blank"><img width="130" src="https://cdn.rawgit.com/piotrmurach/tty/master/images/tty.png" alt="tty logo" /></a>
</div>

# TTY::Exit

> Terminal exit codes.
## Installation

Add this line to your application's Gemfile:

```ruby
gem 'tty-exit'
```

And then execute:

$ bundle install

Or install it yourself as:

$ gem install tty-exit

## 1. Usage

```ruby
```

## Development

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.

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).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/piotrmurach/tty-exit. 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/piotrmurach/tty-exit/blob/master/CODE_OF_CONDUCT.md).

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the TTY::Exit project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/piotrmurach/tty-exit/blob/master/CODE_OF_CONDUCT.md).

## Copyright

Copyright (c) 2020 Piotr Murach. See LICENSE for further details.
8 changes: 8 additions & 0 deletions Rakefile
@@ -0,0 +1,8 @@
require "bundler/gem_tasks"

FileList['tasks/**/*.rake'].each(&method(:import))

desc 'Run all specs'
task ci: %w[ spec ]

task default: :spec
28 changes: 28 additions & 0 deletions appveyor.yml
@@ -0,0 +1,28 @@
---
install:
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
- gem install bundler -v '< 2.0'
- bundle install
before_test:
- ruby -v
- gem -v
- bundle -v
build: off
test_script:
- bundle exec rake ci
environment:
matrix:
- ruby_version: "200"
- ruby_version: "200-x64"
- ruby_version: "21"
- ruby_version: "21-x64"
- ruby_version: "22"
- ruby_version: "22-x64"
- ruby_version: "23"
- ruby_version: "23-x64"
- ruby_version: "24"
- ruby_version: "24-x64"
- ruby_version: "25"
- ruby_version: "25-x64"
- ruby_version: "26"
- ruby_version: "26-x64"
14 changes: 14 additions & 0 deletions bin/console
@@ -0,0 +1,14 @@
#!/usr/bin/env ruby

require "bundler/setup"
require "tty/exit"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start

require "irb"
IRB.start(__FILE__)
8 changes: 8 additions & 0 deletions bin/setup
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

bundle install

# Do any other automated setup that you need to do here
1 change: 1 addition & 0 deletions lib/tty-exit.rb
@@ -0,0 +1 @@
require_relative "tty/exit"
9 changes: 9 additions & 0 deletions lib/tty/exit.rb
@@ -0,0 +1,9 @@
# frozen_string_literal: true

require_relative "exit/version"

module TTY
module Exit
class Error < StandardError; end
end
end
7 changes: 7 additions & 0 deletions lib/tty/exit/version.rb
@@ -0,0 +1,7 @@
# frozen_string_literal: true

module TTY
module Exit
VERSION = "0.1.0"
end
end
25 changes: 25 additions & 0 deletions spec/spec_helper.rb
@@ -0,0 +1,25 @@
if ENV["COVERAGE"] || ENV["TRAVIS"]
require "simplecov"
require "coveralls"

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
])

SimpleCov.start do
command_name "spec"
add_filter "spec"
end
end

require "bundler/setup"
require "tty/exit"

RSpec.configure do |config|
config.disable_monkey_patching!

config.expect_with :rspec do |c|
c.syntax = :expect
end
end
9 changes: 9 additions & 0 deletions tasks/console.rake
@@ -0,0 +1,9 @@
desc "Load gem inside irb console"
task :console do
require "irb"
require "irb/completion"
require File.join(__FILE__, "../../lib/tty-exit")
ARGV.clear
IRB.start
end
task c: %w[ console ]
9 changes: 9 additions & 0 deletions tasks/coverage.rake
@@ -0,0 +1,9 @@
desc "Measure code coverage"
task :coverage do
begin
original, ENV["COVERAGE"] = ENV["COVERAGE"], "true"
Rake::Task["spec"].invoke
ensure
ENV["COVERAGE"] = original
end
end

0 comments on commit 204b8ac

Please sign in to comment.