launchy-opensearch 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,12 @@
1
+ <SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
2
+ <os:ShortName>Discogs</os:ShortName>
3
+ <os:Description>Discogs search all</os:Description>
4
+ <os:InputEncoding>UTF-8</os:InputEncoding>
5
+ <os:Image width="16" height="16">data:image/x-icon;base64,AAABAAIAEBAAAAAAAABoAwAAJgAAACAgAAAAAAAAqAwAAI4DAAAoAAAAEAAAACAAAAABABgAAAAAAEADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAa3N7a3N7a3N7a3N7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAa3N7QkJCQkJCKTk5EBAQEBAQAAAAEBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAQkJCvcbGa3N7QkJCISkpEBAQEBAQAAAAAAAAEBAQAAAAAAAAAAAAAAAAAAAAISkpQkJCa3N7vcbGa3N7ISkpEBAQEBAQAAAAAAAAAAAAEBAQAAAAAAAAAAAAISkpKTk5QkJCQkJCa3N7a3N7KTk5ISkpEBAQAAAAAAAAAAAAAAAAISkpAAAAAAAAEBAQISkpISkpKTk5KTk5EBAQGGNrGGNrCAgICAgIAAAAAAAAAAAAAAAAAAAAa3N7AAAAEBAQEBAQEBAQEBAQAMbWAMbWAMbWAMbWCAgIAAAAAAAAAAAAAAAAa3N7a3N7AAAAAAAAAAAAAAgIGGNrAMbWAMbWAMbWAMbWGGNrAAAAAAAAAAAAAAAAa3N7a3N7AAAAAAAAAAAAAAAAGGNrAMbWAMbWAMbWAMbWGGNrEBAQEBAQEBAQEBAQa3N7a3N7AAAAAAAAAAAAAAAAEBAQAMbWAMbWAMbWAMbWEBAQISkpISkpEBAQEBAQa3N7AAAAEBAQAAAAAAAAAAAAAAAAEBAQGGNrGGNrEBAQQkJCQkJCISkpISkpISkpAAAAAAAAQkJ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AAAAAAAAAAAYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgxMTExMTExMTExMTEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAxMTEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAxMTEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABaY2NKSkpKSkpKSkpKSkpaY2MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/8A///4AB//4AAH/8AAA/8AAAD/AAAA/gAAAHwAAAA8AAAAOAAAABgAAAAYAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAYAAAAGAAAABwAAAA8AAAAPgAAAH8AAAD/AAAA/4AAAf/gAAf/8AAP//wAP///gf/w==</os:Image>
6
+ <UpdateInterval>7</UpdateInterval>
7
+ <UpdateUrl>http://mycroft.mozdev.org/updateos.php/id0/discogs.xml</UpdateUrl>
8
+ <IconUpdateUrl>http://mycroft.mozdev.org/updateos.php/id0/discogs.ico</IconUpdateUrl>
9
+ <SearchForm>http://www.discogs.com/</SearchForm>
10
+ <os:Url type="text/html" method="GET" template="http://www.discogs.com/search?type=all&amp;q={searchTerms}&amp;btn=Search">
11
+ </os:Url>
12
+ </SearchPlugin>
@@ -0,0 +1,60 @@
1
+ [GenOps]
2
+ skin=/usr/share/launchy/skins/Default
3
+
4
+ [General]
5
+ donateTime=@Variant(\0\0\0\x10\0%u\x85\x2\a\xe3L\xff)
6
+ version=212
7
+
8
+ [runner]
9
+ cmds\1\name=cmd
10
+ cmds\1\file=/usr/bin/xterm
11
+ cmds\1\args=-hold -e $$
12
+ cmds\size=1
13
+ version=2
14
+
15
+ [weby]
16
+ sites\1\name=Google
17
+ sites\1\base=http://www.google.com/
18
+ sites\1\query="search?source=launchy&q=%s"
19
+ sites\1\default=true
20
+ sites\2\name=Live Search
21
+ sites\2\base=http://search.live.com/
22
+ sites\2\query="results.aspx?q=%s"
23
+ sites\3\name=Yahoo
24
+ sites\3\base=http://search.yahoo.com/
25
+ sites\3\query="search?p=%s"
26
+ sites\4\name=MSN
27
+ sites\4\base=http://search.msn.com/
28
+ sites\4\query="results.aspx?q=%s"
29
+ sites\5\name=Weather
30
+ sites\5\base=http://www.weather.com/
31
+ sites\5\query=weather/local/%s
32
+ sites\6\name=Amazon
33
+ sites\6\base=http://www.amazon.com/
34
+ sites\6\query="gp/search/?keywords=%s&index=blended"
35
+ sites\7\name=YouTube
36
+ sites\7\base=http://www.youtube.com/
37
+ sites\7\query="results?search_query=%s"
38
+ sites\8\name=Wikipedia
39
+ sites\8\base=http://en.wikipedia.com/
40
+ sites\8\query="wiki/Special:Search?search=%s&fulltext=Search"
41
+ sites\9\name=Dictionary
42
+ sites\9\base=http://www.dictionary.com/
43
+ sites\9\query=browse/%s
44
+ sites\10\name=Thesaurus
45
+ sites\10\base=http://www.thesaurus.com/
46
+ sites\10\query=browse/%s
47
+ sites\11\name=Netflix
48
+ sites\11\base=http://www.netflix.com/
49
+ sites\11\query="Search?v1=%s"
50
+ sites\12\name=E-Mail
51
+ sites\12\base=mailto:
52
+ sites\12\query=%s
53
+ sites\13\name=IMDB
54
+ sites\13\base=http://www.imdb.com/
55
+ sites\13\query="find?s=all&q=%s"
56
+ sites\14\name=Maps
57
+ sites\14\base=http://maps.google.com/
58
+ sites\14\query="maps?f=q&hl=en&geocode=&q=%s&ie=UTF8&z=12&iwloc=addr&om=1"
59
+ sites\size=14
60
+ version=2
@@ -0,0 +1,13 @@
1
+ <SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
2
+ <os:ShortName>SSL Wikipedia (English)</os:ShortName>
3
+ <os:Description>Return articles from english wikipedia using https url</os:Description>
4
+ <os:InputEncoding>UTF-8</os:InputEncoding>
5
+ <os:Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAABzklEQVQ4y6WTL6vycBTHP9stgmETGWIaF6bFNA0qWMQZxDIQ34cv4WLwDYhJsK1o0CQKDhUMNllQg2tiERQUBMGwGx7Y83i9T/LArxzO+XK+f36CKIoeb5TIm/U+QKFQwLIshsMhhUIBgGq1ynA4pF6vo2kaAPV6Hcuy0DQNTdNoNptYloVo2zbr9RpVVX3UXq8HQKVSAUBRFO73O7PZDNd1uVwuAMxmsz8Uut0usixjmiaKogDQ7/eRZRld1/n8/CQajdJut5/Ob7fbfAiC8HU+n0mlUpRKJcbjMYfDgev1SjKZxDRNbrcbq9WKzWYDQDab5Xg8stls/orY6XQAMAwDANd16ff7xGIxEomET0tRFNLpNOfz+dkF27ZxHIdcLucLN51OWS6XhEIh/2xJkggEAti2/WrjYrHAMAx0XX/iqqqq71A+n2e/3/+eg0ajwW6388XUdR3HcTidTpim6VMYDAb+zocgCF//gsiyTCqVIhKJcDweGQwGSJJEuVzm8XgQDAYZj8f/T+JutyMcDvsZcF2X+XwOQK1WYzKZ/IiiKHo/32g08kajkRePx/1eq9Xyttvty+yvAMVi0ctkMk+9eDzuFYvFl1nh3e/8DVlGxpnqRIOzAAAAAElFTkSuQmCC</os:Image>
6
+ <UpdateInterval>7</UpdateInterval>
7
+ <UpdateUrl>http://mycroft.mozdev.org/updateos.php/id0/securewikipedia.xml</UpdateUrl>
8
+ <IconUpdateUrl>http://mycroft.mozdev.org/updateos.php/id0/securewikipedia.png</IconUpdateUrl>
9
+ <SearchForm>https://secure.wikimedia.org/wikipedia/en/wiki/</SearchForm>
10
+ <os:Url type="text/html" method="GET" template="https://secure.wikimedia.org/wikipedia/en/wiki/Special:Search?go=Go&amp;search={searchTerms}">
11
+ </os:Url><os:Url type="application/x-suggestions+json" method="GET" template="https://secure.wikimedia.org/wikipedia/en/w/api.php?action=opensearch&amp;search={searchTerms}">
12
+ </os:Url>
13
+ </SearchPlugin>
@@ -0,0 +1,13 @@
1
+ <SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
2
+ <os:ShortName>YouTube</os:ShortName>
3
+ <os:Description>YouTube - Videos</os:Description>
4
+ <os:InputEncoding>UTF-8</os:InputEncoding>
5
+ <os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAABMLAAATCwAAAAAAAAAAAAD//////////4OD//9paf//bm7//2Fh//9ZWf//Wlr//1pa//9WVv//ZGT//3Bw//9jY///goL//////////////////11d//8sLP//QUH//ygo//84OP//RET//y4u//8xMf//UVH//y4u//8PD///ZWX//x0d//9aWv////////////88PP//Cgr///////8zM///1NT///////+lpf//ubn///////+urv//fHz////////g4P//Fhb/////////////MzP//woK////////NDT//8vL//9ycv//paX//7Cw//9jY///s7P//8nJ//9XV///eXn//yIi/////////////zMz//8LC///+/v//zMz///Gxv//hYX//6Ki//+srP//W1v//6ys//+3t///2tr//93d//8PD/////////////80NP//AgL///b2//8nJ///5ub//56e//+5uf//oaH//+/v//+5uf//oKD//+Li///f3///AgL/////////////MzP//wUF////////Skr//0pK//9NTf//NTX//97e//+ysv//Nzf//xIS//+mpv//Kyv//z09/////////////xkZ///Y2P////////////8nJ///EBD//wAA///y8v//Ly///wAA//8mJv//Hh7//6mp//92dv////////////+vr///Jib//xMS//8eIP//MzP//zY2//84OP//Hh///y4u//9XV///hoj//8LC///R0f//qqr/////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA/8zMzP/u7u7/IiIi/wAAAP8iIiL//////zMzM/8AAAD/AAAA/////////////////////////////////wAAAP/MzMz//////yIiIv/u7u7/ERER/7u7u/8AAAD/iIiI/xEREf///////////////////////////+7u7v8AAAD/zMzM//////8iIiL/7u7u/xEREf+7u7v/AAAA/8zMzP8RERH///////////////////////////93d3f/AAAA/1VVVf/u7u7/IiIi/wAAAP8iIiL//////wAAAP/MzMz/ERER///////////////////////d3d3/AAAA/4iIiP8AAAD/3d3d/////////////////////////////////////////////////////////////////wAAAP//////AAAA////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==</os:Image>
6
+ <UpdateInterval>7</UpdateInterval>
7
+ <UpdateUrl>http://mycroft.mozdev.org/updateos.php/id0/youtube.xml</UpdateUrl>
8
+ <IconUpdateUrl>http://mycroft.mozdev.org/updateos.php/id0/youtube.ico</IconUpdateUrl>
9
+ <SearchForm>http://www.youtube.com/index</SearchForm>
10
+ <os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;search=Search">
11
+ </os:Url><os:Url type="application/x-suggestions+json" method="GET" template="http://suggestqueries.google.com/complete/search?hl=en&amp;ds=yt&amp;json=t&amp;q={searchTerms}">
12
+ </os:Url>
13
+ </SearchPlugin>
@@ -0,0 +1,276 @@
1
+ # Copyright 2009 Alexander E. Fischer <aef@raxys.net>
2
+ #
3
+ # This file is part of LaunchyOpenSearch.
4
+ #
5
+ # LaunchyOpenSearch is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+
18
+ require 'lib/launchy_opensearch'
19
+
20
+ require 'fileutils'
21
+ require 'tmpdir'
22
+
23
+ require 'rubygems'
24
+ require 'sys/uname'
25
+
26
+ module LaunchyOpenSearchSpecHelper
27
+ # If there is a way to get the executable path of the currently running ruby
28
+ # interpreter, please tell me how.
29
+ warn 'Attention: If the ruby interpreter to be tested with is not ruby in the ' +
30
+ "default path, you have to change this manually in #{__FILE__} line #{__LINE__ + 1}"
31
+ RUBY_PATH = 'ruby'
32
+
33
+ def executable_path
34
+ "#{RUBY_PATH} bin/launchy-opensearch"
35
+ end
36
+
37
+ def fixture_path(name)
38
+ File.join('spec/fixtures', name)
39
+ end
40
+
41
+ def windows?
42
+ Sys::Uname.sysname.downcase.include?('windows')
43
+ end
44
+
45
+ def info_youtube
46
+ {
47
+ :name => 'YouTube',
48
+ :base => 'http://www.youtube.com/',
49
+ :query => '"results?search_query=%s&search=Search"',
50
+ :default => 'false'
51
+ }
52
+ end
53
+
54
+ def info_discogs
55
+ {
56
+ :name => 'Discogs',
57
+ :base => 'http://www.discogs.com/',
58
+ :query => '"search?type=all&q=%s&btn=Search"',
59
+ :default => 'false'
60
+ }
61
+ end
62
+
63
+ def info_wikipedia
64
+ {
65
+ :name => 'SSL Wikipedia (English)',
66
+ :base => 'https://secure.wikimedia.org/',
67
+ :query => '"wikipedia/en/wiki/Special:Search?go=Go&search=%s"',
68
+ :default => 'false'
69
+ }
70
+ end
71
+ end
72
+
73
+ describe Aef::LaunchyOpenSearch do
74
+ include LaunchyOpenSearchSpecHelper
75
+
76
+ before(:each) do
77
+ # Before ruby 1.8.7, the tmpdir standard library had no method to create
78
+ # a temporary directory (mktmpdir).
79
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('1.8.7')
80
+ @folder_path = File.join(Dir.tmpdir, 'launchy_opensearch_spec')
81
+ Dir.mkdir(@folder_path)
82
+ else
83
+ @folder_path = Dir.mktmpdir('launchy_opensearch_spec')
84
+ end
85
+ end
86
+
87
+ after(:each) do
88
+ FileUtils.rm_rf(@folder_path)
89
+ end
90
+
91
+ context 'library' do
92
+ it "should be able to determine Launchy's config file path correctly" do
93
+ if windows?
94
+ path = File.join(ENV['APPDATA'], 'Launchy', 'Launchy.ini')
95
+ else
96
+ path = File.join(ENV['HOME'], '.launchy', 'launchy.ini')
97
+ end
98
+
99
+ Aef::LaunchyOpenSearch.launchy_config_path.should eql(path)
100
+ end
101
+
102
+ it "should be able to parse useful information out of OpenSearch XML documents" do
103
+ content = File.read(fixture_path('youtube.xml'))
104
+ result = Aef::LaunchyOpenSearch.parse_opensearch(content)
105
+
106
+ result.should be_an_instance_of(Hash)
107
+
108
+ result[:name].should eql(info_youtube[:name])
109
+ result[:base].should eql(info_youtube[:base])
110
+ result[:query].should eql(info_youtube[:query])
111
+ result[:default].should eql(info_youtube[:default])
112
+ end
113
+
114
+ it "should be able to parse useful information out of OpenSearch XML document files" do
115
+ result = Aef::LaunchyOpenSearch.parse_opensearch_file(fixture_path('discogs.xml'))
116
+
117
+ result.should be_an_instance_of(Hash)
118
+
119
+ result[:name].should eql(info_discogs[:name])
120
+ result[:base].should eql(info_discogs[:base])
121
+ result[:query].should eql(info_discogs[:query])
122
+ result[:default].should eql(info_discogs[:default])
123
+ end
124
+
125
+ it "should be able to parse useful information out of multiple OpenSearch XML document files" do
126
+ files = [
127
+ fixture_path('youtube.xml'),
128
+ fixture_path('discogs.xml'),
129
+ fixture_path('secure-wikipedia-english.xml')
130
+ ]
131
+
132
+ result = Aef::LaunchyOpenSearch.parse_opensearch_files(files)
133
+
134
+ result.should be_an_instance_of(Array)
135
+ result.should include(info_youtube)
136
+ result.should include(info_discogs)
137
+ result.should include(info_wikipedia)
138
+ end
139
+
140
+ it "should be able to read a Launchy configuration ini file" do
141
+ result = Aef::LaunchyOpenSearch.read_config_hash(fixture_path('launchy.ini'))
142
+
143
+ result.should be_an_instance_of(Hash)
144
+
145
+ result.keys.sort.should eql(['General', 'GenOps', 'runner', 'weby'].sort)
146
+
147
+ result['General'].should have(2).items
148
+ result['General']['version'].should eql('212')
149
+
150
+ result['runner'].should have(5).items
151
+ result['runner']['cmds\\1\\file'].should eql('/usr/bin/xterm')
152
+
153
+ result['GenOps'].should have(1).items
154
+ result['GenOps']['skin'].should eql('/usr/share/launchy/skins/Default')
155
+
156
+ result['weby'].should have(45).items
157
+ result['weby']['sites\\size'].should eql('14')
158
+ result['weby']['sites\\6\\query'].should eql('"gp/search/?keywords=%s&index=blended"')
159
+ end
160
+
161
+ it "should be able to extract an array of engine hashes from a config file hash" do
162
+ config_hash = Aef::LaunchyOpenSearch.read_config_hash(fixture_path('launchy.ini'))
163
+
164
+ result = Aef::LaunchyOpenSearch.extract_config_hash(config_hash)
165
+
166
+ result.should be_an_instance_of(Array)
167
+ result.should have(14).items
168
+
169
+ result.should include(:name => 'Live Search',
170
+ :base => 'http://search.live.com/',
171
+ :query => '"results.aspx?q=%s"')
172
+
173
+ result.should include(:name => 'Dictionary',
174
+ :base => 'http://www.dictionary.com/',
175
+ :query => 'browse/%s')
176
+ end
177
+
178
+ it "should be able to patch an array of engines with additional engines" do
179
+ config_hash = Aef::LaunchyOpenSearch.read_config_hash(fixture_path('launchy.ini'))
180
+
181
+ engines = Aef::LaunchyOpenSearch.extract_config_hash(config_hash)
182
+ engines << info_discogs
183
+
184
+ lambda {
185
+ Aef::LaunchyOpenSearch.patch_config_hash(config_hash, engines)
186
+ }.should change{ config_hash['weby'].size }.from(45).to(49)
187
+
188
+ name_key = config_hash['weby'].find {|key, value| value == 'Discogs'}.first
189
+ name_key =~ /^.*\\(.*)\\.*$/
190
+
191
+ config_hash['weby']["sites\\#$1\\base"].should eql(info_discogs[:base])
192
+ config_hash['weby']["sites\\#$1\\query"].should eql(info_discogs[:query])
193
+ config_hash['weby']["sites\\#$1\\default"].should eql(info_discogs[:default])
194
+ end
195
+
196
+ it "should be able to write a config hash to ini file" do
197
+ config_file_path = File.join(@folder_path, 'launchy.ini')
198
+
199
+ config_hash = Aef::LaunchyOpenSearch.read_config_hash(fixture_path('launchy.ini'))
200
+
201
+ engines = Aef::LaunchyOpenSearch.extract_config_hash(config_hash)
202
+ engines << info_discogs
203
+
204
+ Aef::LaunchyOpenSearch.patch_config_hash(config_hash, engines)
205
+
206
+ Aef::LaunchyOpenSearch.write_config_hash(config_hash, config_file_path)
207
+ File.exist?(config_file_path).should be_true
208
+
209
+ Aef::LaunchyOpenSearch.read_config_hash(config_file_path)['weby'].sort.should eql(config_hash['weby'].sort)
210
+ end
211
+ end
212
+
213
+ context 'commandline tool' do
214
+ it "should be able add an engine from an OpenSearch XML file to Launchy's ini-file" do
215
+ config_file_path = File.join(@folder_path, 'launchy.ini')
216
+
217
+ FileUtils.copy(fixture_path('launchy.ini'), config_file_path)
218
+
219
+ lambda {
220
+ `#{executable_path} -c #{config_file_path} #{fixture_path('discogs.xml')}`
221
+ }.should change{
222
+ Aef::LaunchyOpenSearch.read_config_hash(config_file_path)['weby']['sites\\size']
223
+ }.from('14').to('15')
224
+ end
225
+
226
+ it "should be able replace current engines with an engine from an OpenSearch XML file" do
227
+ config_file_path = File.join(@folder_path, 'launchy.ini')
228
+
229
+ FileUtils.copy(fixture_path('launchy.ini'), config_file_path)
230
+
231
+ lambda {
232
+ `#{executable_path} --mode replace -c #{config_file_path} #{fixture_path('discogs.xml')}`
233
+ }.should change{
234
+ Aef::LaunchyOpenSearch.read_config_hash(config_file_path)['weby']['sites\\size']
235
+ }.from('14').to('1')
236
+ end
237
+
238
+ it "should be able to replace current engines with multiple engines from OpenSearch XML files" do
239
+ config_file_path = File.join(@folder_path, 'launchy.ini')
240
+
241
+ FileUtils.copy(fixture_path('launchy.ini'), config_file_path)
242
+
243
+ lambda {
244
+ `#{executable_path} -m replace --config #{config_file_path} #{fixture_path('discogs.xml')} #{fixture_path('youtube.xml')} #{fixture_path('secure-wikipedia-english.xml')}`
245
+ }.should change{
246
+ Aef::LaunchyOpenSearch.read_config_hash(config_file_path)['weby']['sites\\size']
247
+ }.from('14').to('3')
248
+ end
249
+
250
+ it 'should display correct version and licensing information with the --version switch' do
251
+ message = <<-EOF
252
+ LaunchyOpenSearch 1.2.0
253
+
254
+ Project: https://rubyforge.org/projects/aef/
255
+ RDoc: http://aef.rubyforge.org/launchy-opensearch/
256
+ Github: http://github.com/aef/launchy-opensearch/
257
+
258
+ Copyright 2009 Alexander E. Fischer <aef@raxys.net>
259
+
260
+ LaunchyOpenSearch is free software: you can redistribute it and/or modify
261
+ it under the terms of the GNU General Public License as published by
262
+ the Free Software Foundation, either version 3 of the License, or
263
+ (at your option) any later version.
264
+
265
+ This program is distributed in the hope that it will be useful,
266
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
267
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
268
+ GNU General Public License for more details.
269
+
270
+ You should have received a copy of the GNU General Public License
271
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
272
+ EOF
273
+ `#{executable_path} --version`.should eql(message)
274
+ end
275
+ end
276
+ end
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: launchy-opensearch
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Alexander E. Fischer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDKDCCAhCgAwIBAgIBADANBgkqhkiG9w0BAQUFADA6MQwwCgYDVQQDDANhZWYx
14
+ FTATBgoJkiaJk/IsZAEZFgVyYXh5czETMBEGCgmSJomT8ixkARkWA25ldDAeFw0w
15
+ OTAyMjUyMDM5MDhaFw0xMDAyMjUyMDM5MDhaMDoxDDAKBgNVBAMMA2FlZjEVMBMG
16
+ CgmSJomT8ixkARkWBXJheHlzMRMwEQYKCZImiZPyLGQBGRYDbmV0MIIBIjANBgkq
17
+ hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoYtj0qad5/MpbdttITzBH0h1SNe6eO7R
18
+ 7qVeqNYu6qDQAQ0rYc0JhubJCWYrZEJorHEBhUFU6cdQgQOs78wiJaDgkeU7YfXB
19
+ q2l125kJ8aHkA1ukrK2/DRzp2AHEmzxHIYpXV5/63h+NWjCP+uKvTELYsotS2MKt
20
+ 3d43E0QajsPZu2ZuNFwkroqeue872gMHUldGOVy5WtSd9ajw2xI/CociY6746dL+
21
+ pYriV3QaYtR/ezeaLpKBLsc5T1UQ07t7Xs7mI281tdmRvpLdP5dQhjzInfio0CJv
22
+ 1Pf5bZUjGG0K9RW2Gb/tGPSYEETiLMubjH61OwBooXKiWR5cs4/1BQIDAQABozkw
23
+ NzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUSYvjhG2EWnR5kx5l
24
+ DAewXCkJOVEwDQYJKoZIhvcNAQEFBQADggEBAB2ryDbU4bQtnunKv/AXq4CuO3LS
25
+ kik9Xhye8E/5dTcsgitCZJXAqx0rHcK0u2EHnjA5CDcdF5JB7XgSvRrQkFWoW/9K
26
+ lCB4ih+sB2AI2IUiYBeoCGctXdBQ020prqop/oTQEudzFk/gyQ686lp06HdLRt+O
27
+ HoQjTIab8vmfgIubjPdIRzokMfHbelvhLi+mQfWVghRhs2jpEfdXbL0w5nNw+trp
28
+ rO70Dw59hduDUOpgpxew+PLbs4vP1tb1QKPG+39C+PZtosbbf1fai0hqYV1txMCx
29
+ 55akF+N8NbO6tpVDy6TMagqa10LfEpiQH6dvDHe/xdAqYOCrXKpmqzwu2PI=
30
+ -----END CERTIFICATE-----
31
+
32
+ date: 2009-04-05 00:00:00 +02:00
33
+ default_executable:
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: facets
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: hpricot
47
+ type: :runtime
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: sys-uname
57
+ type: :runtime
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
65
+ - !ruby/object:Gem::Dependency
66
+ name: user-choices
67
+ type: :development
68
+ version_requirement:
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ version:
75
+ - !ruby/object:Gem::Dependency
76
+ name: hoe
77
+ type: :development
78
+ version_requirement:
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: 1.11.0
84
+ version:
85
+ description: LaunchyOpenSearch is a Ruby library and commandline tool that allows to parse OpenSearch XML files and include them as search engines in the Weby plugin of the keystroke app launcher Launchy by editing Launchy's ini config file.
86
+ email:
87
+ - aef@raxys.net
88
+ executables:
89
+ - launchy-opensearch
90
+ extensions: []
91
+
92
+ extra_rdoc_files:
93
+ - History.txt
94
+ - Manifest.txt
95
+ - COPYING.txt
96
+ - README.rdoc
97
+ files:
98
+ - History.txt
99
+ - Manifest.txt
100
+ - README.rdoc
101
+ - COPYING.txt
102
+ - Rakefile
103
+ - bin/launchy-opensearch
104
+ - lib/launchy_opensearch.rb
105
+ - lib/launchy_opensearch/launchy_opensearch.rb
106
+ - spec/launchy_opensearch_spec.rb
107
+ - spec/fixtures/launchy.ini
108
+ - spec/fixtures/discogs.xml
109
+ - spec/fixtures/secure-wikipedia-english.xml
110
+ - spec/fixtures/youtube.xml
111
+ has_rdoc: true
112
+ homepage: https://rubyforge.org/projects/aef/
113
+ post_install_message:
114
+ rdoc_options:
115
+ - --main
116
+ - README.rdoc
117
+ - --inline-source
118
+ - --line-numbers
119
+ - --title
120
+ - LaunchyOpenSearch
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: "0"
128
+ version:
129
+ required_rubygems_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: "0"
134
+ version:
135
+ requirements: []
136
+
137
+ rubyforge_project: aef
138
+ rubygems_version: 1.3.1
139
+ signing_key:
140
+ specification_version: 2
141
+ summary: LaunchyOpenSearch is a Ruby library and commandline tool that allows to parse OpenSearch XML files and include them as search engines in the Weby plugin of the keystroke app launcher Launchy by editing Launchy's ini config file.
142
+ test_files: []
143
+