diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 00000000..de17cb64 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,2 @@ +repo_token: TGgh56EBiNq0gZh4KtAmi3bEvRcxmext2 +service_name: travis-ci diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 00000000..04ce0bb8 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Steven Beales (stevenbeales@gmail.com) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..7454a934 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,17 @@ +# Contribution Guidelines + +## Steps + +1. Fork [the repo](https://github.com/stevenbeales/mental-test) +2. Grab dependencies: `bundle install` +3. Make sure everything is working: `bundle exec rake spec` +4. Make your changes +5. Test your changes +5. Create a Pull Request +6. Celebrate!!!!! + +## Notes + +When contributing, please make sure to update the CHANGELOG and AUTHORS files +when you submit your pull request. Upon merging of your first pull request, +you will be given commit access to the repository. diff --git a/Gemfile b/Gemfile index 11a127b4..c9d61bc2 100644 --- a/Gemfile +++ b/Gemfile @@ -40,4 +40,5 @@ group :development do end gem 'bugsnag', '~> 6.6' # online bug reporting +gem 'coveralls', require: false # code coverage gem 'sdoc', '~> 1.0.0', require: false, group: :doc # static documentation diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..8799c75a --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2018 Steven Beales +Copyright (c) 2018 Ardint + +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 index 8c8e2875..3e06fec9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,13 @@ +# Mental Test + [![Build Status](https://travis-ci.org/stevenbeales/mental-test.png)](https://travis-ci.org/stevenbeales/mental-test) +[![Coverage Status](https://coveralls.io/repos/stevenbeales/mental-test/badge.svg?branch=master)](https://coveralls.io/r/stevenbeales/mental-test?branch=master) + +[![Dependency Status](https://beta.gemnasium.com/badges/github.com/stevenbeales/mental-test.svg)](https://beta.gemnasium.com/projects/github.com/stevenbeales/mental-test) + An Alexa skill for validated Mental Health Self-Assessments, written in Ruby using the Sinatra and Ralyxa frameworks. The application supports importing Surveys and Instruments from SurveyJS.io and REDCap. @@ -27,3 +33,12 @@ To generate the skill documentation - 1) rake rdoc +## Contributing + +See the [Contribution Guidelines](https://github.com/stevenbeales/mental-test/blob/master/CONTRIBUTING.md) + +### Resources + +- [Git Repository](https://github.com/stevenbeales/mental-test) +- [Git Repository Mental-Test Alexa Skill CLI](https://github.com/stevenbeales/mental-health) +- [Git Repository Mental-Test Survey Editor](https://github.com/stevenbeales/mental-editor) diff --git a/bin/cdiff b/bin/cdiff new file mode 100644 index 00000000..4af11d22 --- /dev/null +++ b/bin/cdiff @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'cdiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("term-ansicolor", "cdiff") diff --git a/bin/colortab b/bin/colortab new file mode 100644 index 00000000..92d3bc0d --- /dev/null +++ b/bin/colortab @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'colortab' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("term-ansicolor", "colortab") diff --git a/bin/coveralls b/bin/coveralls new file mode 100644 index 00000000..813bb36e --- /dev/null +++ b/bin/coveralls @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'coveralls' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("coveralls", "coveralls") diff --git a/bin/decolor b/bin/decolor new file mode 100644 index 00000000..45f462c3 --- /dev/null +++ b/bin/decolor @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'decolor' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("term-ansicolor", "decolor") diff --git a/bin/restclient b/bin/restclient new file mode 100644 index 00000000..c7d3f508 --- /dev/null +++ b/bin/restclient @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'restclient' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rest-client", "restclient") diff --git a/bin/term_cdiff b/bin/term_cdiff new file mode 100644 index 00000000..669d7d89 --- /dev/null +++ b/bin/term_cdiff @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'term_cdiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("term-ansicolor", "term_cdiff") diff --git a/bin/term_colortab b/bin/term_colortab new file mode 100644 index 00000000..f03be701 --- /dev/null +++ b/bin/term_colortab @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'term_colortab' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("term-ansicolor", "term_colortab") diff --git a/bin/term_decolor b/bin/term_decolor new file mode 100644 index 00000000..238b84c3 --- /dev/null +++ b/bin/term_decolor @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'term_decolor' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("term-ansicolor", "term_decolor") diff --git a/bin/term_display b/bin/term_display new file mode 100644 index 00000000..84c6191b --- /dev/null +++ b/bin/term_display @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'term_display' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("term-ansicolor", "term_display") diff --git a/bin/term_mandel b/bin/term_mandel new file mode 100644 index 00000000..0c064431 --- /dev/null +++ b/bin/term_mandel @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'term_mandel' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("term-ansicolor", "term_mandel") diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5be63fb6..a8907c08 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -14,6 +14,9 @@ # the additional setup, and require it from the spec files that actually need # it. # +require 'coveralls' +Coveralls.wear! + require 'simplecov' SimpleCov.profiles.define 'app' do @@ -36,8 +39,11 @@ add_filter '/log/' add_filter ['Gemfile.lock', 'README.md', 'todo.txt', '.gitignore', '.rspec', \ '.travis.yml', '.rubocop.yml', 'config/database.yml', 'Guardfile', 'Rakefile'] + add_filter 'app/secrets' end +SimpleCov.formatter = Coveralls::SimpleCov::Formatter + SimpleCov.start 'app' do track_files 'app.rb' end