tap-ubiquity 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History +4 -0
- data/lib/tap/ubiquity/ubiquity.rb +10 -12
- data/lib/tap/ubiquity/utils.rb +5 -16
- data/tap-ubiquity.gemspec +2 -2
- data/views/tap/ubiquity/ubiquity/index.erb +3 -6
- metadata +3 -3
data/History
CHANGED
@@ -6,12 +6,18 @@ module Tap
|
|
6
6
|
|
7
7
|
# ::controller
|
8
8
|
class Ubiquity < Tap::Controller
|
9
|
+
UBIQUITY_WEBSITE = "http://labs.mozilla.com/projects/ubiquity/"
|
10
|
+
|
9
11
|
def index
|
10
12
|
link = {:uri => request['uri'], :name => request['name']}
|
11
13
|
render 'index.erb', :locals => {:feeds => feeds, :link => link}
|
12
14
|
end
|
13
15
|
|
14
16
|
protected
|
17
|
+
|
18
|
+
def ubiquity_website
|
19
|
+
UBIQUITY_WEBSITE
|
20
|
+
end
|
15
21
|
|
16
22
|
def feeds
|
17
23
|
env_names = {}
|
@@ -23,18 +29,10 @@ module Tap
|
|
23
29
|
server.env.each do |env|
|
24
30
|
env_name = env_names[env]
|
25
31
|
|
26
|
-
env.
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
action = comment.subject.strip
|
31
|
-
action = 'commands' if action.empty?
|
32
|
-
feeds << [
|
33
|
-
server.uri(name, action),
|
34
|
-
"#{env_name}:#{name}",
|
35
|
-
comment.content.join("\n").strip
|
36
|
-
]
|
37
|
-
end
|
32
|
+
env.constant_manifest(:ubiquity).minimap.each do |name, constant|
|
33
|
+
action = constant.comment.strip
|
34
|
+
action = 'commands' if action.empty?
|
35
|
+
feeds << [server.uri(name, action), "#{env_name}:#{name}"]
|
38
36
|
end
|
39
37
|
end
|
40
38
|
|
data/lib/tap/ubiquity/utils.rb
CHANGED
@@ -25,28 +25,17 @@ module Tap
|
|
25
25
|
#
|
26
26
|
# Utils expects to be included in a Tap::Controller.
|
27
27
|
module Utils
|
28
|
-
module_function
|
29
28
|
|
30
29
|
# Serves the command from the calling method.
|
31
30
|
def serve(command)
|
32
|
-
|
33
|
-
|
34
|
-
command
|
35
|
-
else
|
36
|
-
block_given? ? yield(command_link) : command_link
|
37
|
-
end
|
31
|
+
response['Content-Type'] = 'application/x-javascript'
|
32
|
+
command
|
38
33
|
end
|
39
|
-
|
40
|
-
# Returns true if the current request indicates the command javascript
|
41
|
-
# should be returned by serve (ie the path_info ends with '.js')
|
42
|
-
def command_request?
|
43
|
-
File.extname(request.path_info) == '.js'
|
44
|
-
end
|
45
|
-
|
34
|
+
|
46
35
|
# Returns the link tag for subscribing to a ubiquity command served
|
47
36
|
# from the specified action.
|
48
|
-
def command_link(
|
49
|
-
"<link rel='commands' href='#{
|
37
|
+
def command_link(href)
|
38
|
+
"<link rel='commands' href='#{href}' />"
|
50
39
|
end
|
51
40
|
|
52
41
|
# Formats a Ubiquity command that calls action with an 'input' parameter
|
data/tap-ubiquity.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "tap-ubiquity"
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.3.0"
|
4
4
|
s.author = "Simon Chiang"
|
5
5
|
s.email = "simon.a.chiang@gmail.com"
|
6
6
|
s.homepage = "http://tap.rubyforge.org/ubiquity/"
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.summary = "Making Tap available in Ubiquity"
|
9
9
|
s.require_path = "lib"
|
10
10
|
s.rubyforge_project = "tap"
|
11
|
-
s.add_dependency("tap-server", ">= 0.
|
11
|
+
s.add_dependency("tap-server", ">= 0.4.0")
|
12
12
|
s.add_dependency("json_pure", ">= 1.1.3")
|
13
13
|
s.has_rdoc = true
|
14
14
|
s.rdoc_options.concat %W{--main README -S -N --title Tap\sUbiquity}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<h1>Welcome to Tap!</h1>
|
2
2
|
|
3
|
-
<p><a href="http://tap.rubyforge.org">Tap</a> interfaces with the web using <a href="">Ubiquity</a>.</p>
|
3
|
+
<p><a href="http://tap.rubyforge.org">Tap</a> interfaces with the web using <a href="<%= ubiquity_website %>">Ubiquity</a>.</p>
|
4
4
|
<ul>
|
5
5
|
<li>Press 'option' + 'space' to bring up a prompt</li>
|
6
6
|
</ul>
|
@@ -8,11 +8,8 @@
|
|
8
8
|
<% unless feeds.empty? %>
|
9
9
|
<p>Subscribe to local feeds by clicking on the links below:</p>
|
10
10
|
<ul>
|
11
|
-
<% feeds.each do |(uri, name
|
12
|
-
<li>
|
13
|
-
<a href="<%= uri %>"><%= name %></a>
|
14
|
-
<div><%= help %></div>
|
15
|
-
</li>
|
11
|
+
<% feeds.each do |(uri, name)| %>
|
12
|
+
<li><a href="<%= uri %>"><%= name %></a></li>
|
16
13
|
<% end %>
|
17
14
|
</ul>
|
18
15
|
<% end %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tap-ubiquity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Chiang
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-25 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.
|
23
|
+
version: 0.4.0
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json_pure
|