Skip to content
This repository was archived by the owner on Apr 22, 2021. It is now read-only.

Commit 41d6231

Browse files
committed
Merge branch 'topic/using-new-api'
2 parents 570ccfe + 3b13299 commit 41d6231

17 files changed

+229
-1709
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ Icon
1010
# Files that might appear on external disk
1111
.Spotlight-V100
1212
.Trashes
13+
14+
workflow/.bundle
15+
workflow/bundle
16+
.ruby-version

CodeGrid Suggest.alfredworkflow

767 KB
Binary file not shown.

CodeGrid検索.alfredworkflow

-30.1 KB
Binary file not shown.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
CodeGrid検索 for [Alfred 2](http://www.alfredapp.com/)
1+
CodeGrid Suggest for [Alfred 2](http://www.alfredapp.com/)
22
========================
33

4-
[CodeGrid](https://app.codegrid.net/)の記事を検索できるAlfredのワークフローです
4+
[CodeGrid](https://app.codegrid.net/)の記事を全文検索できるAlfredのワークフローです
55

66

77
## インストール
88

9-
[CodeGrid検索.alfredworkflow](https://github.com/pxgrid/alfred-codegrid-workflow/raw/master/CodeGrid%E6%A4%9C%E7%B4%A2.alfredworkflow)をダウンロードし、ダブルクリックするとAlfredに追加されます。
9+
以前のバージョンの「CodeGrid検索」を削除してからお使いください。
10+
11+
[CodeGrid Suggest.alfredworkflow](https://github.com/pxgrid/alfred-codegrid-workflow/raw/master/CodeGrid%E6%A4%9C%E7%B4%A2.alfredworkflow)をダウンロードし、ダブルクリックするとAlfredに追加されます。
1012
※ワークフローを利用するためには、Powerpackが必要です。
1113

1214

1315
## コマンド
1416

1517
### cg 検索したいキーワード
1618

17-
![](screenshots/ss_1.png)
19+
![](screenshots/ss.png)
1820

1921
[CodeGrid](https://app.codegrid.net/)内の全ての記事から、任意のキーワードで検索することができます。
2022
アルファベットの大文字小文字は区別しません

Rakefile

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8
2+
3+
require 'yaml'
4+
require 'plist'
5+
6+
config_file = 'config.yml'
7+
8+
9+
workflow_home=File.expand_path("~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows")
10+
11+
$config = YAML.load_file(config_file)
12+
$config["bundleid"] = "#{$config["domain"]}.#{$config["id"]}"
13+
$config["plist"] = File.join($config["path"], "info.plist")
14+
$config["workflow_dbx"] = File.join(File.expand_path($config["dropbox"]), "/Alfred.alfredpreferences/workflows")
15+
16+
# import sub-rakefiles
17+
FileList['*/Rakefile'].each { |file|
18+
import file
19+
}
20+
21+
task :config do
22+
23+
info = Plist::parse_xml($config["plist"])
24+
unless info['bundleid'].eql?($config["bundleid"])
25+
info['bundleid'] = $config["bundleid"]
26+
File.open($config["plist"], "wb") { |file| file.write(info.to_plist) }
27+
end
28+
end
29+
30+
task :chdir => [:config] do
31+
chdir $config['path']
32+
end
33+
34+
desc "Install Gems"
35+
task "bundle:install" => [:chdir] do
36+
sh %Q{bundle install --standalone --clean} do |ok, res|
37+
if ! ok
38+
puts "fail to install gems (status = #{res.exitstatus})"
39+
end
40+
end
41+
end
42+
43+
desc "Update Gems"
44+
task "bundle:update" => [:chdir] do
45+
sh %Q{bundle update && bundle install --standalone --clean} do |ok, res|
46+
if ! ok
47+
puts "fail to update gems (status = #{res.exitstatus})"
48+
end
49+
end
50+
end
51+
52+
desc "Install to Alfred"
53+
task :install => [:config] do
54+
ln_sf File.expand_path($config["path"]), File.join(workflow_home, $config["bundleid"])
55+
end
56+
57+
desc "Unlink from Alfred"
58+
task :uninstall => [:config] do
59+
rm File.join(workflow_home, $config["bundleid"])
60+
end
61+
62+
desc "Install to Dropbox"
63+
task :dbxinstall => [:config] do
64+
ln_sf File.expand_path($config["path"]), File.join($config["workflow_dbx"], $config["bundleid"])
65+
end
66+
67+
desc "Unlink from Dropbox"
68+
task :dbxuninstall => [:config] do
69+
rm File.join($config["workflow_dbx"], $config["bundleid"])
70+
end
71+
72+
desc "Clean up all the extras"
73+
task :clean => [:config] do
74+
end
75+
76+
desc "Remove any generated file"
77+
task :clobber => [:clean] do
78+
rmtree File.join($config["path"], ".bundle")
79+
rmtree File.join($config["path"], "bundle")
80+
end
81+
82+

config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# bundle_id = "domain.id"
2+
# path is the relative path to the workflow in the project root
3+
---
4+
path: workflow
5+
domain: user.workflow
6+
id: codegrid-workflow
7+
# If you are using Alfred's advanced Dropbox sync, indicate the path shown in
8+
# Alfred Preferences > Advanced > Syncing:
9+
dropbox: ~/Alfred

screenshots/ss.png

61.9 KB
Loading

screenshots/ss_1.png

-61.2 KB
Binary file not shown.
12.5 KB
Loading

workflow/Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source "https://rubygems.org"
2+
3+
gem "plist"
4+
gem "alfred-workflow"
5+
gem "unicode"

0 commit comments

Comments
 (0)