everyday-menu 1.3.1 → 1.3.2

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: ecde95050af4b8b03e69a190253222e722f0f77a
4
- data.tar.gz: b82adf07fcfd36b697c19c5778c48d769f72f184
3
+ metadata.gz: 64bed99979e935f478282f9d6218998dad87d586
4
+ data.tar.gz: eba863b29ddba7d5e55cd8f598c2cf052657452f
5
5
  SHA512:
6
- metadata.gz: 626ea9eda4ea7313586f5c5cf01028011c4ba705322d082ffc46fd601882a158be8da8bd607343f33f66f40df7141e9f5bdb843266bc5b030a6a339b37fb53e0
7
- data.tar.gz: 3b2ef36c7849207ac7b9531dcf093338b65e208467cdab07829e7e749bbb791ccdcf2702cf003d451d22886d7d2c93d32b7192f8de8016f4e06f57c7904f140a
6
+ metadata.gz: 60622d82404f57ea187009fc47cc5f03c7363c066097c74dd9b493be72482f2255ddf170176d502399071a49e17b8a508458dc7ae1019bc63afe5562a0d7b716
7
+ data.tar.gz: bed17a9ba7e887b9f6cd66389074cc12e80a55c7682fff00d7ef2e5567d35cb56836f5381500464278bce34131bbab5cd81f001e0b76305cd4603900f13a6a1f
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in drink-menu.gemspec
3
+ # Specify your gem's dependencies in everyday-menu.gemspec
4
4
  gemspec
5
5
 
6
6
  gem 'rm-digest'
data/README.md CHANGED
@@ -20,7 +20,11 @@
20
20
  * 1.3.0:
21
21
  * Commands now get a random id if you don't give them one
22
22
  * You can now access a command by id
23
- * I now have a runtime dependency, the gem `rm-digest`, but it has the necessary objective-c code built-in, so there shouldn't be any extra work for users of `everyday-menu`
23
+ * I now have a runtime dependency, the gem `rm-digest`, but it has the necessary objective-c code built-in, so there shouldn't be any extra work for users of `everyday-menu`
24
+ * 1.3.1:
25
+ * Oops, I forgot to test outside the gem before releasing. The dependency issue should be fixed now.
26
+ * 1.3.2:
27
+ * Get tests working and add the missing `selectItem` method in `EverydayMenu::Menu`
24
28
 
25
29
  ## Issue Tracking
26
30
  Please use <https://everydayprogramminggenius.atlassian.net/browse/EM> for issue tracking.
data/Rakefile CHANGED
@@ -1,5 +1,7 @@
1
1
  $:.unshift('/Library/RubyMotion/lib')
2
2
 
3
+ ENV['platform'] = 'osx' if ARGV[0] == 'spec'
4
+
3
5
  if ENV['platform'] == 'osx'
4
6
  require 'motion/project/template/osx'
5
7
  else
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = EverydayMenu::VERSION
9
9
  spec.authors = ['Eric Henderson']
10
10
  spec.email = ['henderea@gmail.com']
