Upgrade to ruby 2.4.1.

This commit is contained in:
Martin Edenhofer 2017-08-13 17:18:54 +02:00
parent 8f049225b1
commit 5051c9bdc5
8 changed files with 29 additions and 28 deletions

View file

@ -1 +1 @@
2.3.1 2.4.1

View file

@ -19,7 +19,7 @@ services:
- mysql - mysql
language: ruby language: ruby
rvm: rvm:
- 2.3.1 - 2.4.1
before_install: before_install:
- sudo apt-get -qq update - sudo apt-get -qq update
- sudo apt-get install -y curl git-core patch build-essential bison zlib1g-dev libssl-dev libxml2-dev libxml2-dev sqlite3 libsqlite3-dev autotools-dev libxslt1-dev libyaml-0-2 autoconf automake libreadline6-dev libyaml-dev libtool libgmp-dev libgdbm-dev libncurses5-dev pkg-config libffi-dev libmysqlclient-dev postfix - sudo apt-get install -y curl git-core patch build-essential bison zlib1g-dev libssl-dev libxml2-dev libxml2-dev sqlite3 libsqlite3-dev autotools-dev libxslt1-dev libyaml-0-2 autoconf automake libreadline6-dev libyaml-dev libtool libgmp-dev libgdbm-dev libncurses5-dev pkg-config libffi-dev libmysqlclient-dev postfix

View file

@ -1,6 +1,6 @@
source 'https://rubygems.org' source 'https://rubygems.org'
ruby '2.3.1' ruby '2.4.1'
gem 'rails', '4.2.9' gem 'rails', '4.2.9'
gem 'rails-observers' gem 'rails-observers'

View file

@ -77,12 +77,12 @@ GEM
composite_primary_keys (8.1.6) composite_primary_keys (8.1.6)
activerecord (~> 4.2.0) activerecord (~> 4.2.0)
concurrent-ruby (1.0.5) concurrent-ruby (1.0.5)
coveralls (0.8.16) coveralls (0.8.21)
json (>= 1.8, < 3) json (>= 1.8, < 3)
simplecov (~> 0.12.0) simplecov (~> 0.14.1)
term-ansicolor (~> 1.3.0) term-ansicolor (~> 1.3)
thor (~> 0.19.1) thor (~> 0.19.4)
tins (>= 1.6.0, < 2) tins (~> 1.6)
crack (0.4.3) crack (0.4.3)
safe_yaml (~> 1.0.0) safe_yaml (~> 1.0.0)
daemons (1.2.4) daemons (1.2.4)
@ -154,7 +154,7 @@ GEM
guard-symlink (0.1.1) guard-symlink (0.1.1)
guard guard
guard-compat (~> 1.1) guard-compat (~> 1.1)
hashdiff (0.3.2) hashdiff (0.3.5)
hashie (3.5.6) hashie (3.5.6)
htmlentities (4.3.4) htmlentities (4.3.4)
http (1.0.4) http (1.0.4)
@ -260,7 +260,7 @@ GEM
coderay (~> 1.1.0) coderay (~> 1.1.0)
method_source (~> 0.8.1) method_source (~> 0.8.1)
slop (~> 3.4) slop (~> 3.4)
puma (3.6.0) puma (3.9.1)
rack (1.6.8) rack (1.6.8)
rack-livereload (0.3.16) rack-livereload (0.3.16)
rack rack
@ -294,7 +294,7 @@ GEM
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
rainbow (2.2.2) rainbow (2.2.2)
rake rake
raindrops (0.17.0) raindrops (0.19.0)
rake (12.0.0) rake (12.0.0)
rb-fsevent (0.9.7) rb-fsevent (0.9.7)
rb-inotify (0.9.7) rb-inotify (0.9.7)
@ -349,16 +349,17 @@ GEM
shellany (0.0.1) shellany (0.0.1)
simple-rss (1.3.1) simple-rss (1.3.1)
simple_oauth (0.3.1) simple_oauth (0.3.1)
simplecov (0.12.0) simplecov (0.14.1)
docile (~> 1.1.0) docile (~> 1.1.0)
json (>= 1.8, < 3) json (>= 1.8, < 3)
simplecov-html (~> 0.10.0) simplecov-html (~> 0.10.0)
simplecov-html (0.10.0) simplecov-html (0.10.1)
simplecov-rcov (0.2.3) simplecov-rcov (0.2.3)
simplecov (>= 0.4.1) simplecov (>= 0.4.1)
slack-notifier (1.5.1) slack-notifier (1.5.1)
slop (3.6.0) slop (3.6.0)
spring (1.7.2) spring (2.0.2)
activesupport (>= 4.2)
spring-commands-rspec (1.0.4) spring-commands-rspec (1.0.4)
spring (>= 0.9.1) spring (>= 0.9.1)
sprockets (3.7.1) sprockets (3.7.1)
@ -371,7 +372,7 @@ GEM
sqlite3 (1.3.11) sqlite3 (1.3.11)
telegramAPI (1.2.2) telegramAPI (1.2.2)
rest-client (~> 2.0, >= 1.7.3) rest-client (~> 2.0, >= 1.7.3)
term-ansicolor (1.3.2) term-ansicolor (1.6.0)
tins (~> 1.0) tins (~> 1.0)
test-unit (3.2.1) test-unit (3.2.1)
power_assert power_assert
@ -381,7 +382,7 @@ GEM
thor (0.19.4) thor (0.19.4)
thread_safe (0.3.6) thread_safe (0.3.6)
tilt (2.0.5) tilt (2.0.5)
tins (1.13.0) tins (1.15.0)
twitter (5.17.0) twitter (5.17.0)
addressable (~> 2.3) addressable (~> 2.3)
buftok (~> 0.2.0) buftok (~> 0.2.0)
@ -401,13 +402,13 @@ GEM
unf_ext unf_ext
unf_ext (0.0.7.4) unf_ext (0.0.7.4)
unicode-display_width (1.1.1) unicode-display_width (1.1.1)
unicorn (5.2.0) unicorn (5.3.0)
kgio (~> 2.6) kgio (~> 2.6)
raindrops (~> 0.7) raindrops (~> 0.7)
valid_email2 (2.0.0) valid_email2 (2.0.0)
activemodel (>= 3.2) activemodel (>= 3.2)
mail (~> 2.5) mail (~> 2.5)
webmock (2.3.2) webmock (3.0.1)
addressable (>= 2.3.6) addressable (>= 2.3.6)
crack (>= 0.3.2) crack (>= 0.3.2)
hashdiff hashdiff
@ -500,7 +501,7 @@ DEPENDENCIES
zendesk_api zendesk_api
RUBY VERSION RUBY VERSION
ruby 2.3.1p112 ruby 2.4.1p111
BUNDLED WITH BUNDLED WITH
1.15.1 1.15.1

