Skip to content

Commit

Permalink
Attempt update to Ruby 2.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfioravanti committed Oct 22, 2018
1 parent ebc8dd0 commit 325359e
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AllCops:
# that CI still goes looking in the vendor directory and attempts to
# scan all files in all gems, so make the exclusion explicit here.
- "vendor/**/*"
TargetRubyVersion: 2.4
TargetRubyVersion: 2.5

Layout/DotPosition:
EnforcedStyle: trailing
Expand Down
7 changes: 4 additions & 3 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ build:
- cd /home/scrutinizer/.rbenv/plugins/ruby-build && git pull origin master && cd -
- rbenv install -l
-
command: rbenv install 2.5.1
command: rbenv install 2.5.3
idle_timeout: 600
- rbenv local 2.5.1
- rbenv local 2.5.3
- ruby -v
# - gem update --system
# - gem install bundler i18n rspec
- gem install i18n rspec
environment:
# ruby: 2.5.1
ruby: 2.4.2
# ruby: 2.4.2
ruby: 2.5.3
nodes:
analysis:
tests:
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dist: trusty
language: ruby
cache: bundler
rvm:
- 2.5.1
- 2.5.3
addons:
code_climate:
repo_token: $CODECLIMATE_REPO_TOKEN
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source "https://rubygems.org"
ruby ENV["CUSTOM_RUBY_VERSION"] || "2.5.1"
ruby ENV["CUSTOM_RUBY_VERSION"] || "2.5.3"

gemspec
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ GEM
simplecov
codeclimate-engine-rb (0.4.1)
virtus (~> 1.0)
codecov (0.1.10)
codecov (0.1.13)
json
simplecov
url
Expand Down Expand Up @@ -71,14 +71,14 @@ GEM
guard-yard (2.2.1)
guard (>= 1.1.0)
yard (>= 0.7.0)
i18n (1.1.0)
i18n (1.1.1)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
jaro_winkler (1.5.1)
json (2.1.0)
kramdown (1.17.0)
kwalify (0.7.2)
license_finder (5.4.1)
license_finder (5.5.2)
bundler
rubyzip
thor
Expand Down Expand Up @@ -117,7 +117,7 @@ GEM
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
reek (5.1.0)
reek (5.2.0)
codeclimate-engine-rb (~> 0.4.0)
kwalify (~> 0.7.0)
parser (>= 2.5.0.0, < 2.6, != 2.5.1.1)
Expand All @@ -128,7 +128,7 @@ GEM
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.1)
rspec-expectations (3.8.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
Expand All @@ -143,7 +143,7 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
rubocop-rspec (1.29.1)
rubocop-rspec (1.30.0)
rubocop (>= 0.58.0)
ruby-progressbar (1.10.0)
ruby_dep (1.5.0)
Expand All @@ -161,7 +161,7 @@ GEM
tins (~> 1.0)
thor (0.19.4)
thread_safe (0.3.6)
tins (1.16.3)
tins (1.17.0)
toml (0.2.0)
parslet (~> 1.8.0)
ttfunk (1.5.1)
Expand Down Expand Up @@ -206,7 +206,7 @@ DEPENDENCIES
yard (~> 0.9)

RUBY VERSION
ruby 2.5.1p57
ruby 2.5.3p105

BUNDLED WITH
1.16.5
1.16.6
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ bin/rake resume:delete_assets

## Dependencies

- Ruby 2.5.1
- Ruby 2.5.3
- I18n, Prawn and Prawn-Table (if you don't have the specific
versions of the gems, you will be prompted to install them)
- RSpec, if you want to run the specs
Expand Down
8 changes: 3 additions & 5 deletions lib/resume/cli/argument_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ def locale_option(opts)
"Select the locale of the resume "\
"(#{I18n.available_locales.join(', ')})"
) do |locale|
begin
I18n.locale = locale.to_sym
rescue I18n::InvalidLocale
raise LocaleNotSupportedError, locale
end
I18n.locale = locale.to_sym
rescue I18n::InvalidLocale
raise LocaleNotSupportedError, locale
end
end
private_class_method :locale_option
Expand Down
6 changes: 3 additions & 3 deletions lib/resume/ruby_version_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ module Resume
# @author Paul Fioravanti
module RubyVersionChecker
# Required Ruby version for resume to work
REQUIRED_RUBY_VERSION = ENV.fetch("CUSTOM_RUBY_VERSION", "2.5.1").freeze
REQUIRED_RUBY_VERSION = ENV.fetch("CUSTOM_RUBY_VERSION", "2.5.3").freeze
private_constant :REQUIRED_RUBY_VERSION
# Ruby version command
RUBY_VERSION_COMMAND = "ruby -v".freeze
private_constant :RUBY_VERSION_COMMAND
# Ruby version output regex.
# For example, this will extract `2.5.1` from a string like:
# `ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]`
# For example, this will extract `2.5.3` from a string like:
# `ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]`
RUBY_VERSION_REGEX = /\Aruby ([\d\.][^p]+)/
private_constant :RUBY_VERSION_REGEX

Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/one_sheet/header.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
################################################################################
### Instructions to generate resume:
###
### 1. Install Ruby version 2.5.1
### 1. Install Ruby version 2.5.3
###
### 2. Ensure you have an internet connection as the script needs Ruby gems
### for PDF generation, assets stored on Dropbox, and resume data
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/resume/ruby_version_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Resume
end

