From 843cf005e3f6b636bd853ded5a23b8ea90edd484 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:13:39 +0500 Subject: [PATCH 01/15] Edit .gitignore before initializing gem --- .gitignore | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 28f4849..469d01b 100644 --- a/.gitignore +++ b/.gitignore @@ -27,9 +27,9 @@ build/ # for a library or gem, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset +/Gemfile.lock +/.ruby-version +/.ruby-gemset # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: .rvmrc From 72019e74a83b3ecca94c9720064b0ee98628ac03 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:15:00 +0500 Subject: [PATCH 02/15] Initialize gem $ bundle gem . --- .travis.yml | 4 ++++ Gemfile | 4 ++++ LICENSE.txt | 21 +++++++++++++++++++++ README.md | 41 +++++++++++++++++++++++++++++++++++++++++ Rakefile | 1 + bin/console | 14 ++++++++++++++ bin/setup | 7 +++++++ lib/lita/tox.rb | 7 +++++++ lib/lita/tox/version.rb | 5 +++++ lita-tox.gemspec | 32 ++++++++++++++++++++++++++++++++ 10 files changed, 136 insertions(+) create mode 100644 .travis.yml create mode 100644 Gemfile create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 Rakefile create mode 100755 bin/console create mode 100755 bin/setup create mode 100644 lib/lita/tox.rb create mode 100644 lib/lita/tox/version.rb create mode 100644 lita-tox.gemspec diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..febabeb --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: ruby +rvm: + - 2.0.0 +before_install: gem install bundler -v 1.10.4 diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..8e17f84 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +# Specify your gem's dependencies in lita-tox.gemspec +gemspec diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..3021568 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Braiden Vasco + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..45cb52b --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# Lita::Tox + +Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/lita/tox`. To experiment with that code, run `bin/console` for an interactive prompt. + +TODO: Delete this and the text above, and describe your gem + +## Installation + +Add this line to your application's Gemfile: + +```ruby +gem 'lita-tox' +``` + +And then execute: + + $ bundle + +Or install it yourself as: + + $ gem install lita-tox + +## Usage + +TODO: Write usage instructions here + +## Development + +After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` 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/[USERNAME]/lita-tox. + + +## License + +The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). + diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..2995527 --- /dev/null +++ b/Rakefile @@ -0,0 +1 @@ +require "bundler/gem_tasks" diff --git a/bin/console b/bin/console new file mode 100755 index 0000000..bac87a0 --- /dev/null +++ b/bin/console @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +require "bundler/setup" +require "lita/tox" + +# 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 diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..b65ed50 --- /dev/null +++ b/bin/setup @@ -0,0 +1,7 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +bundle install + +# Do any other automated setup that you need to do here diff --git a/lib/lita/tox.rb b/lib/lita/tox.rb new file mode 100644 index 0000000..606b685 --- /dev/null +++ b/lib/lita/tox.rb @@ -0,0 +1,7 @@ +require "lita/tox/version" + +module Lita + module Tox + # Your code goes here... + end +end diff --git a/lib/lita/tox/version.rb b/lib/lita/tox/version.rb new file mode 100644 index 0000000..1fcc29f --- /dev/null +++ b/lib/lita/tox/version.rb @@ -0,0 +1,5 @@ +module Lita + module Tox + VERSION = "0.1.0" + end +end diff --git a/lita-tox.gemspec b/lita-tox.gemspec new file mode 100644 index 0000000..fb5be4e --- /dev/null +++ b/lita-tox.gemspec @@ -0,0 +1,32 @@ +# coding: utf-8 +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'lita/tox/version' + +Gem::Specification.new do |spec| + spec.name = "lita-tox" + spec.version = Lita::Tox::VERSION + spec.authors = ["Braiden Vasco"] + spec.email = ["braiden-vasco@mailtor.net"] + + spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.} + spec.description = %q{TODO: Write a longer description or delete this line.} + spec.homepage = "TODO: Put your gem's website or public repo URL here." + spec.license = "MIT" + + # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or + # delete this section to allow pushing this gem to any host. + if spec.respond_to?(:metadata) + spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'" + else + raise "RubyGems 2.0 or newer is required to protect against public gem pushes." + end + + spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] + + spec.add_development_dependency "bundler", "~> 1.10" + spec.add_development_dependency "rake", "~> 10.0" +end From 93367f780c580cfe597f8001a7eb75d6d3fb34ec Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:18:48 +0500 Subject: [PATCH 03/15] Remove unnecessary files --- .travis.yml | 4 ---- LICENSE.txt | 21 --------------------- README.md | 41 ----------------------------------------- 3 files changed, 66 deletions(-) delete mode 100644 .travis.yml delete mode 100644 LICENSE.txt delete mode 100644 README.md diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index febabeb..0000000 --- a/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: ruby -rvm: - - 2.0.0 -before_install: gem install bundler -v 1.10.4 diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 3021568..0000000 --- a/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Braiden Vasco - -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. diff --git a/README.md b/README.md deleted file mode 100644 index 45cb52b..0000000 --- a/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Lita::Tox - -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/lita/tox`. To experiment with that code, run `bin/console` for an interactive prompt. - -TODO: Delete this and the text above, and describe your gem - -## Installation - -Add this line to your application's Gemfile: - -```ruby -gem 'lita-tox' -``` - -And then execute: - - $ bundle - -Or install it yourself as: - - $ gem install lita-tox - -## Usage - -TODO: Write usage instructions here - -## Development - -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` 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/[USERNAME]/lita-tox. - - -## License - -The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). - From 724b27bf04ec43f14a471a094e4d1e9771a869f4 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:20:16 +0500 Subject: [PATCH 04/15] Add gem information --- lita-tox.gemspec | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lita-tox.gemspec b/lita-tox.gemspec index fb5be4e..80687d9 100644 --- a/lita-tox.gemspec +++ b/lita-tox.gemspec @@ -9,19 +9,11 @@ Gem::Specification.new do |spec| spec.authors = ["Braiden Vasco"] spec.email = ["braiden-vasco@mailtor.net"] - spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.} - spec.description = %q{TODO: Write a longer description or delete this line.} - spec.homepage = "TODO: Put your gem's website or public repo URL here." + spec.summary = %q{Tox adapter for the Lita chat bot} + spec.description = %q{Tox adapter for the Lita chat bot.} + spec.homepage = "https://github.com/braiden-vasco/lita-tox" spec.license = "MIT" - # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or - # delete this section to allow pushing this gem to any host. - if spec.respond_to?(:metadata) - spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'" - else - raise "RubyGems 2.0 or newer is required to protect against public gem pushes." - end - spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } From 5b750439d1a9bc4adc5a5d3b05041001a85a7f3b Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:20:50 +0500 Subject: [PATCH 05/15] Fix gem version --- lib/lita/tox/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lita/tox/version.rb b/lib/lita/tox/version.rb index 1fcc29f..4553074 100644 --- a/lib/lita/tox/version.rb +++ b/lib/lita/tox/version.rb @@ -1,5 +1,5 @@ module Lita module Tox - VERSION = "0.1.0" + VERSION = "0.0.0" end end From 91360fbbd6bf6669b27e715081751c3c2af66066 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:24:48 +0500 Subject: [PATCH 06/15] Use RuboCop --- Rakefile | 7 +++++++ lita-tox.gemspec | 1 + 2 files changed, 8 insertions(+) diff --git a/Rakefile b/Rakefile index 2995527..e4e1c91 100644 --- a/Rakefile +++ b/Rakefile @@ -1 +1,8 @@ require "bundler/gem_tasks" + +task default: [:lint] + +task lint: [:rubocop] + +require 'rubocop/rake_task' +RuboCop::RakeTask.new diff --git a/lita-tox.gemspec b/lita-tox.gemspec index 80687d9..84e60bc 100644 --- a/lita-tox.gemspec +++ b/lita-tox.gemspec @@ -21,4 +21,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler", "~> 1.10" spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rubocop", "~> 0.31" end From 23d8f78001ce2c3877bea29eade85d61a1b89fdf Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:25:16 +0500 Subject: [PATCH 07/15] Run RuboCop auto-correction $ rake rubocop:auto_correct --- Rakefile | 2 +- bin/console | 6 +++--- lib/lita/tox.rb | 2 +- lib/lita/tox/version.rb | 2 +- lita-tox.gemspec | 24 ++++++++++++------------ 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Rakefile b/Rakefile index e4e1c91..df02adb 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,4 @@ -require "bundler/gem_tasks" +require 'bundler/gem_tasks' task default: [:lint] diff --git a/bin/console b/bin/console index bac87a0..8a51fab 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,7 @@ #!/usr/bin/env ruby -require "bundler/setup" -require "lita/tox" +require 'bundler/setup' +require 'lita/tox' # 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. @@ -10,5 +10,5 @@ require "lita/tox" # require "pry" # Pry.start -require "irb" +require 'irb' IRB.start diff --git a/lib/lita/tox.rb b/lib/lita/tox.rb index 606b685..a2ac55d 100644 --- a/lib/lita/tox.rb +++ b/lib/lita/tox.rb @@ -1,4 +1,4 @@ -require "lita/tox/version" +require 'lita/tox/version' module Lita module Tox diff --git a/lib/lita/tox/version.rb b/lib/lita/tox/version.rb index 4553074..3786e2c 100644 --- a/lib/lita/tox/version.rb +++ b/lib/lita/tox/version.rb @@ -1,5 +1,5 @@ module Lita module Tox - VERSION = "0.0.0" + VERSION = '0.0.0' end end diff --git a/lita-tox.gemspec b/lita-tox.gemspec index 84e60bc..d941679 100644 --- a/lita-tox.gemspec +++ b/lita-tox.gemspec @@ -4,22 +4,22 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'lita/tox/version' Gem::Specification.new do |spec| - spec.name = "lita-tox" + spec.name = 'lita-tox' spec.version = Lita::Tox::VERSION - spec.authors = ["Braiden Vasco"] - spec.email = ["braiden-vasco@mailtor.net"] + spec.authors = ['Braiden Vasco'] + spec.email = ['braiden-vasco@mailtor.net'] - spec.summary = %q{Tox adapter for the Lita chat bot} - spec.description = %q{Tox adapter for the Lita chat bot.} - spec.homepage = "https://github.com/braiden-vasco/lita-tox" - spec.license = "MIT" + spec.summary = 'Tox adapter for the Lita chat bot' + spec.description = 'Tox adapter for the Lita chat bot.' + spec.homepage = 'https://github.com/braiden-vasco/lita-tox' + spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - spec.bindir = "exe" + spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] + spec.require_paths = ['lib'] - spec.add_development_dependency "bundler", "~> 1.10" - spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "rubocop", "~> 0.31" + spec.add_development_dependency 'bundler', '~> 1.10' + spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'rubocop', '~> 0.31' end From 1ee21273b02ef38716befd422cc50f37d8af109b Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:27:06 +0500 Subject: [PATCH 08/15] Correct RuboCop offenses manually --- lib/lita/tox/version.rb | 2 +- lita-tox.gemspec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/lita/tox/version.rb b/lib/lita/tox/version.rb index 3786e2c..291e337 100644 --- a/lib/lita/tox/version.rb +++ b/lib/lita/tox/version.rb @@ -1,5 +1,5 @@ module Lita - module Tox + module Tox # rubocop:disable Style/Documentation VERSION = '0.0.0' end end diff --git a/lita-tox.gemspec b/lita-tox.gemspec index d941679..1eb48e2 100644 --- a/lita-tox.gemspec +++ b/lita-tox.gemspec @@ -14,7 +14,10 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/braiden-vasco/lita-tox' spec.license = 'MIT' - spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.files = `git ls-files -z`.split("\x0").reject do |f| + f.match(%r{^(test|spec|features)/}) + end + spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] From d041d0392e0bc03bc694caf4c64e4794d419ec98 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:31:14 +0500 Subject: [PATCH 09/15] Configure testing --- .rspec | 2 + .simplecov | 1 + Rakefile | 5 ++- lita-tox.gemspec | 2 + spec/spec_helper.rb | 101 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 .rspec create mode 100644 .simplecov create mode 100644 spec/spec_helper.rb diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..83e16f8 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/.simplecov b/.simplecov new file mode 100644 index 0000000..4f3baca --- /dev/null +++ b/.simplecov @@ -0,0 +1 @@ +SimpleCov.start diff --git a/Rakefile b/Rakefile index df02adb..7b37604 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,9 @@ require 'bundler/gem_tasks' -task default: [:lint] +task default: [:spec, :lint] + +require 'rspec/core/rake_task' +RSpec::Core::RakeTask.new task lint: [:rubocop] diff --git a/lita-tox.gemspec b/lita-tox.gemspec index 1eb48e2..2f61b3c 100644 --- a/lita-tox.gemspec +++ b/lita-tox.gemspec @@ -25,4 +25,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler', '~> 1.10' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rubocop', '~> 0.31' + spec.add_development_dependency 'rspec', '~> 3.3' + spec.add_development_dependency 'simplecov', '~> 0.10' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..9690f85 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,101 @@ +# This should be on the top of the file +require 'simplecov' + +# rubocop:disable Style/BlockComments + +# This file was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # These two settings work together to allow you to limit a spec run + # to individual examples or groups you care about by tagging them with + # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # get run. + config.filter_run :focus + config.run_all_when_everything_filtered = true + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end From 2540e05a0ce3b32c9f921fbf0425edd9e4eb10a9 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:34:17 +0500 Subject: [PATCH 10/15] Add README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..62ef5b8 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +Lita::Adapters::Tox +=================== + +[![Gem Version](https://badge.fury.io/rb/lita-tox.svg)](http://badge.fury.io/rb/lita-tox) +[![Build Status](https://travis-ci.org/braiden-vasco/lita-tox.svg)](https://travis-ci.org/braiden-vasco/lita-tox) +[![Coverage Status](https://coveralls.io/repos/braiden-vasco/lita-tox/badge.svg)](https://coveralls.io/r/braiden-vasco/lita-tox) + +(Tox)[https://tox.chat] adapter for the Lita chat bot From 56d604d4164d352cf73458ec51ef853a398b10d7 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 07:37:46 +0000 Subject: [PATCH 11/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62ef5b8..64e5d1d 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,4 @@ Lita::Adapters::Tox [![Build Status](https://travis-ci.org/braiden-vasco/lita-tox.svg)](https://travis-ci.org/braiden-vasco/lita-tox) [![Coverage Status](https://coveralls.io/repos/braiden-vasco/lita-tox/badge.svg)](https://coveralls.io/r/braiden-vasco/lita-tox) -(Tox)[https://tox.chat] adapter for the Lita chat bot +[Tox](https://tox.chat) adapter for the Lita chat bot From 99d1bd16b5f9b1e3f2460b424a51efef13049638 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:38:42 +0500 Subject: [PATCH 12/15] Configure Travis CI --- .rubocop.yml | 3 +++ .travis.yml | 6 ++++++ lita-tox.gemspec | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .rubocop.yml create mode 100644 .travis.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..f7e84ec --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,3 @@ +AllCops: + Exclude: + - vendor/**/* diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..cdfbc4a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: ruby + +rvm: + - 2.0 + - 2.1 + - 2.2 diff --git a/lita-tox.gemspec b/lita-tox.gemspec index 2f61b3c..56f7bbe 100644 --- a/lita-tox.gemspec +++ b/lita-tox.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_development_dependency 'bundler', '~> 1.10' + spec.add_development_dependency 'bundler', '~> 1.7' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rubocop', '~> 0.31' spec.add_development_dependency 'rspec', '~> 3.3' From 2eccf68c3f55d11a3a369d9b54dd2a33a4b6752e Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 12:42:19 +0500 Subject: [PATCH 13/15] Configure Coveralls --- .simplecov | 7 +++++++ Gemfile | 2 ++ 2 files changed, 9 insertions(+) diff --git a/.simplecov b/.simplecov index 4f3baca..af526eb 100644 --- a/.simplecov +++ b/.simplecov @@ -1 +1,8 @@ +require 'coveralls' + +SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter, +] + SimpleCov.start diff --git a/Gemfile b/Gemfile index 8e17f84..222c596 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,5 @@ source 'https://rubygems.org' # Specify your gem's dependencies in lita-tox.gemspec gemspec + +gem 'coveralls', require: false From 1ec14d34c260f67f11df68f98fd51670381d388f Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 13:02:30 +0500 Subject: [PATCH 14/15] Use YARD --- .yardopts | 5 +++++ Rakefile | 3 +++ lita-tox.gemspec | 2 ++ 3 files changed, 10 insertions(+) create mode 100644 .yardopts diff --git a/.yardopts b/.yardopts new file mode 100644 index 0000000..e72742d --- /dev/null +++ b/.yardopts @@ -0,0 +1,5 @@ +--protected +--private +--markup markdown +- +LICENSE diff --git a/Rakefile b/Rakefile index 7b37604..82f0255 100644 --- a/Rakefile +++ b/Rakefile @@ -9,3 +9,6 @@ task lint: [:rubocop] require 'rubocop/rake_task' RuboCop::RakeTask.new + +require 'yard' +YARD::Rake::YardocTask.new diff --git a/lita-tox.gemspec b/lita-tox.gemspec index 56f7bbe..c59f1c5 100644 --- a/lita-tox.gemspec +++ b/lita-tox.gemspec @@ -27,4 +27,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rubocop', '~> 0.31' spec.add_development_dependency 'rspec', '~> 3.3' spec.add_development_dependency 'simplecov', '~> 0.10' + spec.add_development_dependency 'yard', '~> 0.8' + spec.add_development_dependency 'redcarpet', '~> 3.3' end From c6703284543163df2ec75bbfe5c93d0431c71b98 Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sat, 25 Jul 2015 13:07:37 +0500 Subject: [PATCH 15/15] Add changelog generator --- Rakefile | 17 +++++++++++++++++ lita-tox.gemspec | 1 + 2 files changed, 18 insertions(+) diff --git a/Rakefile b/Rakefile index 82f0255..3f05d37 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,10 @@ +require 'rubygems' + +gemspec = Gem::Specification.load('lita-tox.gemspec') + +github_user, github_project = + gemspec.homepage.scan(%r{^https://github\.com/([^/]+)/([^/]+)/?$})[0] + require 'bundler/gem_tasks' task default: [:spec, :lint] @@ -12,3 +19,13 @@ RuboCop::RakeTask.new require 'yard' YARD::Rake::YardocTask.new + +desc 'Generate changelog' +task :changelog, [:token] do |_t, args| + cmd = 'github_changelog_generator' + cmd << " -u #{github_user}" + cmd << " -p #{github_project}" + cmd << " -t #{args[:token]}" if args[:token] + + sh cmd +end diff --git a/lita-tox.gemspec b/lita-tox.gemspec index c59f1c5..d4bb77d 100644 --- a/lita-tox.gemspec +++ b/lita-tox.gemspec @@ -29,4 +29,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'simplecov', '~> 0.10' spec.add_development_dependency 'yard', '~> 0.8' spec.add_development_dependency 'redcarpet', '~> 3.3' + spec.add_development_dependency 'github_changelog_generator', '~> 1.6' end