osx-status-bar-app-template 0.0.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 +15 -0
- data/.gitignore +1 -0
- data/README.md +40 -0
- data/Rakefile +11 -0
- data/osx-status-bar-app-template.gemspec +26 -0
- data/template/osx-status-bar-app/.gitignore +16 -0
- data/template/osx-status-bar-app/files/Gemfile +4 -0
- data/template/osx-status-bar-app/files/Rakefile.erb +15 -0
- data/template/osx-status-bar-app/files/app/app_delegate.rb +29 -0
- data/template/osx-status-bar-app/files/resources/Credits.rtf +29 -0
- data/template/osx-status-bar-app/files/spec/main_spec.rb.erb +13 -0
- metadata +58 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MDJjMTI0ODI0Yzk2MzY3NDRhYzM5MzRkMzU5Mzc2MTQ2OTE1ZGQ3ZQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MDdiOGJmNTUyZWIzZmQ0ZWVhYWRkYzExNjRmMmM3NzJiN2ZmMGFkYQ==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MjhiZDMyYTBiNmUwODUyYzJmNmJlNjRlMjVmOTE4NWY1NDJkNWI5N2JjMGJm
|
10
|
+
NGU3OWIwYTE3Y2Q1YjIzYjRlYzM1ZmJhY2U4YjA1NTMzMTg1NzAxMDQwNDEw
|
11
|
+
NjIwNzJjNWM1NGYyNmJkNmRkMGVlNjAwNTVkZWQ3ZmRkZmJlNDQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZTdlNDRjMGFmYWQwZGRlNWQzZjIyYmMwZDM5M2EyYTdlNmQwYzEyODc0OGE4
|
14
|
+
NzRhNWRiOGYzMmZkNjVjMjk0NmU0YzdkYmExNTMwMTU3NmIwOWMxNzcyNmZi
|
15
|
+
MGE5MzNlZmM4OGZhNTI3MGE3OWUyMWFiY2NlZDcyZTRkOTNkYjM=
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
osx-status-bar-app-template-*.gem
|
data/README.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# osx-status-bar-app-template
|
2
|
+
|
3
|
+
A RubyMotion template to allow you to quickly create a new OS X status bar app using RubyMotion.
|
4
|
+
|
5
|
+
## Requirements
|
6
|
+
|
7
|
+
* RubyMotion 2.0+
|
8
|
+
* RubyGems
|
9
|
+
|
10
|
+
## Setup
|
11
|
+
|
12
|
+
* gem install osx-status-bar-app-template
|
13
|
+
* motion create --template=osx-status-bar-app <app-name>
|
14
|
+
|
15
|
+
## Contributors
|
16
|
+
|
17
|
+
* Elliott Draper
|
18
|
+
|
19
|
+
## License
|
20
|
+
|
21
|
+
Copyright 2013 Elliott Draper <el@kickcode.com>
|
22
|
+
|
23
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
24
|
+
a copy of this software and associated documentation files (the
|
25
|
+
"Software"), to deal in the Software without restriction, including
|
26
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
27
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
28
|
+
permit persons to whom the Software is furnished to do so, subject to
|
29
|
+
the following conditions:
|
30
|
+
|
31
|
+
The above copyright notice and this permission notice shall be
|
32
|
+
included in all copies or substantial portions of the Software.
|
33
|
+
|
34
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
35
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
36
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
37
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
38
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
39
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
40
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
task :default do
|
4
|
+
destination = File.join(File.expand_path("~/Library/RubyMotion/template"), "osx-status-bar-app")
|
5
|
+
source = File.join(File.expand_path(File.dirname(__FILE__)), "template", "osx-status-bar-app")
|
6
|
+
|
7
|
+
FileUtils.mkdir_p(File.dirname(destination))
|
8
|
+
FileUtils.rm_rf destination
|
9
|
+
|
10
|
+
FileUtils.ln_s source, destination
|
11
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Gem::Specification.new do |gem|
|
2
|
+
gem.name = "osx-status-bar-app-template"
|
3
|
+
gem.version = "0.0.1"
|
4
|
+
gem.date = "2013-10-17"
|
5
|
+
gem.summary = "OS X Status Bar App Template for RubyMotion"
|
6
|
+
gem.description = "A RubyMotion app template to quickly start a new OS X status bar app"
|
7
|
+
gem.authors = ["Elliott Draper"]
|
8
|
+
gem.email = "el@kickcode.com"
|
9
|
+
gem.files = `git ls-files`.split($\)
|
10
|
+
gem.license = "MIT"
|
11
|
+
gem.extensions = ["Rakefile"]
|
12
|
+
gem.post_install_message =<<POST_INSTALL
|
13
|
+
|
14
|
+
* osx-status-bar-app-template *
|
15
|
+
|
16
|
+
Thanks for installing this gem, now you can create a new
|
17
|
+
OS X status bar app using RubyMotion by running:
|
18
|
+
|
19
|
+
motion create --template=osx-status-bar-app <app-name>
|
20
|
+
|
21
|
+
This will create you a status bar only app, with example
|
22
|
+
menu items to trigger the about window, to show off a
|
23
|
+
custom action, and to quit the app.
|
24
|
+
|
25
|
+
POST_INSTALL
|
26
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
$:.unshift("/Library/RubyMotion/lib")
|
3
|
+
require 'motion/project/template/osx'
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'bundler'
|
7
|
+
Bundler.require
|
8
|
+
rescue LoadError
|
9
|
+
end
|
10
|
+
|
11
|
+
Motion::Project::App.setup do |app|
|
12
|
+
# Use `rake config' to see complete project settings.
|
13
|
+
app.name = '<%= name %>'
|
14
|
+
app.info_plist['LSUIElement'] = true
|
15
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class AppDelegate
|
2
|
+
attr_accessor :status_menu
|
3
|
+
|
4
|
+
def applicationDidFinishLaunching(notification)
|
5
|
+
@app_name = NSBundle.mainBundle.infoDictionary['CFBundleDisplayName']
|
6
|
+
|
7
|
+
@status_menu = NSMenu.new
|
8
|
+
|
9
|
+
@status_item = NSStatusBar.systemStatusBar.statusItemWithLength(NSVariableStatusItemLength).init
|
10
|
+
@status_item.setMenu(@status_menu)
|
11
|
+
@status_item.setHighlightMode(true)
|
12
|
+
@status_item.setTitle(@app_name)
|
13
|
+
|
14
|
+
@status_menu.addItem createMenuItem("About #{@app_name}", 'orderFrontStandardAboutPanel:')
|
15
|
+
@status_menu.addItem createMenuItem("Custom Action", 'pressAction')
|
16
|
+
@status_menu.addItem createMenuItem("Quit", 'terminate:')
|
17
|
+
end
|
18
|
+
|
19
|
+
def createMenuItem(name, action)
|
20
|
+
NSMenuItem.alloc.initWithTitle(name, action: action, keyEquivalent: '')
|
21
|
+
end
|
22
|
+
|
23
|
+
def pressAction
|
24
|
+
alert = NSAlert.alloc.init
|
25
|
+
alert.setMessageText "Action triggered from status bar menu"
|
26
|
+
alert.addButtonWithTitle "OK"
|
27
|
+
alert.runModal
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
|
2
|
+
{\colortbl;\red255\green255\blue255;}
|
3
|
+
\paperw9840\paperh8400
|
4
|
+
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
|
5
|
+
|
6
|
+
\f0\b\fs24 \cf0 Engineering:
|
7
|
+
\b0 \
|
8
|
+
Some people\
|
9
|
+
\
|
10
|
+
|
11
|
+
\b Human Interface Design:
|
12
|
+
\b0 \
|
13
|
+
Some other people\
|
14
|
+
\
|
15
|
+
|
16
|
+
\b Testing:
|
17
|
+
\b0 \
|
18
|
+
Hopefully not nobody\
|
19
|
+
\
|
20
|
+
|
21
|
+
\b Documentation:
|
22
|
+
\b0 \
|
23
|
+
Whoever\
|
24
|
+
\
|
25
|
+
|
26
|
+
\b With special thanks to:
|
27
|
+
\b0 \
|
28
|
+
Mom\
|
29
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
describe "Application '<%= name %>'" do
|
2
|
+
before do
|
3
|
+
@app = NSApplication.sharedApplication
|
4
|
+
end
|
5
|
+
|
6
|
+
it "has a status menu" do
|
7
|
+
@app.delegate.status_menu.nil?.should == false
|
8
|
+
end
|
9
|
+
|
10
|
+
it "has three menu items" do
|
11
|
+
@app.delegate.status_menu.itemArray.length.should == 3
|
12
|
+
end
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: osx-status-bar-app-template
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Elliott Draper
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-10-17 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A RubyMotion app template to quickly start a new OS X status bar app
|
14
|
+
email: el@kickcode.com
|
15
|
+
executables: []
|
16
|
+
extensions:
|
17
|
+
- Rakefile
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- .gitignore
|
21
|
+
- README.md
|
22
|
+
- Rakefile
|
23
|
+
- osx-status-bar-app-template.gemspec
|
24
|
+
- template/osx-status-bar-app/.gitignore
|
25
|
+
- template/osx-status-bar-app/files/Gemfile
|
26
|
+
- template/osx-status-bar-app/files/Rakefile.erb
|
27
|
+
- template/osx-status-bar-app/files/app/app_delegate.rb
|
28
|
+
- template/osx-status-bar-app/files/resources/Credits.rtf
|
29
|
+
- template/osx-status-bar-app/files/spec/main_spec.rb.erb
|
30
|
+
homepage:
|
31
|
+
licenses:
|
32
|
+
- MIT
|
33
|
+
metadata: {}
|
34
|
+
post_install_message: ! "\n * osx-status-bar-app-template *\n\n Thanks for installing
|
35
|
+
this gem, now you can create a new \n OS X status bar app using RubyMotion by running:\n\n
|
36
|
+
\ motion create --template=osx-status-bar-app <app-name>\n\n This will create you
|
37
|
+
a status bar only app, with example\n menu items to trigger the about window, to
|
38
|
+
show off a\n custom action, and to quit the app.\n\n"
|
39
|
+
rdoc_options: []
|
40
|
+
require_paths:
|
41
|
+
- lib
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ! '>='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
requirements: []
|
53
|
+
rubyforge_project:
|
54
|
+
rubygems_version: 2.0.7
|
55
|
+
signing_key:
|
56
|
+
specification_version: 4
|
57
|
+
summary: OS X Status Bar App Template for RubyMotion
|
58
|
+
test_files: []
|