From ce68f75c205d3ec507c25475618ebe39dca839a8 Mon Sep 17 00:00:00 2001 From: Derek Melchin Date: Thu, 9 Aug 2018 17:11:10 -0600 Subject: [PATCH 1/2] Update rake, Rakefile, deprecated code, and remove unused params --- Gemfile.lock | 5 ++++- Rakefile | 2 ++ app/controllers/animate_it_controller.rb | 2 +- app/views/shapes_view.rb | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ce05dc9..f5c9c9f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,13 @@ GEM remote: https://rubygems.org/ specs: - rake (10.3.2) + rake (12.3.1) PLATFORMS ruby DEPENDENCIES rake + +BUNDLED WITH + 1.16.2 diff --git a/Rakefile b/Rakefile index 3ec4202..cbe643f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- $:.unshift("/Library/RubyMotion/lib") +$:.unshift("~/.rubymotion/rubymotion-templates") + require 'motion/project/template/ios' begin diff --git a/app/controllers/animate_it_controller.rb b/app/controllers/animate_it_controller.rb index 7c48812..96ec489 100644 --- a/app/controllers/animate_it_controller.rb +++ b/app/controllers/animate_it_controller.rb @@ -3,7 +3,7 @@ def loadView self.view = ShapesView.new end - def viewDidAppear(animated) + def viewDidAppear(_) super view.addTarget(self.view, action: 'animate:', forControlEvents: UIControlEventTouchUpInside) end diff --git a/app/views/shapes_view.rb b/app/views/shapes_view.rb index 644ca03..c89c757 100644 --- a/app/views/shapes_view.rb +++ b/app/views/shapes_view.rb @@ -2,7 +2,7 @@ class ShapesView < UIButton def init super - setBackgroundColor UIColor.blackColor + backgroundColor = UIColor.blackColor # addSubview(image_view = UIImageView.new) # image_view.image = UIImage.imageNamed('title') @@ -18,7 +18,7 @@ def init self end - def animate(sender) + def animate(_) if @image_layer.opacity > 0.5 @image_layer.opacity = 0.5 @image_layer.position = [161, 235] From 665cf304581e0c0d57375f63aacf42d0104a8455 Mon Sep 17 00:00:00 2001 From: Derek Melchin Date: Thu, 23 Aug 2018 18:10:15 -0600 Subject: [PATCH 2/2] Replace needed parameter --- app/controllers/animate_it_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/animate_it_controller.rb b/app/controllers/animate_it_controller.rb index 96ec489..7c48812 100644 --- a/app/controllers/animate_it_controller.rb +++ b/app/controllers/animate_it_controller.rb @@ -3,7 +3,7 @@ def loadView self.view = ShapesView.new end - def viewDidAppear(_) + def viewDidAppear(animated) super view.addTarget(self.view, action: 'animate:', forControlEvents: UIControlEventTouchUpInside) end