ProMotion 2.6.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18aba155900b900206601bcf9a0758bfce9408dd
4
- data.tar.gz: 5bc594a3e0c965bfe2f15ebb88df5da5d7e88f94
3
+ metadata.gz: 285951be59aa38255b60d3acdc23efa0f83ca46e
4
+ data.tar.gz: 418446c809113d6c205700c16027b76ce3693e7b
5
5
  SHA512:
6
- metadata.gz: aac102a4899e41da994269077fba1a7a71659e35a8324981fdbb34f0d440e10d6db0a1888cfdde72131113824f7b1e988462ef6635ab1b331bd1935a20247214
7
- data.tar.gz: 49a32c00365af4338df6d3bbae82caf60a14bd0208d9a8b28b89d418e2bbc9268257c46fb1944c5dfa917e351c422b3c230ba1fe1d3f61303cf7666f6ba12f84
6
+ metadata.gz: c38eb0c246499f5a5da54b9a08595b93b3d41feff71b8b9530d0e5e5d6def216354a471513b47adf6e948878133f9fc6dfcf6e65562c130166ac31922630029b
7
+ data.tar.gz: 26b3153d167a39716c6c24253ba5bc47cf055e6457f6add54d8b2d7804d5baf8293112330cbce41db261eab0d69776ebc2f3f781cd867b2ff3321e6406ee61e4
data/README.md CHANGED
@@ -89,6 +89,17 @@ end
89
89
 
90
90
  # Changelog
91
91
 
92
+ ## Version 2.6.1
93
+
94
+ This release includes a few new features and bugfixes and is backwards compatible with all 2.x releases.
95
+
96
+ * PR #777 New Feature: Add ability to register live reload plugins
97
+ * PR #778 Bugfix: Only update search results table data if possible
98
+ * PR #779 Fix bug where remote images are not shown on first load of table screen
99
+ * PR #787 Fix Travis CI build from failing when RubyMotion is up-to-date
100
+ * PR #796 Fix iOS 10 from crashing when determining supportedInterfaceOrientations for UIImagePickerController
101
+ * Other minor bugfixes and documentation updates
102
+
92
103
  ## Version 2.6.0
93
104
 
94
105
  This release includes a few new features and bugfixes and is backwards compatible with all 2.x releases.
@@ -11,6 +11,7 @@ module ProMotion
11
11
  end
12
12
 
13
13
  def supportedInterfaceOrientations
14
+ return UIInterfaceOrientationMaskAll unless visibleViewController
14
15
  visibleViewController.supportedInterfaceOrientations
15
16
  end
16
17
 
@@ -1,13 +1,41 @@
1
1
  if RUBYMOTION_ENV == "development"
2
2
  puts "Type `pm_live` to enable ProMotion's live reload system."
3
3
  module Kernel
4
+
5
+ @live_reloaders ||= []
6
+
7
+ def register_live_reloader watcher
8
+ @live_reloaders << watcher
9
+ end
10
+
4
11
  def pm_live(opts={})
5
- @screen_watcher.stop if @screen_watcher
6
- @view_watcher.stop if @view_watcher
12
+
13
+ @watchers.each {|watcher| watcher.stop} if @watchers
14
+
7
15
  if opts == false || opts.to_s.downcase == "off"
16
+ @watchers = nil
8
17
  "Live reloading of PM screens is now off."
9
18
  else
10
- @screen_watcher = LiveReloader.new("app/screens/**/*.rb", opts).watch do |reloaded_file, new_code, class_names|
19
+ @watchers = live_reloaders.collect {|reloader| reloader.(opts)}
20
+ mp @watchers if opts[:debug]
21
+
22
+ watching = @watchers.collect {|watcher| watcher.path_query}
23
+ "Live reloading of #{watching.join(", ")} is now on."
24
+ end
25
+ end
26
+
27
+ alias_method :pm_live_screens, :pm_live
28
+
29
+
30
+ private
31
+
32
+ def live_reloaders
33
+ Kernel.instance_variable_get(:@live_reloaders)
34
+ end
35
+
36
+ def screen_watcher
37
+ lambda do | opts |
38
+ LiveReloader.new("app/screens/**/*.rb", opts).watch do |reloaded_file, new_code, class_names|
11
39
  vcs = pm_all_view_controllers(UIApplication.sharedApplication.delegate.window.rootViewController)