View file

@ -154,7 +154,7 @@ class FormController < ApplicationController
private private
def token_gen(fingerprint) def token_gen(fingerprint)
crypt = ActiveSupport::MessageEncryptor.new(Setting.get('application_secret')) crypt = ActiveSupport::MessageEncryptor.new(Setting.get('application_secret')[0, 32])
fingerprint = "#{Base64.strict_encode64(Setting.get('fqdn'))}:#{Time.zone.now.to_i}:#{Base64.strict_encode64(fingerprint)}" fingerprint = "#{Base64.strict_encode64(Setting.get('fqdn'))}:#{Time.zone.now.to_i}:#{Base64.strict_encode64(fingerprint)}"
Base64.strict_encode64(crypt.encrypt_and_sign(fingerprint)) Base64.strict_encode64(crypt.encrypt_and_sign(fingerprint))
end end
@ -166,7 +166,7 @@ class FormController < ApplicationController
return false return false
end end
begin begin
crypt = ActiveSupport::MessageEncryptor.new(Setting.get('application_secret')) crypt = ActiveSupport::MessageEncryptor.new(Setting.get('application_secret')[0, 32])
result = crypt.decrypt_and_verify(Base64.decode64(token)) result = crypt.decrypt_and_verify(Base64.decode64(token))
rescue rescue
Rails.logger.info 'Invalid token for form!' Rails.logger.info 'Invalid token for form!'

View file

@ -322,23 +322,23 @@ returns
=end =end
def destination_time(start_time, move_minutes, biz, history_data) def destination_time(start_time, move_minutes, biz, history_data)
destination_time = biz.time(move_minutes, :minutes).after(start_time) local_destination_time = biz.time(move_minutes, :minutes).after(start_time)
# go step by step to end of move_minutes until move_minutes is 0 # go step by step to end of move_minutes until move_minutes is 0
200.times.each { |_count| 200.times.each { |_count|
# check if we have pending time in the range to the destination time # check if we have pending time in the range to the destination time
working_minutes = period_working_minutes(start_time, destination_time, biz, history_data, true) working_minutes = period_working_minutes(start_time, local_destination_time, biz, history_data, true)
move_minutes -= working_minutes move_minutes -= working_minutes
# skip if no pending time is given # skip if no pending time is given
break if move_minutes <= 0 break if move_minutes <= 0
# set pending destination to start time and add pending time to destination time # set pending destination to start time and add pending time to destination time
start_time = destination_time start_time = local_destination_time
destination_time = biz.time(move_minutes, :minutes).after(start_time) local_destination_time = biz.time(move_minutes, :minutes).after(start_time)
} }
destination_time local_destination_time
end end
# get period working minutes time in minutes # get period working minutes time in minutes

View file

@ -1,4 +1,4 @@
class Fixnum class Integer
=begin =begin

View file

@ -72,7 +72,7 @@ examples how to use
return "\#{#{object_name} / no such object}" if !object_refs return "\#{#{object_name} / no such object}" if !object_refs
# if content of method is a complex datatype, just return # if content of method is a complex datatype, just return
if object_methods.empty? && object_refs.class != String && object_refs.class != Float && object_refs.class != Fixnum if object_methods.empty? && object_refs.class != String && object_refs.class != Float && object_refs.class != Integer
return "\#{#{key} / no such method}" return "\#{#{key} / no such method}"
end end
object_methods_s = '' object_methods_s = ''