everyday-menu 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -3
- data/everyday-menu.gemspec +2 -2
- data/examples/basic_main_menu/app_delegate.rb +1 -0
- data/examples/basic_main_menu/main_menu.rb +3 -0
- data/lib/everyday-menu/menu_item.rb +4 -2
- data/lib/everyday-menu/version.rb +1 -1
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b0f6009289b4b15bf2638913755b83aee402503
|
4
|
+
data.tar.gz: 1438b9d35fa7b9f44eb857cefea5f5389f25c634
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ae7fe4ca9e0cc70ab48239015d130d9809e6f2e43a60fcb7e20bf63967c2cc65200d1e1ac96ebf03edf77a205bbaa85f6fb765a267bac3165aa90dfe18a83d6
|
7
|
+
data.tar.gz: 338119d0d295445b7b9cd1ca4ba0f7411fbb9de7e5e471e66874017499418f66d9038c45f83a02d181256c707c085e698f350c83ac737e90833aaf13ab61de44
|
data/README.md
CHANGED
@@ -29,9 +29,6 @@
|
|
29
29
|
* 1.3.2:
|
30
30
|
* Get tests working and add the missing `selectItem` method in `EverydayMenu::Menu`
|
31
31
|
|
32
|
-
## Issue Tracking
|
33
|
-
Please use <https://everydayprogramminggenius.atlassian.net/browse/EM> for issue tracking.
|
34
|
-
|
35
32
|
## Credit
|
36
33
|
Please note that this gem is based off of Joe Fiorini's `drink-menu` gem (with a little code copy-paste and lots of test and readme copy-paste), which I couldn't get to work for me.
|
37
34
|
|
data/everyday-menu.gemspec
CHANGED
@@ -17,8 +17,8 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
21
|
-
spec.add_development_dependency 'rake', '~> 10.
|
20
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
21
|
+
spec.add_development_dependency 'rake', '~> 10.4'
|
22
22
|
#spec.add_development_dependency 'simplecov', '>= 0.8.2'
|
23
23
|
#spec.add_development_dependency 'coveralls', '>= 0.7.0'
|
24
24
|
|
@@ -9,6 +9,7 @@ class AppDelegate
|
|
9
9
|
subscribe_open
|
10
10
|
subscribe_start_stop
|
11
11
|
puts "start_stop subscribe 1 parent label: #{MainMenu[:file].items[:start_stop][:commands][:start_stop_command_id].label}"
|
12
|
+
MainMenu[:statusbar].items[:status_date].updateDynamicTitle
|
12
13
|
end
|
13
14
|
|
14
15
|
def subscribe_start_stop
|
@@ -13,6 +13,7 @@ class MainMenu
|
|
13
13
|
menuItem :close, 'Close', key_equivalent: 'w'
|
14
14
|
menuItem :start_stop, 'Start'
|
15
15
|
|
16
|
+
menuItem :status_date, 'Date: ', dynamicTitle: -> { "Date: #{NSDate.date.to_s}" }
|
16
17
|
menuItem :status_open, 'Open', key_equivalent: 'o'
|
17
18
|
menuItem :status_new, 'New'
|
18
19
|
menuItem :status_close, 'Close', key_equivalent: 'w'
|
@@ -39,6 +40,8 @@ class MainMenu
|
|
39
40
|
}
|
40
41
|
|
41
42
|
statusbarMenu(:statusbar, 'Statusbar Menu') {
|
43
|
+
status_date
|
44
|
+
___
|
42
45
|
status_new
|
43
46
|
status_open
|
44
47
|
___
|
@@ -1,11 +1,13 @@
|
|
1
1
|
module EverydayMenu
|
2
2
|
class DynamicTitle
|
3
3
|
attr_accessor :title
|
4
|
-
def initialize(getter, item, title)
|
4
|
+
def initialize(getter, item_parent, item, title)
|
5
5
|
@getter = getter
|
6
|
+
@item_parent = item_parent
|
6
7
|
@item = item
|
7
8
|
@title = title
|
8
9
|
@item.bind('title', toObject: self, withKeyPath: 'title', options: { 'NSContinuouslyUpdatesValue' => true })
|
10
|
+
@item.bind(NSEnabledBinding, toObject: @item_parent.commands, withKeyPath: 'canExecute', options: nil)
|
9
11
|
end
|
10
12
|
def update
|
11
13
|
self.performSelectorOnMainThread('title=:', withObject: @getter.call, waitUntilDone: false)
|
@@ -141,7 +143,7 @@ module EverydayMenu
|
|
141
143
|
my_attr_reader :dynamicTitle
|
142
144
|
|
143
145
|
def setDynamicTitle(getter)
|
144
|
-
@dynamicTitle = EverydayMenu::DynamicTitle.new(getter, self.item, self[:title])
|
146
|
+
@dynamicTitle = EverydayMenu::DynamicTitle.new(getter, self, self.item, self[:title])
|
145
147
|
end
|
146
148
|
|
147
149
|
alias :dynamicTitle= :setDynamicTitle
|
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.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Henderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '10.
|
33
|
+
version: '10.4'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '10.
|
40
|
+
version: '10.4'
|
41
41
|
description: An easy way to define menu items and visually lay out menus for your
|
42
42
|
RubyMotion OSX apps. Based on the drink-menu gem that I couldn't get to work for
|
43
43
|
me.
|
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
version: '0'
|
90
90
|
requirements: []
|
91
91
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.
|
92
|
+
rubygems_version: 2.4.5
|
93
93
|
signing_key:
|
94
94
|
specification_version: 4
|
95
95
|
summary: A more ruby way to create OS X menus in RubyMotion
|
@@ -97,4 +97,3 @@ test_files:
|
|
97
97
|
- spec/menu_builder_spec.rb
|
98
98
|
- spec/menu_item_spec.rb
|
99
99
|
- spec/menu_spec.rb
|
100
|
-
has_rdoc:
|