11
- spec.description = %q{An easy way to define menu items and visually lay out menus for your OSX apps. Based strongly on the drink-menu gem that I couldn't get to work for me.}
11
+ spec.description = %q{An easy way to define menu items and visually lay out menus for your RubyMotion OSX apps. Based on the drink-menu gem that I couldn't get to work for me.}
12
12
  spec.summary = %q{A more ruby way to create OS X menus in RubyMotion}
13
13
  spec.homepage = 'https://github.com/henderea/everyday-menu'
14
14
  spec.license = 'MIT'
@@ -129,6 +129,11 @@ module EverydayMenu
129
129
  def items
130
130
  @menuItems
131
131
  end
132
+
133
+ def selectItem(label)
134
+ item = self.items[label]
135
+ item.execute
136
+ end
132
137
  end
133
138
 
134
139
  class MenuItemList
@@ -57,10 +57,6 @@ module EverydayMenu
57
57
  @items[id]
58
58
  end
59
59
 
60
- def last
61
- @items.last
62
- end
63
-
64
60
  def execute(sender)
65
61
  @items.values.each { |item| item.execute(sender) }
66
62
  end
@@ -1,3 +1,3 @@
1
1
  module EverydayMenu
2
- VERSION = '1.3.1'
2
+ VERSION = '1.3.2'
3
3
  end
@@ -1,9 +1,5 @@
1
- class TestMenu;
2
- extend EverydayMenu::MenuBuilder;
3
- end
4
- class TestMenu2;
5
- include EverydayMenu::MenuBuilder;
6
- end
1
+ class TestMenu; extend EverydayMenu::MenuBuilder; end
2
+ class TestMenu2; include EverydayMenu::MenuBuilder; end
7
3
 
8
4
  describe 'sugar for creating menus' do
9
5
 
@@ -39,10 +35,10 @@ describe 'sugar for creating menus' do
39
35
 
40
36
  builder.build!
41
37
 
42
- builder[:main_menu][:test_item1].should.equal item1
43
- builder[:main_menu][:test_item2].should.equal item2
38
+ builder[:main_menu].items[:test_item1].should.equal item1
39
+ builder[:main_menu].items[:test_item2].should.equal item2
44
40
 
45
- builder[:main_menu][2].is(:separator_item).should.be.true
41
+ builder[:main_menu].items[2].is(:separator_item).should.be.true
46
42
  end
47
43
 
48
44
  it 'supports generating an NSApp\'s mainMenu items' do
@@ -63,7 +59,7 @@ describe 'sugar for creating menus' do
63
59
  mainMenu = NSApp.mainMenu
64
60
 
65
61
  menuItem = mainMenu.itemArray[0]
66
- puts "menu1 title: #{menu1.title.inspect}"
62
+ puts "menu1 title: #{menu1[:title].inspect}"
67
63
  puts "menuItem title: #{menuItem.title.inspect}"
68
64
  menuItem.title.should.equal menu1[:title]
69
65
  menuItem.submenu.title.should.equal menu1[:title]
@@ -84,21 +80,21 @@ describe 'sugar for creating menus' do
84
80
  item = EverydayMenu::MenuItem.create :test_item, 'Blah'
85
81
  context = Context.new(menu, { test_item: item })
86
82
 
87
- menu[:test_item].should.be.nil
83
+ menu.items[:test_item].should.be.nil
88
84
 
89
85
  context.test_item
90
86
 
91
- menu[:test_item].should.equal item
87
+ menu.items[:test_item].should.equal item
92
88
  end
93
89
 
94
90
  it 'creates separators from ___' do
95
91
  menu = EverydayMenu::Menu.create :test, 'Test'
96
92
 
97
- menu[1].should.be.nil
93
+ menu.items[1].should.be.nil
98
94
 
99
95
  Context.new(menu).__send__ :'___'
100
96
 
101
- menu[1].is[:separator_item].should.be.true
97
+ menu.items[1].is(:separator_item).should.be.true
102
98
  end
103
99
 
104
100
  end
@@ -13,11 +13,10 @@ describe 'creating menu items' do
13
13
 
14
14
  it 'allows extra options to create method' do
15
15
  m = EverydayMenu::MenuItem.create :create_site, 'Create Site', enabled: false, tag: 1, state: NSOnState
16
- m.menuItem.title.should.equal m.title
17
- m.menuItem.isEnabled.should.equal m.isEnabled
18
- m.menuItem.tag.should.equal m.tag
19
- m.menuItem.image.should.equal m.image
20
- m.menuItem.state.should.equal m.state
16
+ m.menuItem.title.should.equal m[:title]
17
+ m.menuItem.isEnabled.should.equal m.is :enabled
18
+ m.menuItem.tag.should.equal m[:tag]
19
+ m.menuItem.state.should.equal m[:state]
21
20
  end
22
21
 
23
22
  it 'allows creating separator items' do
@@ -40,7 +40,7 @@ describe 'creating menus' do
40
40
 
41
41
  menu << item
42
42
 
43
- menu[item.label].should.equal item
43
+ menu.items[item.label].should.equal item
44
44
  end
45
45
 
46
46
  it 'allows selecting an item by its label' do
@@ -65,6 +65,6 @@ describe 'creating menus' do
65
65
 
66
66
  menu << item
67
67
 
68
- menu[1].should.equal item
68
+ menu.items[1].should.equal item
69
69
  end
70
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: everyday-menu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Henderson
@@ -53,7 +53,8 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: An easy way to define menu items and visually lay out menus for your
56
- OSX apps. Based strongly on the drink-menu gem that I couldn't get to work for me.
56
+ RubyMotion OSX apps. Based on the drink-menu gem that I couldn't get to work for
57
+ me.
57
58
  email:
58
59
  - henderea@gmail.com
59
60
  executables: []