12
40
  vcs.each do |vc|
13
41
  if pm_is_in_ancestry?(vc, class_names)
@@ -16,8 +44,14 @@ if RUBYMOTION_ENV == "development"
16
44
  end
17
45
  end
18
46
  end
47
+ end
48
+ end
49
+
50
+ register_live_reloader screen_watcher
19
51
 
20
- @view_watcher = LiveReloader.new("app/views/**/*.rb", opts).watch do |reloaded_file, new_code, class_names|
52
+ def view_watcher
53
+ lambda do | opts |
54
+ LiveReloader.new("app/views/**/*.rb", opts).watch do |reloaded_file, new_code, class_names|
21
55
  views = pm_all_views(UIApplication.sharedApplication.delegate.window)
22
56
  views.each do |view|
23
57
  if pm_is_in_ancestry?(view, class_names)
@@ -26,14 +60,10 @@ if RUBYMOTION_ENV == "development"
26
60
  end
27
61
  end
28
62
  end
29
-
30
- "Live reloading of screens and views is now on."
31
63
  end
32
64
  end
33
- alias_method :pm_live_screens, :pm_live
34
-
35
65
 
36
- private
66
+ register_live_reloader view_watcher
37
67
 
38
68
  # Very permissive. Might get unnecessary reloads. That's okay.
39
69
  def pm_is_in_ancestry?(vc, screen_names)
@@ -77,7 +77,7 @@ module ProMotion
77
77
  self.on_memory_warning
78
78
  end
79
79
  def on_memory_warning
80
- mp "Received memory warning in #{self.inspect}. You should implement on_memory_warning in your secreen.", force_color: :red
80
+ mp "Received memory warning in #{self.inspect}. You should implement on_memory_warning in your screen.", force_color: :red
81
81
  end
82
82
 
83
83
  def on_live_reload
@@ -67,6 +67,7 @@ module ProMotion
67
67
  progress:nil,
68
68
  completed: -> image, error, cacheType, finished {
69
69
  self.imageView.image = image unless image.nil?
70
+ self.setNeedsLayout
70
71
  })
71
72
  elsif jm_image_cache?
72
73
  mp "'JMImageCache' is known to have issues with ProMotion. Please consider switching to 'SDWebImage'. 'JMImageCache' support will be deprecated in the next major version.", force_color: :yellow
@@ -117,7 +117,10 @@ module ProMotion
117
117
  else
118
118
  table_view.reloadData
119
119
  end
120
- @table_search_display_controller.searchResultsTableView.reloadData if searching?
120
+
121
+ if searching? && @table_search_display_controller.respond_to?(:searchResultsTableView)
122
+ @table_search_display_controller.searchResultsTableView.reloadData
123
+ end
121
124
  end
122
125
 
123
126
  def accessory_toggled_switch(switch)
@@ -1,3 +1,3 @@
1
1
  module ProMotion
2
- VERSION = "2.6.0" unless defined?(ProMotion::VERSION)
2
+ VERSION = "2.6.1" unless defined?(ProMotion::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ProMotion
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamon Holmgren
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-03-17 00:00:00.000000000 Z
13
+ date: 2016-10-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: methadone
@@ -213,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
213
  version: '0'
214
214
  requirements: []
215
215
  rubyforge_project:
216
- rubygems_version: 2.4.5
216
+ rubygems_version: 2.5.1
217
217
  signing_key:
218
218
  specification_version: 4
219
219
  summary: ProMotion is a fast way to get started building RubyMotion apps. Instead
@@ -255,4 +255,3 @@ test_files:
255
255
  - spec/unit/view_helper_spec.rb
256
256
  - spec/unit/view_title_screen_spec.rb
257
257
  - spec/unit/web_spec.rb
258
- has_rdoc: