Archived
1
0
Fork 0

Merge pull request #24 from braiden-vasco/fix-ci

Fix CI build
This commit is contained in:
Braiden Vasco 2017-07-20 20:00:30 +00:00 committed by GitHub
commit c20844cc4a
20 changed files with 181 additions and 74 deletions

2
.gitignore vendored
View file

@ -5,6 +5,7 @@
/InstalledFiles /InstalledFiles
/pkg/ /pkg/
/spec/reports/ /spec/reports/
/spec/examples.txt
/test/tmp/ /test/tmp/
/test/version_tmp/ /test/version_tmp/
/tmp/ /tmp/
@ -16,7 +17,6 @@ Makefile
## Specific to RubyMotion: ## Specific to RubyMotion:
.dat* .dat*
.repl_history .repl_history
build/
## Documentation cache and generated files: ## Documentation cache and generated files:
/.yardoc/ /.yardoc/

6
.gitmodules vendored Normal file
View file

@ -0,0 +1,6 @@
[submodule "vendor/libtoxcore"]
path = vendor/libtoxcore
url = https://github.com/TokTok/c-toxcore.git
[submodule "vendor/libsodium"]
path = vendor/libsodium
url = https://github.com/jedisct1/libsodium.git

View file

@ -1,3 +1,45 @@
AllCops: AllCops:
TargetRubyVersion: 2.3
DisplayCopNames: true
Exclude: Exclude:
- vendor/**/* - vendor/**/*
Layout/AccessModifierIndentation:
EnforcedStyle: outdent
Layout/MultilineOperationIndentation:
Exclude:
- ext/**/*
Metrics/BlockLength:
Exclude:
- '**/*.gemspec'
- spec/**/*
Metrics/LineLength:
Max: 120
Style/AndOr:
Exclude:
- ext/**/*
Style/DoubleNegation:
Enabled: false
Style/FileName:
Exclude:
- lib/lita-tox.rb
Style/GlobalVars:
Exclude:
- ext/**/*
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: comma
Style/VariableInterpolation:
Enabled: false

View file

@ -1,8 +1,10 @@
require 'coveralls' require 'coveralls'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::HTMLFormatter, SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter, Coveralls::SimpleCov::Formatter,
] ])
SimpleCov.start { add_filter '/spec/' } SimpleCov.start do
add_filter '/spec/'
end

View file

@ -4,11 +4,22 @@ rvm:
- 2.0 - 2.0
- 2.1 - 2.1
- 2.2 - 2.2
- 2.3
script: bundle exec rake - 2.4
before_install:
- gem update --system
services: services:
- redis-server - redis-server
before_install:
- sudo apt-get update
- sudo apt-get install -y build-essential libtool autotools-dev automake checkinstall check git yasm
- sudo ./bin/build/libsodium
- sudo ./bin/build/libtoxcore
- sudo mkdir -p '/etc/ld.so.conf.d/'
- echo '/usr/local/lib/' | sudo tee -a '/etc/ld.so.conf.d/locallib.conf'
- sudo ldconfig
before_script:
- rake compile

View file

@ -1,6 +1,8 @@
# frozen_string_literal: true
source 'https://rubygems.org' source 'https://rubygems.org'
# Specify your gem's dependencies in lita-tox.gemspec # Specify your gem's dependencies in lita-tox.gemspec
gemspec gemspec
gem 'coveralls', require: false gem 'coveralls', group: :test, require: false

View file

