Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joefiorini/drink-menu
OSX menus - the ruby way
https://github.com/joefiorini/drink-menu
Last synced: about 2 months ago
JSON representation
OSX menus - the ruby way
- Host: GitHub
- URL: https://github.com/joefiorini/drink-menu
- Owner: joefiorini
- License: mit
- Created: 2013-07-10T02:43:53.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-27T19:49:51.000Z (about 11 years ago)
- Last Synced: 2024-10-31T14:16:33.670Z (2 months ago)
- Language: Ruby
- Size: 164 KB
- Stars: 54
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# DrinkMenu
## Installation
Add this line to your application's Gemfile:
gem 'drink-menu'
And then execute:
$ bundle
Or install it yourself as:
$ gem install drink-menu
## Usage
Drink Menu separates menu layout from menu definition. Menu definition looks like:
```ruby
class MainMenu
extend DrinkMenu::MenuBuildermenuItem :progress do |item|
endmenu :sites_list, itemsFromCollection: Staticly.sitesList, titleProperty: :name
menuItem :open_site, title: 'Open Site', submenu: :sites_list
menuItem :create_site, title: 'Create Site'
menuItem :export, title: 'Export to Folder...'
menuItem :import, title: 'Import Folder as Site...'
menuItem :force_rebuild, title: 'Force Rebuild'
menuItem :about, title: 'About Staticly'
menuItem :quit, title: 'Quit'iconImage = NSImage.imageNamed "status-icon-off"
iconImage.template = trueend
```and then layout is as simple as:
```ruby
class MainMenu
extend DrinkMenu::MenuBuilderstatusBarMenu :main_menu, icon: iconImage, statusItemViewClass: StatusItemView do
open_site
create_site
___
export
import
force_rebuild
___
about
quit
endend
```See the [example](https://github.com/joefiorini/drink-menu/tree/master/examples/basic_main_menu) for basic usage. More detailed documentation & examples coming soon.
[See my recent blog post](http://joefiorini.com/posts/generating-menus-in-osx-apps-the-ruby-way) for a bit more information.
## Running the Examples
To run our example apps:
1. Clone this repo
2. From within your clone's root, run `platform=osx example=basic_main_menu rake`You can replace the value of `example` with any folder under the `examples` directory to run that example.
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request