Skip to content

Commit

Permalink
Upgrade to ruby 2.2
Browse files Browse the repository at this point in the history
This includes updates to gemfile and dependencies needed to get most
of the rake tasks to run.

* a newer raindrops to get it to compile against 2.2
* a newer safe_yaml so we don't get errors about Syck (which is no longer
  included in ruby 2.2)
* expicitly incude test-unit which was dropped from ruby 2.2 but rails
  stil needs.

We also include the handful of extra lint fixes needed for a ruby 2.2
app.
  • Loading branch information
h-lame committed Feb 21, 2017
1 parent 36417a0 commit a0aa440
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AllCops:
TargetRubyVersion: 2.1
TargetRubyVersion: 2.2

Lint/HandleExceptions:
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.2
2.2.4
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ gem "rack", "~> 1.4.6" # explicitly requiring patched version re: CVE-2015-3225
gem "sidekiq", "3.2.1"
gem "sidekiq-statsd", "0.1.5"
gem "unicorn", "4.8.2"
gem "raindrops", ">= 0.13.0"

if ENV["GOVSPEAK_DEV"]
gem "govspeak", path: "../govspeak"
Expand Down Expand Up @@ -67,6 +68,8 @@ group :test do
gem "webmock", "~> 1.17.4"
gem "rspec", "3.2.0"
gem "rspec-rails", "3.2.0"
# we need test-unit for rails 3.2 and ruby 2.2
gem 'test-unit'
gem "govuk-lint"
gem "simplecov"
gem "timecop"
Expand Down
12 changes: 10 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ GEM
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
polyglot (0.3.5)
power_assert (0.3.1)
powerpack (0.1.1)
pry (0.10.1)
coderay (~> 1.1.0)
Expand Down Expand Up @@ -257,7 +258,7 @@ GEM
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rainbow (2.2.1)
raindrops (0.12.0)
raindrops (0.17.0)
rake (11.2.2)
rdoc (3.12.2)
json (~> 1.4)
Expand Down Expand Up @@ -296,7 +297,7 @@ GEM
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1)
safe_yaml (1.0.1)
safe_yaml (1.0.4)
sanitize (2.1.0)
nokogiri (>= 1.4.4)
sass (3.4.5)
Expand Down Expand Up @@ -338,6 +339,8 @@ GEM
sprockets (>= 1.0.2)
state_machine (1.2.0)
statsd-ruby (1.2.1)
test-unit (3.0.8)
power_assert
thor (0.19.1)
tilt (1.4.1)
timecop (0.7.1)
Expand Down Expand Up @@ -407,6 +410,7 @@ DEPENDENCIES
quiet_assets (= 1.0.3)
rack (~> 1.4.6)
rails (= 3.2.22.3)
raindrops (>= 0.13.0)
rspec (= 3.2.0)
rspec-rails (= 3.2.0)
sass-rails (= 3.2.6)
Expand All @@ -415,7 +419,11 @@ DEPENDENCIES
sidekiq-statsd (= 0.1.5)
simplecov
sinatra
test-unit
timecop
uglifier (>= 1.3.0)
unicorn (= 4.8.2)
webmock (~> 1.17.4)

BUNDLED WITH
1.10.6
4 changes: 2 additions & 2 deletions spec/repositories/manual_repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
manual_id: manual_id,
new_or_existing_draft_edition: nil,
organisation_slug: "organisation_slug",
:"organisation_slug=" => nil,
"organisation_slug=": nil,
slug: manual_slug,
:"slug=" => nil,
"slug=": nil,
latest_edition: nil,
save!: nil,
has_ever_been_published?: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
let(:record) {
double(
:record,
:document_ids => document_ids,
:"document_ids=" => nil,
:removed_document_ids => removed_document_ids,
:"removed_document_ids=" => nil,
document_ids: document_ids,
"document_ids=": nil,
removed_document_ids: removed_document_ids,
"removed_document_ids=": nil,
)
}

Expand Down
40 changes: 20 additions & 20 deletions spec/repositories/specialist_document_repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,32 @@
let(:new_draft_edition) {
double(
:new_draft_edition,
:title => "Example document about oil reserves",
:slug => "example-document-about-oil-reserves",
:"document_id=" => nil,
:"slug=" => nil,
:changed? => true,
:save! => true,
:published? => false,
:draft? => true,
:errors => {},
:publish => nil,
:version_number => 2,
:archive => nil,
title: "Example document about oil reserves",
slug: "example-document-about-oil-reserves",
"document_id=": nil,
"slug=": nil,
changed?: true,
save!: true,
published?: false,
draft?: true,
errors: {},
publish: nil,
version_number: 2,
archive: nil,
)
}

def build_published_edition(version: 1)
double(
:published_edition,
:title => "Example document about oil reserves #{version}",
:"document_id=" => nil,
:changed? => false,
:save! => nil,
:archive => nil,
:published? => true,
:draft? => false,
:version_number => version,
title: "Example document about oil reserves #{version}",
"document_id=": nil,
changed?: false,
save!: nil,
archive: nil,
published?: true,
draft?: false,
version_number: version,
)
end

Expand Down

0 comments on commit a0aa440

Please sign in to comment.