@ -3,7 +3,7 @@ Lita::Adapters::Tox
[![Gem Version](https://badge.fury.io/rb/lita-tox.svg)](http://badge.fury.io/rb/lita-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) [![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) [![Coverage Status](https://coveralls.io/repos/github/braiden-vasco/lita-tox/badge.svg)](https://coveralls.io/github/braiden-vasco/lita-tox)
[Tox](https://tox.chat) adapter for the [Lita](http://lita.io) chat bot. [Tox](https://tox.chat) adapter for the [Lita](http://lita.io) chat bot.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rubygems' require 'rubygems'
gemspec = Gem::Specification.load('lita-tox.gemspec') gemspec = Gem::Specification.load('lita-tox.gemspec')
@ -7,12 +9,14 @@ github_user, github_project =
require 'bundler/gem_tasks' require 'bundler/gem_tasks'
task default: [:spec, :lint] task default: %i[spec lint]
require 'rspec/core/rake_task' require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new RSpec::Core::RakeTask.new
task lint: [:rubocop] task lint: :rubocop
task fix: 'rubocop:auto_correct'
require 'rubocop/rake_task' require 'rubocop/rake_task'
RuboCop::RakeTask.new RuboCop::RakeTask.new

11
bin/build/libsodium Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx
pushd 'vendor/libsodium'
./autogen.sh
./configure
make install
popd

11
bin/build/libtoxcore Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx
pushd 'vendor/libtoxcore'
autoreconf -i
./configure
make install
popd

View file

@ -1,4 +1,5 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# frozen_string_literal: true
require 'bundler/setup' require 'bundler/setup'
require 'lita-tox' require 'lita-tox'

View file

@ -1,4 +1,5 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# frozen_string_literal: true
require 'mkmf' require 'mkmf'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# lita-tox - Tox adapter for the Lita chat bot # lita-tox - Tox adapter for the Lita chat bot
# Copyright (C) 2015-2017 Braiden Vasco # Copyright (C) 2015-2017 Braiden Vasco
# #
@ -14,8 +16,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# rubocop:disable Style/FileName
require 'lita' require 'lita'
Lita.load_locales Dir[File.expand_path( Lita.load_locales Dir[File.expand_path(

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# lita-tox - Tox adapter for the Lita chat bot # lita-tox - Tox adapter for the Lita chat bot
# Copyright (C) 2015-2017 Braiden Vasco # Copyright (C) 2015-2017 Braiden Vasco
# #
@ -31,7 +33,7 @@ module Lita
config :savedata_filename, type: String config :savedata_filename, type: String
config :status, type: String config :status, type: String
def initialize(robot) def initialize(robot) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
super super
options = ::Tox::Options.new options = ::Tox::Options.new

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# lita-tox - Tox adapter for the Lita chat bot # lita-tox - Tox adapter for the Lita chat bot
# Copyright (C) 2015-2017 Braiden Vasco # Copyright (C) 2015-2017 Braiden Vasco
# #
@ -14,36 +16,38 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# rubocop:disable Layout/SpaceInsideArrayPercentLiteral
require 'tox/tox' require 'tox/tox'
class Tox class Tox # rubocop:disable Style/Documentation
NODES = [ NODES = [
%w(192.254.75.102 33445 951C88B7E75C867418ACDB5D273821372BB5BD652740BCDF623A4FA293E75D2F), %w[192.254.75.102 33445 951C88B7E75C867418ACDB5D273821372BB5BD652740BCDF623A4FA293E75D2F],
%w(144.76.60.215 33445 04119E835DF3E78BACF0F84235B300546AF8B936F035185E2A8E9E0A67C8924F), %w[144.76.60.215 33445 04119E835DF3E78BACF0F84235B300546AF8B936F035185E2A8E9E0A67C8924F],
%w(23.226.230.47 33445 A09162D68618E742FFBCA1C2C70385E6679604B2D80EA6E84AD0996A1AC8A074), %w[23.226.230.47 33445 A09162D68618E742FFBCA1C2C70385E6679604B2D80EA6E84AD0996A1AC8A074],
%w(178.62.125.224 33445 10B20C49ACBD968D7C80F2E8438F92EA51F189F4E70CFBBB2C2C8C799E97F03E), %w[178.62.125.224 33445 10B20C49ACBD968D7C80F2E8438F92EA51F189F4E70CFBBB2C2C8C799E97F03E],
%w(178.21.112.187 33445 4B2C19E924972CB9B57732FB172F8A8604DE13EEDA2A6234E348983344B23057), %w[178.21.112.187 33445 4B2C19E924972CB9B57732FB172F8A8604DE13EEDA2A6234E348983344B23057],
%w(195.154.119.113 33445 E398A69646B8CEACA9F0B84F553726C1C49270558C57DF5F3C368F05A7D71354), %w[195.154.119.113 33445 E398A69646B8CEACA9F0B84F553726C1C49270558C57DF5F3C368F05A7D71354],
%w(192.210.149.121 33445 F404ABAA1C99A9D37D61AB54898F56793E1DEF8BD46B1038B9D822E8460FAB67), %w[192.210.149.121 33445 F404ABAA1C99A9D37D61AB54898F56793E1DEF8BD46B1038B9D822E8460FAB67],
%w(76.191.23.96 33445 93574A3FAB7D612FEA29FD8D67D3DD10DFD07A075A5D62E8AF3DD9F5D0932E11), %w[76.191.23.96 33445 93574A3FAB7D612FEA29FD8D67D3DD10DFD07A075A5D62E8AF3DD9F5D0932E11],
%w(46.38.239.179 33445 F5A1A38EFB6BD3C2C8AF8B10D85F0F89E931704D349F1D0720C3C4059AF2440A), %w[46.38.239.179 33445 F5A1A38EFB6BD3C2C8AF8B10D85F0F89E931704D349F1D0720C3C4059AF2440A],
%w(178.62.250.138 33445 788236D34978D1D5BD822F0A5BEBD2C53C64CC31CD3149350EE27D4D9A2F9B6B), %w[178.62.250.138 33445 788236D34978D1D5BD822F0A5BEBD2C53C64CC31CD3149350EE27D4D9A2F9B6B],
%w(78.225.128.39 33445 7A2306BFBA665E5480AE59B31E116BE9C04DCEFE04D9FE25082316FA34B4DA0C), %w[78.225.128.39 33445 7A2306BFBA665E5480AE59B31E116BE9C04DCEFE04D9FE25082316FA34B4DA0C],
%w(130.133.110.14 33445 461FA3776EF0FA655F1A05477DF1B3B614F7D6B124F7DB1DD4FE3C08B03B640F), %w[130.133.110.14 33445 461FA3776EF0FA655F1A05477DF1B3B614F7D6B124F7DB1DD4FE3C08B03B640F],
%w(104.167.101.29 33445 5918AC3C06955962A75AD7DF4F80A5D7C34F7DB9E1498D2E0495DE35B3FE8A57), %w[104.167.101.29 33445 5918AC3C06955962A75AD7DF4F80A5D7C34F7DB9E1498D2E0495DE35B3FE8A57],
%w(195.154.109.148 33445 391C96CB67AE893D4782B8E4495EB9D89CF1031F48460C06075AA8CE76D50A21), %w[195.154.109.148 33445 391C96CB67AE893D4782B8E4495EB9D89CF1031F48460C06075AA8CE76D50A21],
%w(192.3.173.88 33445 3E1FFDEB667BFF549F619EC6737834762124F50A89C8D0DBF1DDF64A2DD6CD1B), %w[192.3.173.88 33445 3E1FFDEB667BFF549F619EC6737834762124F50A89C8D0DBF1DDF64A2DD6CD1B],
%w(205.185.116.116 33445 A179B09749AC826FF01F37A9613F6B57118AE014D4196A0E1105A98F93A54702), %w[205.185.116.116 33445 A179B09749AC826FF01F37A9613F6B57118AE014D4196A0E1105A98F93A54702],
%w(198.98.51.198 33445 1D5A5F2F5D6233058BF0259B09622FB40B482E4FA0931EB8FD3AB8E7BF7DAF6F), %w[198.98.51.198 33445 1D5A5F2F5D6233058BF0259B09622FB40B482E4FA0931EB8FD3AB8E7BF7DAF6F],
%w(80.232.246.79 33445 A7A060D553B017D9D8F038E265C7AFB6C70BAAC55070197F9C007432D0038E0F), %w[80.232.246.79 33445 A7A060D553B017D9D8F038E265C7AFB6C70BAAC55070197F9C007432D0038E0F],
%w(108.61.165.198 33445 8E7D0B859922EF569298B4D261A8CCB5FEA14FB91ED412A7603A585A25698832), %w[108.61.165.198 33445 8E7D0B859922EF569298B4D261A8CCB5FEA14FB91ED412A7603A585A25698832],
%w(212.71.252.109 33445 C4CEB8C7AC607C6B374E2E782B3C00EA3A63B80D4910B8649CCACDD19F260819), %w[212.71.252.109 33445 C4CEB8C7AC607C6B374E2E782B3C00EA3A63B80D4910B8649CCACDD19F260819],
%w(194.249.212.109 33445 3CEE1F054081E7A011234883BC4FC39F661A55B73637A5AC293DDF1251D9432B), %w[194.249.212.109 33445 3CEE1F054081E7A011234883BC4FC39F661A55B73637A5AC293DDF1251D9432B],
%w(194.249.212.109 443 3CEE1F054081E7A011234883BC4FC39F661A55B73637A5AC293DDF1251D9432B), %w[194.249.212.109 443 3CEE1F054081E7A011234883BC4FC39F661A55B73637A5AC293DDF1251D9432B],
%w(103.38.216.87 33445 601AEE6FC8C17E8CD8F8F1FFC4D4AD84E59A73BE451F037194E7A404E3795320), %w[103.38.216.87 33445 601AEE6FC8C17E8CD8F8F1FFC4D4AD84E59A73BE451F037194E7A404E3795320],
%w(185.25.116.107 33445 DA4E4ED4B697F2E9B000EEFE3A34B554ACD3F45F5C96EAEA2516DD7FF9AF7B43), %w[185.25.116.107 33445 DA4E4ED4B697F2E9B000EEFE3A34B554ACD3F45F5C96EAEA2516DD7FF9AF7B43],
%w(192.99.168.140 33445 6A4D0607A296838434A6A7DDF99F50EF9D60A2C510BBF31FE538A25CB6B4652F), %w[192.99.168.140 33445 6A4D0607A296838434A6A7DDF99F50EF9D60A2C510BBF31FE538A25CB6B4652F],
] ].freeze
attr_accessor :running attr_accessor :running
@ -51,11 +55,11 @@ class Tox
initialize_with(options) initialize_with(options)
NODES.each do |node| NODES.each do |node|
bootstrap({ bootstrap(
ip: node[0], ip: node[0],
port: node[1].to_i, port: node[1].to_i,
key: node[2], key: node[2],
}) )
end end
end end

View file

@ -1,4 +1,5 @@
# coding: utf-8 # coding: utf-8
# frozen_string_literal: true
Gem::Specification.new do |spec| Gem::Specification.new do |spec|
spec.name = 'lita-tox' spec.name = 'lita-tox'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# lita-tox - Tox adapter for the Lita chat bot # lita-tox - Tox adapter for the Lita chat bot
# Copyright (C) 2015-2017 Braiden Vasco # Copyright (C) 2015-2017 Braiden Vasco
# #
@ -14,5 +16,5 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
describe Lita::Adapters::Tox, lita: true do # RSpec.describe Lita::Adapters::Tox, lita: true do
end # end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# lita-tox - Tox adapter for the Lita chat bot # lita-tox - Tox adapter for the Lita chat bot
# Copyright (C) 2015-2017 Braiden Vasco # Copyright (C) 2015-2017 Braiden Vasco
# #
@ -14,19 +16,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# This should be on the top of the file # This should be on the top of the file.
require 'simplecov' require 'simplecov'
# rubocop:disable Style/BlockComments
require 'lita-tox'
require 'lita/rspec'
# A compatibility mode is provided for older plugins upgrading from Lita 3.
# Since this plugin was generated with Lita 4, the compatibility mode
# should be left disabled.
Lita.version_3_compatibility_mode = false
# This file was generated by the `rspec --init` command. Conventionally, all # This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause # The generated `.rspec` file contains `--require spec_helper` which will cause
@ -41,10 +33,20 @@ Lita.version_3_compatibility_mode = false
# the additional setup, and require it from the spec files that actually need # the additional setup, and require it from the spec files that actually need
# it. # 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 # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
require 'timeout'
require 'faker'
require 'lita/rspec'
# require 'lita-tox'
# A compatibility mode is provided for older plugins upgrading from Lita 3.
# Since this plugin was generated with Lita 4, the compatibility mode
# should be left disabled.
Lita.version_3_compatibility_mode = false
RSpec.configure do |config| RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate # rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest # assertion/expectation library such as wrong or the stdlib/minitest
@ -69,26 +71,30 @@ RSpec.configure do |config|
mocks.verify_partial_doubles = true mocks.verify_partial_doubles = true
end end
# The settings below are suggested to provide a good initial experience # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
# with RSpec, but feel free to customize to your heart's content. # have no way to turn it off -- the option exists only for backwards
=begin # compatibility in RSpec 3). It causes shared context metadata to be
# These two settings work together to allow you to limit a spec run # inherited by the metadata hash of host groups and examples, rather than
# to individual examples or groups you care about by tagging them with # triggering implicit auto-inclusion in groups with matching metadata.
# `:focus` metadata. When nothing is tagged with `:focus`, all examples config.shared_context_metadata_behavior = :apply_to_host_groups
# get run.
config.filter_run :focus # This allows you to limit a spec run to individual examples or groups
config.run_all_when_everything_filtered = true # you care about by tagging them with `:focus` metadata. When nothing
# is tagged with `:focus`, all examples get run. RSpec also provides
# aliases for `it`, `describe`, and `context` that include `:focus`
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
config.filter_run_when_matching :focus
# Allows RSpec to persist some state between runs in order to support # Allows RSpec to persist some state between runs in order to support
# the `--only-failures` and `--next-failure` CLI options. We recommend # the `--only-failures` and `--next-failure` CLI options. We recommend
# you configure your source control system to ignore this file. # you configure your source control system to ignore this file.
config.example_status_persistence_file_path = "spec/examples.txt" config.example_status_persistence_file_path = 'spec/examples.txt'
# Limits the available syntax to the non-monkey patched syntax that is # Limits the available syntax to the non-monkey patched syntax that is
# recommended. For more details, see: # recommended. For more details, see:
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-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 # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
config.disable_monkey_patching! config.disable_monkey_patching!
# This setting enables warnings. It's recommended, but in some cases may # This setting enables warnings. It's recommended, but in some cases may
@ -121,5 +127,4 @@ RSpec.configure do |config|
# test failures related to randomization by passing the same `--seed` value # test failures related to randomization by passing the same `--seed` value
# as the one that triggered the failure. # as the one that triggered the failure.
Kernel.srand config.seed Kernel.srand config.seed
=end
end end

1
vendor/libsodium vendored Submodule

@ -0,0 +1 @@
Subproject commit 63dd05419e8a4175fd59da50a58afbdc20a2cd31

1
vendor/libtoxcore vendored Submodule

@ -0,0 +1 @@
Subproject commit a429ef4a28a5e5e0ad010efffb76d2abc3ada0af