Upgrade to ruby 2.4.1.
This commit is contained in:
parent
8f049225b1
commit
5051c9bdc5
8 changed files with 29 additions and 28 deletions
|
@ -1 +1 @@
|
|||
2.3.1
|
||||
2.4.1
|
||||
|
|
|
@ -19,7 +19,7 @@ services:
|
|||
- mysql
|
||||
language: ruby
|
||||
rvm:
|
||||
- 2.3.1
|
||||
- 2.4.1
|
||||
before_install:
|
||||
- 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
|
||||
|
|
2
Gemfile
2
Gemfile
|
@ -1,6 +1,6 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
ruby '2.3.1'
|
||||
ruby '2.4.1'
|
||||
|
||||
gem 'rails', '4.2.9'
|
||||
gem 'rails-observers'
|
||||
|
|
33
Gemfile.lock
33
Gemfile.lock
|
@ -77,12 +77,12 @@ GEM
|
|||
composite_primary_keys (8.1.6)
|
||||
activerecord (~> 4.2.0)
|
||||
concurrent-ruby (1.0.5)
|
||||
coveralls (0.8.16)
|
||||
coveralls (0.8.21)
|
||||
json (>= 1.8, < 3)
|
||||
simplecov (~> 0.12.0)
|
||||
term-ansicolor (~> 1.3.0)
|
||||
thor (~> 0.19.1)
|
||||
tins (>= 1.6.0, < 2)
|
||||
simplecov (~> 0.14.1)
|
||||
term-ansicolor (~> 1.3)
|
||||
thor (~> 0.19.4)
|
||||
tins (~> 1.6)
|
||||
crack (0.4.3)
|
||||
safe_yaml (~> 1.0.0)
|
||||
daemons (1.2.4)
|
||||
|
@ -154,7 +154,7 @@ GEM
|
|||
guard-symlink (0.1.1)
|
||||
guard
|
||||
guard-compat (~> 1.1)
|
||||
hashdiff (0.3.2)
|
||||
hashdiff (0.3.5)
|
||||
hashie (3.5.6)
|
||||
htmlentities (4.3.4)
|
||||
http (1.0.4)
|
||||
|
@ -260,7 +260,7 @@ GEM
|
|||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.8.1)
|
||||
slop (~> 3.4)
|
||||
puma (3.6.0)
|
||||
puma (3.9.1)
|
||||
rack (1.6.8)
|
||||
rack-livereload (0.3.16)
|
||||
rack
|
||||
|
@ -294,7 +294,7 @@ GEM
|
|||
thor (>= 0.18.1, < 2.0)
|
||||
rainbow (2.2.2)
|
||||
rake
|
||||
raindrops (0.17.0)
|
||||
raindrops (0.19.0)
|
||||
rake (12.0.0)
|
||||
rb-fsevent (0.9.7)
|
||||
rb-inotify (0.9.7)
|
||||
|
@ -349,16 +349,17 @@ GEM
|
|||
shellany (0.0.1)
|
||||
simple-rss (1.3.1)
|
||||
simple_oauth (0.3.1)
|
||||
simplecov (0.12.0)
|
||||
simplecov (0.14.1)
|
||||
docile (~> 1.1.0)
|
||||
json (>= 1.8, < 3)
|
||||
simplecov-html (~> 0.10.0)
|
||||
simplecov-html (0.10.0)
|
||||
simplecov-html (0.10.1)
|
||||
simplecov-rcov (0.2.3)
|
||||
simplecov (>= 0.4.1)
|
||||
slack-notifier (1.5.1)
|
||||
slop (3.6.0)
|
||||
spring (1.7.2)
|
||||
spring (2.0.2)
|
||||
activesupport (>= 4.2)
|
||||
spring-commands-rspec (1.0.4)
|
||||
spring (>= 0.9.1)
|
||||
sprockets (3.7.1)
|
||||
|
@ -371,7 +372,7 @@ GEM
|
|||
sqlite3 (1.3.11)
|
||||
telegramAPI (1.2.2)
|
||||
rest-client (~> 2.0, >= 1.7.3)
|
||||
term-ansicolor (1.3.2)
|
||||
term-ansicolor (1.6.0)
|
||||
tins (~> 1.0)
|
||||
test-unit (3.2.1)
|
||||
power_assert
|
||||
|
@ -381,7 +382,7 @@ GEM
|
|||
thor (0.19.4)
|
||||
thread_safe (0.3.6)
|
||||
tilt (2.0.5)
|
||||
tins (1.13.0)
|
||||
tins (1.15.0)
|
||||
twitter (5.17.0)
|
||||
addressable (~> 2.3)
|
||||
buftok (~> 0.2.0)
|
||||
|
@ -401,13 +402,13 @@ GEM
|
|||
unf_ext
|
||||
unf_ext (0.0.7.4)
|
||||
unicode-display_width (1.1.1)
|
||||
unicorn (5.2.0)
|
||||
unicorn (5.3.0)
|
||||
kgio (~> 2.6)
|
||||
raindrops (~> 0.7)
|
||||
valid_email2 (2.0.0)
|
||||
activemodel (>= 3.2)
|
||||
mail (~> 2.5)
|
||||
webmock (2.3.2)
|
||||
webmock (3.0.1)
|
||||
addressable (>= 2.3.6)
|
||||
crack (>= 0.3.2)
|
||||
hashdiff
|
||||
|
@ -500,7 +501,7 @@ DEPENDENCIES
|
|||
zendesk_api
|
||||
|
||||
RUBY VERSION
|
||||
ruby 2.3.1p112
|
||||
ruby 2.4.1p111
|
||||
|
||||
BUNDLED WITH
|
||||
1.15.1
|
||||
|
|
|
@ -154,7 +154,7 @@ class FormController < ApplicationController
|
|||
private
|
||||
|
||||
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)}"
|
||||
Base64.strict_encode64(crypt.encrypt_and_sign(fingerprint))
|
||||
end
|
||||
|
@ -166,7 +166,7 @@ class FormController < ApplicationController
|
|||
return false
|
||||
end
|
||||
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))
|
||||
rescue
|
||||
Rails.logger.info 'Invalid token for form!'
|
||||
|
|
|
@ -322,23 +322,23 @@ returns
|
|||
=end
|
||||
|
||||
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
|
||||
200.times.each { |_count|
|
||||
|
||||
# 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
|
||||
|
||||
# skip if no pending time is given
|
||||
break if move_minutes <= 0
|
||||
|
||||
# set pending destination to start time and add pending time to destination time
|
||||
start_time = destination_time
|
||||
destination_time = biz.time(move_minutes, :minutes).after(start_time)
|
||||
start_time = local_destination_time
|
||||
local_destination_time = biz.time(move_minutes, :minutes).after(start_time)
|
||||
}
|
||||
destination_time
|
||||
local_destination_time
|
||||
end
|
||||
|
||||
# get period working minutes time in minutes
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Fixnum
|
||||
class Integer
|
||||
|
||||
=begin
|
||||
|
|
@ -72,7 +72,7 @@ examples how to use
|
|||
return "\#{#{object_name} / no such object}" if !object_refs
|
||||
|
||||
# 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}"
|
||||
end
|
||||
object_methods_s = ''
|
||||
|
|
Loading…
Reference in a new issue