everyday-menu 1.3.8 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 301c56c549cab4364ece92474413278668b7c3e6
4
- data.tar.gz: b9e7df92ea936a7f8f1ba4596d1a65015fe79f33
3
+ metadata.gz: 9c7a0c4812a6ca33d2f304c08b6e1c5953cac3de
4
+ data.tar.gz: f935a7fbbb440c749ffca010e0056edad7296397
5
5
  SHA512:
6
- metadata.gz: f3f0e9f600857da74fda0565cbcd18dca1dd7ec0870004d60d759972e3b40e27c00f558721fcc507b325545635a1a1abf0bd721cd01738263c0957cfc29fbb84
7
- data.tar.gz: 95311772c6ca1da57cf3b33e3064ddb91065990b61582eb458db55800e4cf23f1ed2485cbba340e348898a6126947c2a71805f91d01f0bd29938f2e268459ae4
6
+ metadata.gz: 1a02c392a889ae0c05019bd8fa316f1c7eddd2256abbc3c1fbdb0d2e4b023eb28f75198215ec1d38b4b404b120138e43c85f73874cfe4da5f912f9ee738349a1
7
+ data.tar.gz: bd7f6fc315156669b3ec6ab72ecbd6c8ebc95477c14a72e617491c1b400b1df94e810787a5f082442e08d8d03b03c27ce83807c368f983345592c24a2e395d82
@@ -1,4 +1,16 @@
1
1
  module EverydayMenu
2
+ class DynamicTitle
3
+ attr_accessor :title
4
+ def initialize(getter, item, title)
5
+ @getter = getter
6
+ @item = item
7
+ @title = title
8
+ @item.bind('title', toObject: self, withKeyPath: 'title', options: { 'NSContinuouslyUpdatesValue' => true })
9
+ end
10
+ def update
11
+ self.performSelectorOnMainThread('title=:', withObject: @getter.call, waitUntilDone: false)
12
+ end
13
+ end
2
14
  class MenuItem
3
15
  include MyAccessors
4
16
 
@@ -126,6 +138,19 @@ module EverydayMenu
126
138
 
127
139
  def_presets
128
140
 
141
+ my_attr_reader :dynamicTitle
142
+
143
+ def setDynamicTitle(getter)
144
+ @dynamicTitle = EverydayMenu::DynamicTitle.new(getter, self.item, self[:title])
145
+ end
146
+
147
+ alias :dynamicTitle= :setDynamicTitle
148
+ alias :dynamic_title= :setDynamicTitle
149
+
150
+ def updateDynamicTitle
151
+ @dynamicTitle.update if @dynamicTitle
152
+ end
153
+
129
154
  def runOnBuild
130
155
  onBuild.each { |block| block.call }
131
156
  end
@@ -1,3 +1,3 @@
1
1
  module EverydayMenu
2
- VERSION = '1.3.8'
2
+ VERSION = '1.4.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: everyday-menu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Henderson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-30 00:00:00.000000000 Z
11
+ date: 2014-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler