diff --git a/.ruby-version b/.ruby-version index 951d42f2123cf08a6e8f9b65496ddbceba109c95..6bf7c6fa4e414fe42f2751c6805ba76091023239 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.4.2 +ruby-2.5.1 diff --git a/DockerFile b/Dockerfile similarity index 95% rename from DockerFile rename to Dockerfile index bd862c138a3f704ceda84af7b9782b4cef3024b4..e86007ad54df4da7b6209eb642a68ccc4fc93b07 100644 --- a/DockerFile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.4.2 +FROM ruby:2.5.1 RUN apt-get -y update && apt-get -y upgrade diff --git a/Gemfile b/Gemfile index 55300ee2ccff77580ece298feb1ef6fe9325d564..2f3cbc3acca421a61cee2f0a7dceecb9c91b3767 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,13 @@ +# frozen_string_literal: true + source 'https://rubygems.org' -ruby '2.4.2' +ruby '2.5.1' gem 'activesupport' group :development do - gem 'guard-rspec', require: false gem 'guard-bundler' + gem 'guard-rspec', require: false gem 'guard-rubocop', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 4cb841e0c7484f277cfa25159d6a9dadded9f855..3482a0d0e68044a51ffd1684c25a867fb25e2ba2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,26 +1,26 @@ GEM remote: https://rubygems.org/ specs: - activesupport (5.1.4) + activesupport (5.2.0) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) + i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) - ast (2.3.0) - coderay (1.1.1) + ast (2.4.0) + coderay (1.1.2) concurrent-ruby (1.0.5) crack (0.4.3) safe_yaml (~> 1.0.0) diff-lcs (1.3) - docile (1.1.5) - ffi (1.9.18) + docile (1.3.0) + ffi (1.9.23) formatador (0.2.5) - guard (2.14.1) + guard (2.14.2) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) - lumberjack (~> 1.0) + lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) pry (>= 0.9.12) @@ -39,40 +39,37 @@ GEM guard (~> 2.0) rubocop (~> 0.20) hashdiff (0.3.7) - i18n (0.9.1) + i18n (1.0.0) concurrent-ruby (~> 1.0) json (2.1.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) - lumberjack (1.0.12) - method_source (0.8.2) - minitest (5.10.3) + lumberjack (1.0.13) + method_source (0.9.0) + minitest (5.11.3) nenv (0.3.0) notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) - parallel (1.12.0) - parser (2.4.0.0) - ast (~> 2.2) + parallel (1.12.1) + parser (2.5.1.0) + ast (~> 2.4.0) powerpack (0.1.1) - pry (0.10.4) + pry (0.11.3) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - public_suffix (3.0.1) - rainbow (2.2.2) - rake - rake (12.0.0) - rb-fsevent (0.10.2) + method_source (~> 0.9.0) + public_suffix (3.0.2) + rainbow (3.0.0) + rb-fsevent (0.10.3) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) rspec (3.7.0) rspec-core (~> 3.7.0) rspec-expectations (~> 3.7.0) rspec-mocks (~> 3.7.0) - rspec-core (3.7.0) + rspec-core (3.7.1) rspec-support (~> 3.7.0) rspec-expectations (3.7.0) diff-lcs (>= 1.2.0, < 2.0) @@ -80,30 +77,29 @@ GEM rspec-mocks (3.7.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.7.0) - rspec-support (3.7.0) - rubocop (0.49.1) + rspec-support (3.7.1) + rubocop (0.54.0) parallel (~> 1.10) - parser (>= 2.3.3.1, < 3.0) + parser (>= 2.5) powerpack (~> 0.1) - rainbow (>= 1.99.1, < 3.0) + rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) - ruby-progressbar (1.8.1) + ruby-progressbar (1.9.0) ruby_dep (1.5.0) safe_yaml (1.0.4) shellany (0.0.1) - simplecov (0.15.1) - docile (~> 1.1.0) + simplecov (0.16.1) + docile (~> 1.1) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - slop (3.6.0) - thor (0.19.4) + thor (0.20.0) thread_safe (0.3.6) - tzinfo (1.2.4) + tzinfo (1.2.5) thread_safe (~> 0.1) unicode-display_width (1.3.0) - webmock (3.1.1) + webmock (3.3.0) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff @@ -121,7 +117,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 2.4.2p198 + ruby 2.5.1p57 BUNDLED WITH - 1.16.0 + 1.16.1 diff --git a/Guardfile b/Guardfile index 6dc520c8fb526d8d5134c3135f58df274c04febc..2114ce1de3fe3d3e40107258c6de301063426eaf 100644 --- a/Guardfile +++ b/Guardfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # A sample Guardfile # More info at https://github.com/guard/guard#readme diff --git a/README.md b/README.md index 16235baae0acd317e70563f01413da1489583a35..cd30aa4b28bbb3f3fabbdf6bebcbbc159a39a597 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Place your app-specific code in app/ dir, and utility code that you'd like to ex * Clone the repo: `git clone https://github.com/artemv/ruby-starter-kit.git my-app` ## 1 - In your machine -* Install Ruby 2.4.2 from https://www.ruby-lang.org/en/downloads/ or via RVM (https://rvm.io/) +* Install Ruby 2.5.1 from https://www.ruby-lang.org/en/downloads/ or via RVM (https://rvm.io/) * Install Bundler and dependencies: ``` cd my-app @@ -56,3 +56,8 @@ guard ``` It will run rubocop on start, will run rubocop inspections on changed files and will re-run all RSpecs and rubocop inspections if you hit Enter in guard window. + +Run the tests: +``` +rspec +``` diff --git a/app/api_clients/github_client.rb b/app/api_clients/github_client.rb index 2b4c569d5fea6a7f7db1ebf83c532877527ece95..3caa1ded10b6f1481e9dd6cce309da78c8b78599 100644 --- a/app/api_clients/github_client.rb +++ b/app/api_clients/github_client.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'net/http' require 'uri' require 'json' diff --git a/app/main.rb b/app/main.rb index 19dd159fdca718e01674b465bbc5e6687690c51a..e70db9b71658a2a1e86c567a61ebbad12ae2973a 100644 --- a/app/main.rb +++ b/app/main.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'api_clients/github_client' # A stub for apps' entry point class diff --git a/bin/app.rb b/bin/app.rb index fdd9b1888a4d4c0bb8e00207bfa9742455de2d85..d9651df262fedbe3bed30399f7ed60106df87a96 100755 --- a/bin/app.rb +++ b/bin/app.rb @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require_relative '../lib/environment' raise 'Usage: repo=octokit.rb bin/app.rb' unless ENV['repo'] diff --git a/lib/environment.rb b/lib/environment.rb index a0a0c5977f96c87da5483a2cd6be200fc443b26b..53d457356d7e5d98630bcb49558b07cb4980024b 100644 --- a/lib/environment.rb +++ b/lib/environment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'active_support/logger' # App environment boilerplate code diff --git a/spec/main_spec.rb b/spec/main_spec.rb index 891eed86e636470ba11ea611570819be0a0e0327..57ce33598c207544556a3ed4fe25f74149719ddc 100644 --- a/spec/main_spec.rb +++ b/spec/main_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + RSpec.describe Main do context 'should work' do diff --git a/spec/support/datafile_fixtures_helper.rb b/spec/support/datafile_fixtures_helper.rb index 8497aad4e701b1293565d65afec8149085536995..697cf07c43edd305d59d9d13b581cb3f958f951b 100644 --- a/spec/support/datafile_fixtures_helper.rb +++ b/spec/support/datafile_fixtures_helper.rb @@ -1,3 +1,5 @@ -def load_fixture_text(fn) - File.open([Environment::APP_ROOT, 'spec', 'support', 'fixtures', fn].join('/'), &:read) +# frozen_string_literal: true + +def load_fixture_text(file_name) + File.open([Environment::APP_ROOT, 'spec', 'support', 'fixtures', file_name].join('/'), &:read) end diff --git a/spec/support/environment.rb b/spec/support/environment.rb index 0f8cbd544eabd566d3d9bc6fa71fa438d5bf69ab..21039f0ffc5755cc4ad666c51dab065a1d200f90 100644 --- a/spec/support/environment.rb +++ b/spec/support/environment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Test mode environment tweaks class Environment diff --git a/spec/support/spec_helper.rb b/spec/support/spec_helper.rb index 18cf343af589321d5f4e0de686ab4727bc527a52..ce092792728da29f86c7d85d64a65997c0eca6ed 100644 --- a/spec/support/spec_helper.rb +++ b/spec/support/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'simplecov' require 'webmock/rspec'