Skip to content

Commit a5eedad

Browse files
authored
Merge pull request #54 from github/upgrade-ruby-and-rails
Bump to rails 6 and ruby 2.7
2 parents ac72188 + 4406cd2 commit a5eedad

136 files changed

Lines changed: 15 additions & 15 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ruby.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v1
12-
- name: Set up Ruby 2.5.7
13-
uses: actions/setup-ruby@v1
11+
- uses: actions/checkout@v2
12+
- name: Set up Ruby 2.7.2
13+
uses: ruby/setup-ruby@v1
1414
with:
15-
ruby-version: 2.5.7
15+
ruby-version: 2.7.2
1616
- name: Build and test
1717
run: |
18-
gem install bundler:1.16.1
1918
bundle install --binstubs
2019
bin/rspec

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.5.7
1+
2.7.1

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

3-
gem 'rails', '~> 4.0'
3+
gem 'rails'
44

55
group :development, :test do
66
gem "rspec-rails", "~> 3"

chatops-controller.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Gem::Specification.new do |s|
1717
s.files = Dir["{app,config,db,lib}/**/*", "README.md"]
1818
s.test_files = Dir["spec/**/*"]
1919

20-
s.add_dependency "rails", ">= 4.0"
20+
s.add_dependency "actionpack", ">= 6.0"
21+
s.add_dependency "activesupport", ">= 6.0"
2122

2223
s.add_development_dependency "rspec-rails", "~> 3"
2324
s.add_development_dependency "pry", "~> 0"

lib/chatops/controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def jsonrpc_params
6666

6767
def json_body
6868
hash = {}
69-
if request.content_type =~ %r/\Aapplication\/json\Z/i
69+
if request.content_mime_type == Mime[:json]
7070
hash = ActiveSupport::JSON.decode(request.raw_post) || {}
7171
end
7272
hash.with_indifferent_access

spec/dummy/config/environments/test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
config.eager_load = false
1414

1515
# Configure static file server for tests with Cache-Control for performance.
16-
if Rails.version.starts_with?("5")
17-
config.public_file_server.enabled = true
18-
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
19-
else
16+
if Rails.version.start_with?("4")
2017
config.serve_static_files = true
2118
config.static_cache_control = 'public, max-age=3600'
19+
else
20+
config.public_file_server.enabled = true
21+
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
2222
end
2323

2424
# Show full error reports and disable caching.

spec/dummy/config/initializers/assets.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Be sure to restart your server when you modify this file.
22

33
# Version of your assets, change this if you want to expire all your assets.
4-
if Rails.version.starts_with?("4")
4+
if Rails.version.start_with?("4")
55
Rails.application.config.assets.version = '1.0'
66
end
77

spec/lib/chatops/controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def ensure_app_given
6060
end
6161

6262
def rails_flexible_post(path, outer_params, jsonrpc_params = nil)
63-
if Rails.version.starts_with?("4")
63+
if Rails.version.start_with?("4")
6464
post path, outer_params.merge("params" => jsonrpc_params)
6565
else
6666
jsonrpc_params ||= {}
-40 KB
Binary file not shown.

vendor/cache/actioncable-6.1.1.gem

40.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)