Skip to content

Commit

Permalink
Prepare minitar-cli 0.6
Browse files Browse the repository at this point in the history
- Add unit tests and test on both appveyor and travis
  • Loading branch information
halostatue committed Feb 7, 2017
1 parent ddadb9e commit fa7ea12
Show file tree
Hide file tree
Showing 31 changed files with 1,388 additions and 880 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -12,3 +12,5 @@ html
pkg
publish
test/cache.tst
tmp/
.byebug_history
52 changes: 37 additions & 15 deletions .hoerc
@@ -1,20 +1,42 @@
---
exclude: !ruby/regexp '/
\.(tmp|swp)$
|
CVS/
|
(?i:TAGS)
|
\.(svn|git|hg|DS_Store|idea|vagrant)\/
|
Gemfile(?:\.lock)?
|
type-lists\/
|
\.(coveralls|pullreview|travis).yml$
|
\.gemspec
\.(?:
tmp |
swp
)$
|
\.(?:
autotest |
byebug_history |
gemtest |
gitignore |
hoerc |
simplecov-prelude.rb
)$
|
(?:
appveyor |
coveralls |
pullreview |
rubocop |
travis
)\.yml$
|
\b(?i:TAGS)$
|
\.(?:
DS_Store |
bundle |
git |
hg |
idea |
svn |
vagrant
)\/
|
[gG]emfile(?:\.lock)?
|
\.gemspec$
|
Vagrantfile
/x'
124 changes: 124 additions & 0 deletions .rubocop.yml
@@ -0,0 +1,124 @@
---
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
ExtraDetails: true
Exclude:
- '*.gemspec'

Style/AlignHash:
EnforcedColonStyle: key
EnforcedHashRocketStyle: key
EnforcedLastArgumentHashStyle: enforce_implicit

Style/AlignParameters:
EnforcedStyle: with_fixed_indentation

Style/AndOr:
Enabled: false

Style/AsciiComments:
Enabled: false

Style/AsciiIdentifiers:
Enabled: false

Style/BarePercentLiterals:
EnforcedStyle: percent_q

Style/BlockDelimiters:
EnforcedStyle: semantic
IgnoredMethods:
- assert_raises
ProceduralMethods:
- spec

Style/BracesAroundHashParameters:
EnforcedStyle: context_dependent

Style/ClassAndModuleChildren:
Enabled: false

Style/ClassCheck:
EnforcedStyle: kind_of?

Style/CommandLiteral:
EnforcedStyle: percent_x

Style/CommentAnnotation:
Enabled: true

Style/Copyright:
Enabled: false

Style/DotPosition:
EnforcedStyle: trailing

Style/DoubleNegation:
Enabled: false

Style/Encoding: # For a gem that is using Ruby 1.9, change this to true.
Enabled: false

Style/FileName:
Exclude:
- lib/archive-tar-minitar.rb

Style/FormatString:
EnforcedStyle: percent

# minitar supports Ruby 1.8, still. Old-style symbol hash literals are
# required.
Style/HashSyntax:
Enabled: false

# minitar supports Ruby 1.8, still. Old-style symbol lambdas are required.
Style/Lambda:
Enabled: false

Style/MultilineBlockChain:
Enabled: false

Style/MultilineOperationIndentation:
EnforcedStyle: indented

Style/ParallelAssignment:
Enabled: false

Style/RegexpLiteral:
Enabled: false

Style/SpaceInsideBrackets:
Enabled: false

Style/UnneededPercentQ:
Enabled: false

# This is one of the hobgoblins.
Metrics/AbcSize:
Enabled: false

Metrics/BlockLength:
Enabled: false

# This is one of the hobgoblins.
Metrics/ClassLength:
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: false

Metrics/LineLength:
Exclude:
- Rakefile
- test/**/*

# This is one of the hobgoblins.
Metrics/MethodLength:
Enabled: false

Metrics/ModuleLength:
Enabled: false

Metrics/PerceivedComplexity:
Enabled: false
13 changes: 13 additions & 0 deletions .simplecov-prelude.rb
@@ -0,0 +1,13 @@
require 'psych' if ENV['CI']
require 'simplecov'

if ENV['CI']
require 'coveralls'
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
end

SimpleCov.start do
command_name 'Minitest'
end

gem 'minitest'
27 changes: 13 additions & 14 deletions .travis.yml
@@ -1,35 +1,34 @@
---
language: ruby
env:
- DEV=1
rvm:
- 2.1.0
- 2.4.0
- 2.3.3
- 2.2.6
- 2.1.9
- 2.0.0
- jruby-9.0.5.0
- jruby-9.1.6.0
- 1.9.3
- 1.8.7
- ree
- ruby-head
- jruby-19mode
- jruby-head
- rbx-2
matrix:
allow_failures:
- rvm: rbx-2
- rvm: jruby-head
- rvm: ruby-head
- rvm: 1.8.7
- rvm: ree
gemfile:
- Gemfile
before_install:
- pushd .. && git clone https://github.com/halostatue/minitar.git && popd
before_script:
- |
case "${TRAVIS_RUBY_VERSION}" in
rbx*)
gem install psych
;;
esac
- rake travis:before -t
script: rake travis
- bundle exec rake travis:before -t
script: bundle exec rake travis
after_script:
- rake travis:after -t
- bundle exec rake travis:after -t
notifications:
email:
recipients:
Expand Down
71 changes: 71 additions & 0 deletions Contributing.md
@@ -0,0 +1,71 @@
## Contributing

I value any contribution to minitar-cli you can provide: a bug report, a
feature request, or code contributions. There are a few guidelines for
contributing to minitar:

* Code changes *will not* be accepted without tests. The test suite is
written with [Minitest][].
* Match my coding style.
* Use a thoughtfully-named topic branch that contains your change. Rebase
your commits into logical chunks as necessary.
* Use [quality commit messages][].
* Do not change the version number; when your patch is accepted and a release
is made, the version will be updated at that point.
* Submit a GitHub pull request with your changes.
* New or changed behaviours require appropriate documentation.

### Test Dependencies

minitar-cli uses Ryan Davis’s [Hoe][] to manage the release process, and it
adds a number of rake tasks. You will mostly be interested in:

$ rake

which runs the tests the same way that:

$ rake test
$ rake travis

will do.

To assist with the installation of the development dependencies for
minitar-cli, I have provided the simplest possible Gemfile pointing to the
(generated) `minitar-cli.gemspec` file. This will permit you to do:

$ bundle install

to get the development dependencies. If you aleady have `hoe` installed, you
can accomplish the same thing with:

$ rake newb

This task will install any missing dependencies, run the tests/specs, and
generate the RDoc.

You can run tests with code coverage analysis by running:

$ rake test:coverage

### Workflow

Here's the most direct way to get your work merged into the project:

* Fork the project.
* Clone down your fork (`git clone git://github.com/<username>/minitar-cli.git`).
* Create a topic branch to contain your change (`git checkout -b
my_awesome_feature`).
* Hack away, add tests. Not necessarily in that order.
* Make sure everything still passes by running `rake`.
* If necessary, rebase your commits into logical chunks, without errors.
* Push the branch up (`git push origin my_awesome_feature`).
* Create a pull request against halostatue/minitar-cli and describe what your
change does and the why you think it should be merged.

### Contributors

* Austin Ziegler created minitar-cli, extracted from Archive::Tar::Minitar.

[Minitest]: https://github.com/seattlerb/minitest
[quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[Hoe]: https://github.com/seattlerb/hoe
64 changes: 0 additions & 64 deletions Contributing.rdoc

This file was deleted.

0 comments on commit fa7ea12

Please sign in to comment.