Permalink
Browse files

[Release]( V1.0 / search for source tree repositories )

  • Loading branch information...
0 parents commit 6509833c9bec495c4aedea6f64c9c630ac7ca30c @zhaocai committed Mar 29, 2013
@@ -0,0 +1,4 @@
+top/bundle
+top/.bundle
+workflow/.bundle
+workflow/bundle
@@ -0,0 +1 @@
+system
@@ -0,0 +1,95 @@
+# Alfred 2 Source Tree Workflow
+
+Alfred 2 Workflow to list, search, and open [Source Tree](http://www.sourcetreeapp.com/ "SourceTree") repositories in [Alfred](http://www.alfredapp.com/ "Alfred App - Productivity App for Mac OS X").
+
+
+
+
+
+
+
+## Usage
+
+### A. Keywords:
+
+1. `st`: List and query source tree repositories.
+3. `stbookmark`: Open query to source bookmark window.
+
+
+### B. Modifier Key
+
+4. `alt` : Browser in Alfred
+
+
+
+## Installation
+
+Two ways are provided:
+
+1. You can download the [Source Tree.alfredworkflow](https://github.com/zhaocai/alfred2-sourcetree-workflow/raw/master/Source%20Tree.alfredworkflow) and import to Alfred 2. This method is suitable for **regular users**.
+
+2. You can `git clone` or `fork` this repository and use `rake install` and `rake uninstall` to install. Check `rake -T` for available tasks.
+This method create a symlink to the alfred workflow directory: "~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows". This method is suitable for **developers**.
+
+
+## Copyright
+
+Copyright (c) 2013 Zhao Cai <caizhaoff@gmail.com>
+
+This program is free software: you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation, either version 3 of the License, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+# Alfred 2 Source Tree Workflow
+
+Alfred 2 Workflow to list, search, and open [Source Tree][!g sourcetree] repositories in [Alfred](!g "alfred app" )
+
+## Usage
+
+### A. Keywords:
+
+1. `st`: List and query source tree repositories.
+3. `stbookmark`: Open query to source bookmark window.
+
+
+### B. Modifier Key
+
+4. `alt` : Browser in Alfred
+
+
+
+## Installation
+
+Two ways are provided:
+
+1. You can download the [Source Tree.alfredworkflow](https://github.com/zhaocai/alfred2-sourcetree-workflow/raw/master/Source%20Tree.alfredworkflow) and import to Alfred 2. This method is suitable for **regular users**.
+
+2. You can `git clone` or `fork` this repository and use `rake install` and `rake uninstall` to install. Check `rake -T` for available tasks.
+This method create a symlink to the alfred workflow directory: "~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows". This method is suitable for **developers**.
+
+
+## Copyright
+
+Copyright (c) 2013 Zhao Cai <caizhaoff@gmail.com>
+
+This program is free software: you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation, either version 3 of the License, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <http://www.gnu.org/licenses/>.
+
@@ -0,0 +1,65 @@
+require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8
+
+require 'yaml'
+require 'plist'
+
+config_file = 'config.yml'
+
+workflow_home=File.expand_path("~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows")
+
+task :config do
+ $config = YAML.load_file(config_file)
+ $config["bundleid"] = "#{$config["domain"]}.#{$config["id"]}"
+ $config["plist"] = File.join($config["path"], "info.plist")
+
+ info = Plist::parse_xml($config["plist"])
+ unless info['bundleid'].eql?($config["bundleid"])
+ info['bundleid'] = $config["bundleid"]
+ File.open($config["plist"], "wb") { |file| file.write(info.to_plist) }
+ end
+end
+
+task :chdir => [:config] do
+ chdir $config['path']
+end
+
+desc "Install Gems"
+task "bundle:install" => [:chdir] do
+ sh %Q{bundle install --standalone --clean} do |ok, res|
+ if ! ok
+ puts "fail to install gems (status = #{res.exitstatus})"
+ end
+ end
+end
+
+desc "Update Gems"
+task "bundle:update" => [:chdir] do
+ sh %Q{bundle update && bundle install --standalone --clean} do |ok, res|
+ if ! ok
+ puts "fail to update gems (status = #{res.exitstatus})"
+ end
+ end
+end
+
+desc "Install to Alfred"
+task :install => [:config] do
+ ln_sf File.expand_path($config["path"]), File.join(workflow_home, $config["bundleid"])
+end
+
+desc "Unlink from Alfred"
+task :uninstall => [:config] do
+ rm File.join(workflow_home, $config["bundleid"])
+end
+
+
+
+
+desc "Clean up all the extras"
+task :clean => [:config] do
+end
+
+desc "Remove any generated file"
+task :clobber => [:clean] do
+ rmtree File.join($config["path"], ".bundle")
+ rmtree File.join($config["path"], "bundle")
+end
Binary file not shown.
@@ -0,0 +1,5 @@
+--- # bundle id = domain.id
+path: workflow
+domain: me.zhaowu
+id: sourcetree
+
@@ -0,0 +1,5 @@
+{
+ "version": 1.0,
+ "download_uri": "https://github.com/zhaocai/alfred2-sourcetree-workflow/raw/master/Source%20Tree.alfredworkflow",
+ "description": "initial working version"
+}
@@ -0,0 +1,5 @@
+source "https://rubygems.org"
+
+gem "plist"
+gem "logging"
+gem "alfred-workflow"
@@ -0,0 +1,20 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ alfred-workflow (1.2.7)
+ logging (~> 1.8.0)
+ plist (~> 3.1.0)
+ little-plugger (1.1.3)
+ logging (1.8.1)
+ little-plugger (>= 1.1.3)
+ multi_json (>= 1.3.6)
+ multi_json (1.7.2)
+ plist (3.1.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ alfred-workflow
+ logging
+ plist
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>bundleid</key>
+ <string>me.zhaowu.sourcetree</string>
+ <key>connections</key>
+ <dict>
+ <key>63F60794-BB56-4415-9372-BAF974C3A7E1</key>
+ <array>
+ <dict>
+ <key>destinationuid</key>
+ <string>8B74B3B5-ED11-4B5E-9567-2C95E6B59F0B</string>
+ <key>modifiers</key>
+ <integer>524288</integer>
+ <key>modifiersubtext</key>
+ <string>Browser in Alfred</string>
+ </dict>
+ <dict>
+ <key>destinationuid</key>
+ <string>4E735E86-4A11-42ED-A01D-86FFE0FB7E09</string>
+ <key>modifiers</key>
+ <integer>0</integer>
+ <key>modifiersubtext</key>
+ <string></string>
+ </dict>
+ </array>
+ <key>76ED402A-138E-4714-8B00-C470579950FE</key>
+ <array>
+ <dict>
+ <key>destinationuid</key>
+ <string>DB55BBC7-595C-4E83-ABBE-60355155A4B3</string>
+ <key>modifiers</key>
+ <integer>0</integer>
+ <key>modifiersubtext</key>
+ <string></string>
+ </dict>
+ </array>
+ </dict>
+ <key>createdby</key>
+ <string>Zhao Cai</string>
+ <key>description</key>
+ <string>Get SourceTree Repository</string>
+ <key>disabled</key>
+ <false/>
+ <key>name</key>
+ <string>Source Tree</string>
+ <key>objects</key>
+ <array>
+ <dict>
+ <key>config</key>
+ <dict/>
+ <key>type</key>
+ <string>alfred.workflow.action.browseinalfred</string>
+ <key>uid</key>
+ <string>8B74B3B5-ED11-4B5E-9567-2C95E6B59F0B</string>
+ </dict>
+ <dict>
+ <key>config</key>
+ <dict>
+ <key>applescript</key>
+ <string>on alfred_script(q) activate application "SourceTree" tell application "System Events" tell process "SourceTree" keystroke "b" using command down set value of text field 1 of group 1 of tool bar 1 of window "Bookmarks" to q as text click button 1 of text field 1 of group 1 of tool bar 1 of window "Bookmarks" set frontmost to true end tell end tellend alfred_script</string>
+ <key>cachescript</key>
+ <true/>
+ </dict>
+ <key>type</key>
+ <string>alfred.workflow.action.applescript</string>
+ <key>uid</key>
+ <string>DB55BBC7-595C-4E83-ABBE-60355155A4B3</string>
+ </dict>
+ <dict>
+ <key>config</key>
+ <dict>
+ <key>escaping</key>
+ <integer>4</integer>
+ <key>script</key>
+ <string>open -a SourceTree "{query}";</string>
+ <key>type</key>
+ <integer>0</integer>
+ </dict>
+ <key>type</key>
+ <string>alfred.workflow.action.script</string>
+ <key>uid</key>
+ <string>4E735E86-4A11-42ED-A01D-86FFE0FB7E09</string>
+ </dict>
+ <dict>
+ <key>config</key>
+ <dict>
+ <key>argumenttype</key>
+ <integer>0</integer>
+ <key>escaping</key>
+ <integer>62</integer>
+ <key>keyword</key>
+ <string>st</string>
+ <key>runningsubtext</key>
+ <string>search for SourceTree Repositories ...</string>
+ <key>script</key>
+ <string>/usr/bin/ruby ./main.rb {query}</string>
+ <key>subtext</key>
+ <string>Open Repository in SourceTree</string>
+ <key>title</key>
+ <string>Search SourceTree for '{query}'</string>
+ <key>type</key>
+ <integer>0</integer>
+ <key>withspace</key>
+ <true/>
+ </dict>
+ <key>type</key>
+ <string>alfred.workflow.input.scriptfilter</string>
+ <key>uid</key>
+ <string>63F60794-BB56-4415-9372-BAF974C3A7E1</string>
+ </dict>
+ <dict>
+ <key>config</key>
+ <dict>
+ <key>argumenttype</key>
+ <integer>0</integer>
+ <key>keyword</key>
+ <string>stbookmark</string>
+ <key>subtext</key>
+ <string>in Source Tree Bookmark Window</string>
+ <key>text</key>
+ <string>Search Source Tree for '{query}'</string>
+ <key>withspace</key>
+ <true/>
+ </dict>
+ <key>type</key>
+ <string>alfred.workflow.input.keyword</string>
+ <key>uid</key>
+ <string>76ED402A-138E-4714-8B00-C470579950FE</string>
+ </dict>
+ </array>
+ <key>readme</key>
+ <string></string>
+ <key>uidata</key>
+ <dict>
+ <key>4E735E86-4A11-42ED-A01D-86FFE0FB7E09</key>
+ <dict>
+ <key>ypos</key>
+ <real>190</real>
+ </dict>
+ <key>63F60794-BB56-4415-9372-BAF974C3A7E1</key>
+ <dict>
+ <key>ypos</key>
+ <real>190</real>
+ </dict>
+ <key>76ED402A-138E-4714-8B00-C470579950FE</key>
+ <dict>
+ <key>ypos</key>
+ <real>310</real>
+ </dict>
+ <key>8B74B3B5-ED11-4B5E-9567-2C95E6B59F0B</key>
+ <dict>
+ <key>ypos</key>
+ <real>40</real>
+ </dict>
+ <key>DB55BBC7-595C-4E83-ABBE-60355155A4B3</key>
+ <dict>
+ <key>ypos</key>
+ <real>390</real>
+ </dict>
+ </dict>
+ <key>webaddress</key>
+ <string>https://github.com/zhaocai/alfred2-sourcetree-workflow</string>
+</dict>
+</plist>
Oops, something went wrong.

0 comments on commit 6509833

Please sign in to comment.