diff -pruN 3.0.17-1/app/assets/javascripts/autosize/autosize.js 4.0.2-4/app/assets/javascripts/autosize/autosize.js
--- 3.0.17-1/app/assets/javascripts/autosize/autosize.js	2016-09-23 16:14:54.000000000 +0000
+++ 4.0.2-4/app/assets/javascripts/autosize/autosize.js	2018-12-30 18:05:19.000000000 +0000
@@ -1,46 +1,58 @@
 /*!
-	Autosize 3.0.17
+	autosize 4.0.2
 	license: MIT
 	http://www.jacklmoore.com/autosize
 */
 (function (global, factory) {
-	if (typeof define === 'function' && define.amd) {
-		define(['exports', 'module'], factory);
-	} else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
-		factory(exports, module);
+	if (typeof define === "function" && define.amd) {
+		define(['module', 'exports'], factory);
+	} else if (typeof exports !== "undefined") {
+		factory(module, exports);
 	} else {
 		var mod = {
 			exports: {}
 		};
-		factory(mod.exports, mod);
+		factory(mod, mod.exports);
 		global.autosize = mod.exports;
 	}
-})(this, function (exports, module) {
+})(this, function (module, exports) {
 	'use strict';
 
-	var set = typeof Set === 'function' ? new Set() : (function () {
-		var list = [];
+	var map = typeof Map === "function" ? new Map() : function () {
+		var keys = [];
+		var values = [];
 
 		return {
 			has: function has(key) {
-				return Boolean(list.indexOf(key) > -1);
+				return keys.indexOf(key) > -1;
 			},
-			add: function add(key) {
-				list.push(key);
+			get: function get(key) {
+				return values[keys.indexOf(key)];
 			},
-			'delete': function _delete(key) {
-				list.splice(list.indexOf(key), 1);
-			} };
-	})();
+			set: function set(key, value) {
+				if (keys.indexOf(key) === -1) {
+					keys.push(key);
+					values.push(value);
+				}
+			},
+			delete: function _delete(key) {
+				var index = keys.indexOf(key);
+				if (index > -1) {
+					keys.splice(index, 1);
+					values.splice(index, 1);
+				}
+			}
+		};
+	}();
 
 	var createEvent = function createEvent(name) {
-		return new Event(name);
+		return new Event(name, { bubbles: true });
 	};
 	try {
 		new Event('test');
 	} catch (e) {
 		// IE does not support `new Event()`
-		createEvent = function (name) {
+		createEvent = function createEvent(name) {
 			var evt = document.createEvent('Event');
 			evt.initEvent(name, true, false);
 			return evt;
@@ -48,10 +60,10 @@
 	}
 
 	function assign(ta) {
-		if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || set.has(ta)) return;
+		if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
 
 		var heightOffset = null;
-		var clientWidth = ta.clientWidth;
+		var clientWidth = null;
 		var cachedHeight = null;
 
 		function init() {
@@ -91,8 +103,6 @@
 			}
 
 			ta.style.overflowY = value;
-
-			resize();
 		}
 
 		function getParentOverflows(el) {
@@ -102,7 +112,8 @@
 				if (el.parentNode.scrollTop) {
 					arr.push({
 						node: el.parentNode,
-						scrollTop: el.parentNode.scrollTop });
+						scrollTop: el.parentNode.scrollTop
+					});
 				}
 				el = el.parentNode;
 			}
@@ -111,21 +122,16 @@
 		}
 
 		function resize() {
-			var originalHeight = ta.style.height;
-			var overflows = getParentOverflows(ta);
-			var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
-
-			ta.style.height = 'auto';
-
-			var endHeight = ta.scrollHeight + heightOffset;
-
 			if (ta.scrollHeight === 0) {
 				// If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
-				ta.style.height = originalHeight;
 				return;
 			}
 
-			ta.style.height = endHeight + 'px';
+			var overflows = getParentOverflows(ta);
+			var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
+
+			ta.style.height = '';
+			ta.style.height = ta.scrollHeight + heightOffset + 'px';
 
 			// used to check if an update is actually necessary on window.resize
 			clientWidth = ta.clientWidth;
@@ -143,27 +149,38 @@
 		function update() {
 			resize();
 
-			var computed = window.getComputedStyle(ta, null);
-			var computedHeight = Math.round(parseFloat(computed.height));
 			var styleHeight = Math.round(parseFloat(ta.style.height));
+			var computed = window.getComputedStyle(ta, null);
+
+			// Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
+			var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
 
-			// The computed height not matching the height set via resize indicates that
-			// the max-height has been exceeded, in which case the overflow should be set to visible.
-			if (computedHeight !== styleHeight) {
-				if (computed.overflowY !== 'visible') {
-					changeOverflow('visible');
+			// The actual height not matching the style height (set via the resize method) indicates that 
+			// the max-height has been exceeded, in which case the overflow should be allowed.
+			if (actualHeight < styleHeight) {
+				if (computed.overflowY === 'hidden') {
+					changeOverflow('scroll');
+					resize();
+					actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
 				}
 			} else {
 				// Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
 				if (computed.overflowY !== 'hidden') {
 					changeOverflow('hidden');
+					resize();
+					actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
 				}
 			}
 
-			if (cachedHeight !== computedHeight) {
-				cachedHeight = computedHeight;
+			if (cachedHeight !== actualHeight) {
+				cachedHeight = actualHeight;
 				var evt = createEvent('autosize:resized');
-				ta.dispatchEvent(evt);
+				try {
+					ta.dispatchEvent(evt);
+				} catch (err) {
+					// Firefox will throw an error on dispatchEvent for a detached element
+					// https://bugzilla.mozilla.org/show_bug.cgi?id=889376
+				}
 			}
 		}
 
@@ -173,23 +190,25 @@
 			}
 		};
 
-		var destroy = (function (style) {
+		var destroy = function (style) {
 			window.removeEventListener('resize', pageResize, false);
 			ta.removeEventListener('input', update, false);
 			ta.removeEventListener('keyup', update, false);
 			ta.removeEventListener('autosize:destroy', destroy, false);
 			ta.removeEventListener('autosize:update', update, false);
-			set['delete'](ta);
 
 			Object.keys(style).forEach(function (key) {
 				ta.style[key] = style[key];
 			});
-		}).bind(ta, {
+
+			map.delete(ta);
+		}.bind(ta, {
 			height: ta.style.height,
 			resize: ta.style.resize,
 			overflowY: ta.style.overflowY,
 			overflowX: ta.style.overflowX,
-			wordWrap: ta.style.wordWrap });
+			wordWrap: ta.style.wordWrap
+		});
 
 		ta.addEventListener('autosize:destroy', destroy, false);
 
@@ -203,30 +222,36 @@
 		window.addEventListener('resize', pageResize, false);
 		ta.addEventListener('input', update, false);
 		ta.addEventListener('autosize:update', update, false);
-		set.add(ta);
 		ta.style.overflowX = 'hidden';
 		ta.style.wordWrap = 'break-word';
 
+		map.set(ta, {
+			destroy: destroy,
+			update: update
+		});
+
 		init();
 	}
 
 	function destroy(ta) {
-		if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return;
-		var evt = createEvent('autosize:destroy');
-		ta.dispatchEvent(evt);
+		var methods = map.get(ta);
+		if (methods) {
+			methods.destroy();
+		}
 	}
 
 	function update(ta) {
-		if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return;
-		var evt = createEvent('autosize:update');
-		ta.dispatchEvent(evt);
+		var methods = map.get(ta);
+		if (methods) {
+			methods.update();
+		}
 	}
 
 	var autosize = null;
 
 	// Do nothing in Node.js environment and IE8 (or lower)
 	if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
-		autosize = function (el) {
+		autosize = function autosize(el) {
 			return el;
 		};
 		autosize.destroy = function (el) {
@@ -236,7 +261,7 @@
 			return el;
 		};
 	} else {
-		autosize = function (el, options) {
+		autosize = function autosize(el, options) {
 			if (el) {
 				Array.prototype.forEach.call(el.length ? el : [el], function (x) {
 					return assign(x, options);
@@ -258,5 +283,6 @@
 		};
 	}
 
-	module.exports = autosize;
+	exports.default = autosize;
+	module.exports = exports['default'];
 });
\ No newline at end of file
diff -pruN 3.0.17-1/debian/changelog 4.0.2-4/debian/changelog
--- 3.0.17-1/debian/changelog	2016-09-23 17:06:10.000000000 +0000
+++ 4.0.2-4/debian/changelog	2019-02-09 14:38:40.000000000 +0000
@@ -1,3 +1,46 @@
+ruby-rails-assets-autosize (4.0.2-4) unstable; urgency=medium
+
+  * Remove unnecessary dependencies
+  * Add Testsuite: autopkgtest-pkg-ruby field
+
+ -- Pirate Praveen <praveen@debian.org>  Sat, 09 Feb 2019 20:08:40 +0530
+
+ruby-rails-assets-autosize (4.0.2-3) unstable; urgency=medium
+
+  [ Utkarsh Gupta]
+  * Team upload
+  * Reupload to unstable
+
+  [ Pirate Praveen ]
+  * Remove unnecessary install and links
+
+ -- Utkarsh Gupta <guptautkarsh2102@gmail.com>  Thu, 07 Feb 2019 15:02:23 +0530
+
+ruby-rails-assets-autosize (4.0.2-2) experimental; urgency=medium
+
+  * Set minimum version of libjs-autosize
+  * Use --gem-install option of dh_ruby
+
+ -- Pirate Praveen <praveen@debian.org>  Wed, 06 Feb 2019 15:23:19 +0530
+
+ruby-rails-assets-autosize (4.0.2-1) experimental; urgency=medium
+
+  * Team upload
+  * New upstream version 4.0.2
+  * Use salsa.debian.org in Vcs-* fields
+  * Bump debhelper compatibility level to 11
+  * Bump Standards-Version to 4.3.0 (no changes needed)
+  * Move debian/watch to gemwatch.debian.net
+
+ -- Utkarsh Gupta <guptautkarsh2102@gmail.com>  Thu, 10 Jan 2019 03:39:13 +0530
+
+ruby-rails-assets-autosize (3.0.20-1) experimental; urgency=medium
+
+  * Team upload
+  * New upstream release
+
+ -- Sruthi Chandran <srud@disroot.org>  Tue, 28 Mar 2017 21:11:18 +0530
+
 ruby-rails-assets-autosize (3.0.17-1) unstable; urgency=medium
 
   * Initial release (Closes: #838686)
diff -pruN 3.0.17-1/debian/compat 4.0.2-4/debian/compat
--- 3.0.17-1/debian/compat	2016-09-23 16:21:50.000000000 +0000
+++ 4.0.2-4/debian/compat	2019-01-31 18:21:41.000000000 +0000
@@ -1 +1 @@
-9
+11
diff -pruN 3.0.17-1/debian/control 4.0.2-4/debian/control
--- 3.0.17-1/debian/control	2016-09-23 16:47:26.000000000 +0000
+++ 4.0.2-4/debian/control	2019-02-09 14:38:40.000000000 +0000
@@ -3,11 +3,12 @@ Section: ruby
 Priority: optional
 Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers@lists.alioth.debian.org>
 Uploaders: Pirate Praveen <praveen@debian.org>
-Build-Depends: debhelper (>= 9~),
-               gem2deb
-Standards-Version: 3.9.8
-Vcs-Git: https://anonscm.debian.org/git/pkg-ruby-extras/ruby-rails-assets-autosize.git
-Vcs-Browser: https://anonscm.debian.org/cgit/pkg-ruby-extras/ruby-rails-assets-autosize.git
+Build-Depends: debhelper (>= 11~),
+               gem2deb,
+               libjs-autosize (>= 4.0~)
+Standards-Version: 4.3.0
+Vcs-Git: https://salsa.debian.org/ruby-team/ruby-rails-assets-autosize.git
+Vcs-Browser: https://salsa.debian.org/ruby-team/ruby-rails-assets-autosize
 Homepage: http://www.jacklmoore.com/autosize
 Testsuite: autopkgtest-pkg-ruby
 XS-Ruby-Versions: all
@@ -16,9 +17,9 @@ Package: ruby-rails-assets-autosize
 Architecture: all
 XB-Ruby-Versions: ${ruby:Versions}
 Depends: ruby | ruby-interpreter,
-         libjs-autosize,
+         libjs-autosize (>= 4.0~),
          ${misc:Depends},
-         ${shlibs:Depends}
+         ${shlibs:Depends},
 Description: autosize javascript library for rails applications
  Provide autosize.js via rails assets pipeline.
  .
diff -pruN 3.0.17-1/debian/copyright 4.0.2-4/debian/copyright
--- 3.0.17-1/debian/copyright	2016-09-23 16:55:23.000000000 +0000
+++ 4.0.2-4/debian/copyright	2019-01-31 18:21:41.000000000 +0000
@@ -1,4 +1,4 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: rails-assets-autosize
 Source: http://www.jacklmoore.com/autosize
 
diff -pruN 3.0.17-1/debian/install 4.0.2-4/debian/install
--- 3.0.17-1/debian/install	2016-09-23 16:22:50.000000000 +0000
+++ 4.0.2-4/debian/install	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-app usr/share/ruby-rails-assets-autosize
diff -pruN 3.0.17-1/debian/patches/engine-root.patch 4.0.2-4/debian/patches/engine-root.patch
--- 3.0.17-1/debian/patches/engine-root.patch	2016-09-23 16:25:19.000000000 +0000
+++ 4.0.2-4/debian/patches/engine-root.patch	1970-01-01 00:00:00.000000000 +0000
@@ -1,10 +0,0 @@
---- a/lib/rails-assets-autosize.rb
-+++ b/lib/rails-assets-autosize.rb
-@@ -26,6 +26,7 @@
-   if defined?(Rails)
-     class Engine < ::Rails::Engine
-       # Rails -> use app/assets directory.
-+      config.root = '/usr/share/ruby-rails-assets-autosize'
-     end
-   end
- 
diff -pruN 3.0.17-1/debian/patches/series 4.0.2-4/debian/patches/series
--- 3.0.17-1/debian/patches/series	2016-09-23 16:22:56.000000000 +0000
+++ 4.0.2-4/debian/patches/series	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-engine-root.patch
diff -pruN 3.0.17-1/debian/rules 4.0.2-4/debian/rules
--- 3.0.17-1/debian/rules	2016-09-23 16:21:50.000000000 +0000
+++ 4.0.2-4/debian/rules	2019-02-09 07:14:08.000000000 +0000
@@ -1,6 +1,11 @@
 #!/usr/bin/make -f
 
+export DH_RUBY = --gem-install
 export GEM2DEB_TEST_RUNNER = --check-dependencies
 
 %:
 	dh $@ --buildsystem=ruby --with ruby
+
+override_dh_install:
+	dh_install
+	debian/symlink-js
diff -pruN 3.0.17-1/debian/symlink-js 4.0.2-4/debian/symlink-js
--- 3.0.17-1/debian/symlink-js	1970-01-01 00:00:00.000000000 +0000
+++ 4.0.2-4/debian/symlink-js	2019-02-06 09:49:58.000000000 +0000
@@ -0,0 +1,4 @@
+#!/bin/sh
+version=$(dpkg-parsechangelog -S version |cut -d'-' -f1)
+mkdir -p debian/ruby-rails-assets-autosize/usr/share/rubygems-integration/all/gems/rails-assets-autosize-${version}/app/assets/javascripts/autosize
+ln -sf /usr/share/javascript/autosize/autosize.js debian/ruby-rails-assets-autosize/usr/share/rubygems-integration/all/gems/rails-assets-autosize-${version}/app/assets/javascripts/autosize/autosize.js
diff -pruN 3.0.17-1/debian/tests/control 4.0.2-4/debian/tests/control
--- 3.0.17-1/debian/tests/control	2016-09-23 16:50:00.000000000 +0000
+++ 4.0.2-4/debian/tests/control	2019-02-09 14:38:40.000000000 +0000
@@ -1,3 +1,3 @@
 Tests: smoke-test
-Depends: @, rails, ruby-coffee-script, ruby-sqlite3, ruby-spring
+Depends: @
 Restrictions: needs-recommends
diff -pruN 3.0.17-1/debian/tests/smoke-test 4.0.2-4/debian/tests/smoke-test
--- 3.0.17-1/debian/tests/smoke-test	2016-09-23 17:03:51.000000000 +0000
+++ 4.0.2-4/debian/tests/smoke-test	2019-01-31 18:26:15.000000000 +0000
@@ -14,7 +14,7 @@ cat >> app/assets/javascripts/applicatio
 EOF
 
 cat >> Gemfile <<EOF
-gem "rails-assets-$1", "~> 3.0"
+gem "rails-assets-$1", "~> 4.0"
 EOF
 
 bundle install --local
diff -pruN 3.0.17-1/debian/watch 4.0.2-4/debian/watch
--- 3.0.17-1/debian/watch	2016-09-23 16:21:50.000000000 +0000
+++ 4.0.2-4/debian/watch	2019-01-31 18:21:41.000000000 +0000
@@ -1,2 +1,2 @@
-version=3
-http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/rails-assets-autosize .*/rails-assets-autosize-(.*).tar.gz
+version=4
+https://gemwatch.debian.net/rails-assets-autosize .*/rails-assets-autosize-(.*).tar.gz
diff -pruN 3.0.17-1/lib/rails-assets-autosize/version.rb 4.0.2-4/lib/rails-assets-autosize/version.rb
--- 3.0.17-1/lib/rails-assets-autosize/version.rb	2016-09-23 16:14:54.000000000 +0000
+++ 4.0.2-4/lib/rails-assets-autosize/version.rb	2018-12-30 18:05:19.000000000 +0000
@@ -1,3 +1,3 @@
 module RailsAssetsAutosize
-  VERSION = "3.0.17"
+  VERSION = "4.0.2"
 end
diff -pruN 3.0.17-1/rails-assets-autosize.gemspec 4.0.2-4/rails-assets-autosize.gemspec
--- 3.0.17-1/rails-assets-autosize.gemspec	2016-09-23 16:14:54.000000000 +0000
+++ 4.0.2-4/rails-assets-autosize.gemspec	2018-12-30 18:05:19.000000000 +0000
@@ -7,14 +7,16 @@ Gem::Specification.new do |spec|
   spec.name          = "rails-assets-autosize"
   spec.version       = RailsAssetsAutosize::VERSION
   spec.authors       = ["rails-assets.org"]
-  spec.description   = "Autosize is a small, stand-alone script to automatically adjust textarea height to fit text."
-  spec.summary       = "Autosize is a small, stand-alone script to automatically adjust textarea height to fit text."
-  spec.homepage      = "http://www.jacklmoore.com/autosize"
-  spec.license       = "MIT"
+  spec.description   = ""
+  spec.summary       = ""
+  spec.homepage      = "https://github.com/jackmoore/autosize"
 
   spec.files         = `find ./* -type f | cut -b 3-`.split($/)
   spec.require_paths = ["lib"]
 
+
+    spec.post_install_message = "This component doesn't define main assets in bower.json.\nPlease open new pull request in component's repository:\nhttps://github.com/jackmoore/autosize"
+
   spec.add_development_dependency "bundler", "~> 1.3"
   spec.add_development_dependency "rake"
 end
diff -pruN 3.0.17-1/rails-assets-autosize.json 4.0.2-4/rails-assets-autosize.json
--- 3.0.17-1/rails-assets-autosize.json	2016-09-23 16:14:54.000000000 +0000
+++ 4.0.2-4/rails-assets-autosize.json	2018-12-30 18:05:19.000000000 +0000
@@ -1,25 +1,23 @@
 {
   "name": "rails-assets-autosize",
   "downloads": null,
-  "version": "3.0.17",
+  "version": "4.0.2",
   "version_downloads": null,
   "platform": "ruby",
   "authors": "rails-assets.org",
-  "info": "Autosize is a small, stand-alone script to automatically adjust textarea height to fit text.",
-  
-  "licenses": "MIT",
+  "info": "",
   
   "metadata": {
 
   },
   "sha": null,
-  "project_uri": "http://www.jacklmoore.com/autosize",
+  "project_uri": "https://github.com/jackmoore/autosize",
   "gem_uri": null,
-  "homepage_uri": "http://www.jacklmoore.com/autosize",
+  "homepage_uri": "https://github.com/jackmoore/autosize",
   "wiki_uri": null,
   "documentation_uri": null,
   "mailing_list_uri": null,
-  "source_code_uri": "http://www.jacklmoore.com/autosize",
+  "source_code_uri": "https://github.com/jackmoore/autosize",
   "bug_tracker_uri": null,
   "dependencies": {
     "development": [