before do
stub_const("#{described_class}::RUBY_VERSION", "2.5.1")
stub_const("#{described_class}::RUBY_VERSION", "2.5.3")
end

context "when a LoadError occurs when loading rubygems lib" do
Expand Down
62 changes: 30 additions & 32 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,37 @@ module Resume
config.run_all_when_everything_filtered = true
config.disable_monkey_patching!
config.before(:suite) do
begin
CLI::Settings.configure
require "prawn"
require "prawn/table"
# Grab the resume background image. This serves two purposes:
# 1. Grabs the biggest image and puts it in the tmp directory
# if it"s not already there
# 2. Tests out network connection
# If the file is fetched locally, chances are high that the
# resume has already been generated once and there won"t be
# a need to fetch the resources again.
CLI::FileFetcher.fetch(
CLI::ContentParser.decode_content(
"aHR0cHM6Ly93d3cuZHJvcGJveC5jb20vcy9zZjM2OXp4OG"\
"pkYXN0Y3MvcmVzdW1lX2JhY2tncm91bmQuanBnP2RsPTE="
)
CLI::Settings.configure
require "prawn"
require "prawn/table"
# Grab the resume background image. This serves two purposes:
# 1. Grabs the biggest image and puts it in the tmp directory
# if it"s not already there
# 2. Tests out network connection
# If the file is fetched locally, chances are high that the
# resume has already been generated once and there won"t be
# a need to fetch the resources again.
CLI::FileFetcher.fetch(
CLI::ContentParser.decode_content(
"aHR0cHM6Ly93d3cuZHJvcGJveC5jb20vcy9zZjM2OXp4OG"\
"pkYXN0Y3MvcmVzdW1lX2JhY2tncm91bmQuanBnP2RsPTE="
)
rescue CLI::DependencyPrerequisiteError => error
Output.messages(error.messages)
exit(1)
rescue LoadError
Output.messages(
error: :you_need_prawn_to_run_the_specs,
warning: :please_install_them_or_run_the_resume
)
exit(1)
rescue SocketError, OpenURI::HTTPError
Output.messages(
error: :you_need_an_internet_connection_to_run_the_specs,
warning: :please_ensure_you_have_one
)
exit(1)
end
)
rescue CLI::DependencyPrerequisiteError => error
Output.messages(error.messages)
exit(1)
rescue LoadError
Output.messages(
error: :you_need_prawn_to_run_the_specs,
warning: :please_install_them_or_run_the_resume
)
exit(1)
rescue SocketError, OpenURI::HTTPError
Output.messages(
error: :you_need_an_internet_connection_to_run_the_specs,
warning: :please_ensure_you_have_one
)
exit(1)
end
end
end

0 comments on commit 325359e

Please sign in to comment.