alfredo 0.1.1 → 0.1.2
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.
- data/.travis.yml +6 -0
- data/README.md +1 -0
- data/alfredo.gemspec +1 -1
- data/lib/alfredo/item.rb +3 -3
- data/lib/alfredo/version.rb +1 -1
- data/spec/item_spec.rb +13 -1
- data/spec/workflow_spec.rb +4 -3
- metadata +95 -71
- checksums.yaml +0 -15
data/.travis.yml
ADDED
data/README.md
CHANGED
data/alfredo.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["dennispaagman@gmail.com"]
|
11
11
|
spec.description = %q{Wrapper for Alfred 2's Workflows}
|
12
12
|
spec.summary = %q{Easy generation of XML responses usable in Alfred 2 Workflows}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/springest/alfredo"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
data/lib/alfredo/item.rb
CHANGED
@@ -34,19 +34,19 @@ module Alfredo
|
|
34
34
|
|
35
35
|
def build_xml
|
36
36
|
Nokogiri::XML::Builder.new do |xml|
|
37
|
-
xml.item(arg
|
37
|
+
xml.item(:arg => arg, :uid => uid, :valid => valid, :autocomplete => autocomplete) {
|
38
38
|
xml.title title
|
39
39
|
xml.subtitle subtitle
|
40
40
|
if icon_path
|
41
41
|
if icon_type
|
42
|
-
xml.icon(type
|
42
|
+
xml.icon(:type => icon_type) {
|
43
43
|
xml.text icon_path
|
44
44
|
}
|
45
45
|
else
|
46
46
|
xml.icon icon_path
|
47
47
|
end
|
48
48
|
end
|
49
|
-
xml.
|
49
|
+
xml.type_ type if type
|
50
50
|
}
|
51
51
|
end.doc.children.first
|
52
52
|
end
|
data/lib/alfredo/version.rb
CHANGED
data/spec/item_spec.rb
CHANGED
@@ -3,7 +3,14 @@ require 'alfredo'
|
|
3
3
|
describe 'Alfredo::Item' do
|
4
4
|
describe '#build_xml' do
|
5
5
|
before do
|
6
|
-
@item = Alfredo::Item.new(title
|
6
|
+
@item = Alfredo::Item.new(:title => 'foo',
|
7
|
+
:subtitle => 'bar',
|
8
|
+
:arg => 'baz',
|
9
|
+
:uid => 123,
|
10
|
+
:icon_path => 'icon.png',
|
11
|
+
:icon_type => 'fileicon',
|
12
|
+
:type => 'file',
|
13
|
+
:autocomplete => 'moo')
|
7
14
|
|
8
15
|
@xml = @item.build_xml
|
9
16
|
end
|
@@ -33,6 +40,11 @@ describe 'Alfredo::Item' do
|
|
33
40
|
@xml.xpath('/item/icon').first.text.should eq 'icon.png'
|
34
41
|
end
|
35
42
|
|
43
|
+
it 'should set icon to icon_path without icon_type' do
|
44
|
+
@item.icon_type = nil
|
45
|
+
@item.build_xml.xpath('/item/icon').first.text.should eq 'icon.png'
|
46
|
+
end
|
47
|
+
|
36
48
|
it 'should not set icon when no icon_path not present' do
|
37
49
|
@item.icon_path = nil
|
38
50
|
@item.build_xml.xpath('/item/icon').size.should eq 0
|
data/spec/workflow_spec.rb
CHANGED
@@ -4,7 +4,7 @@ describe 'Alfredo::Workflow' do
|
|
4
4
|
before do
|
5
5
|
@workflow = Alfredo::Workflow.new
|
6
6
|
3.times do
|
7
|
-
@workflow.items << Alfredo::Item.new(title
|
7
|
+
@workflow.items << Alfredo::Item.new(:title => rand(9999))
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
@@ -50,8 +50,9 @@ describe 'Alfredo::Workflow' do
|
|
50
50
|
|
51
51
|
describe "#output!" do
|
52
52
|
it "should output XML to the STDOUT" do
|
53
|
-
$stdout.
|
54
|
-
@workflow.
|
53
|
+
pending "Can't get the $stdout thing to work in 1.8.7"
|
54
|
+
# $stdout.should_receive(:puts).with(@workflow.to_xml)
|
55
|
+
# @workflow.output!
|
55
56
|
end
|
56
57
|
end
|
57
58
|
end
|
metadata
CHANGED
@@ -1,79 +1,93 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: alfredo
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 31
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
5
11
|
platform: ruby
|
6
|
-
authors:
|
12
|
+
authors:
|
7
13
|
- Dennis Paagman
|
8
14
|
autorequire:
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
17
|
+
|
18
|
+
date: 2013-03-25 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
14
22
|
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ~>
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.3'
|
20
|
-
type: :development
|
21
23
|
prerelease: false
|
22
|
-
|
23
|
-
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
24
27
|
- - ~>
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
- - ! '>='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 9
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 3
|
33
|
+
version: "1.3"
|
34
34
|
type: :development
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rake
|
35
38
|
prerelease: false
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
- - ~>
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '2.6'
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
version: "0"
|
48
48
|
type: :development
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: rspec
|
49
52
|
prerelease: false
|
50
|
-
|
51
|
-
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
52
56
|
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
55
|
-
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 15
|
59
|
+
segments:
|
60
|
+
- 2
|
61
|
+
- 6
|
62
|
+
version: "2.6"
|
63
|
+
type: :development
|
64
|
+
version_requirements: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
56
66
|
name: nokogiri
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
67
|
prerelease: false
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
68
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
74
|
+
segments:
|
75
|
+
- 0
|
76
|
+
version: "0"
|
77
|
+
type: :runtime
|
78
|
+
version_requirements: *id004
|
69
79
|
description: Wrapper for Alfred 2's Workflows
|
70
|
-
email:
|
80
|
+
email:
|
71
81
|
- dennispaagman@gmail.com
|
72
82
|
executables: []
|
83
|
+
|
73
84
|
extensions: []
|
85
|
+
|
74
86
|
extra_rdoc_files: []
|
75
|
-
|
87
|
+
|
88
|
+
files:
|
76
89
|
- .gitignore
|
90
|
+
- .travis.yml
|
77
91
|
- Gemfile
|
78
92
|
- LICENSE.txt
|
79
93
|
- README.md
|
@@ -86,31 +100,41 @@ files:
|
|
86
100
|
- spec/alfredo_spec.rb
|
87
101
|
- spec/item_spec.rb
|
88
102
|
- spec/workflow_spec.rb
|
89
|
-
|
90
|
-
|
103
|
+
has_rdoc: true
|
104
|
+
homepage: https://github.com/springest/alfredo
|
105
|
+
licenses:
|
91
106
|
- MIT
|
92
|
-
metadata: {}
|
93
107
|
post_install_message:
|
94
108
|
rdoc_options: []
|
95
|
-
|
109
|
+
|
110
|
+
require_paths:
|
96
111
|
- lib
|
97
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
hash: 3
|
118
|
+
segments:
|
119
|
+
- 0
|
120
|
+
version: "0"
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
hash: 3
|
127
|
+
segments:
|
128
|
+
- 0
|
129
|
+
version: "0"
|
107
130
|
requirements: []
|
131
|
+
|
108
132
|
rubyforge_project:
|
109
|
-
rubygems_version:
|
133
|
+
rubygems_version: 1.6.2
|
110
134
|
signing_key:
|
111
|
-
specification_version:
|
135
|
+
specification_version: 3
|
112
136
|
summary: Easy generation of XML responses usable in Alfred 2 Workflows
|
113
|
-
test_files:
|
137
|
+
test_files:
|
114
138
|
- spec/alfredo_spec.rb
|
115
139
|
- spec/item_spec.rb
|
116
140
|
- spec/workflow_spec.rb
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
ODdiNzA4YzAzYTgyZTRiNGJiZGQ1NjQ5ZWY0MWIwNmY4ZTU1NWZkMQ==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
YjBhNGFmODViYTFmZmUzY2MyMmE2YTA3NmRhNWUwN2QyMzE5NThkMg==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
Yjc5YjZjNGY3MDQ1ODc2ZjZjMTc2Yzc0NDhhMWRjNzBlMTY5NzcyODMxYmNj
|
10
|
-
Y2UzY2E0OWYzNGFhNjdiOWY3MDQ2MTVkZDBmYjRjZjEzNDBhY2MxYTQwNzQ1
|
11
|
-
YTMyMmI2NjM0MjljYzMyOTQ5NGM3YzJlOTc1ZTljMTZmOTliYTY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ODA1ZTk2ODZiYjAxOWNiZWNkMTdhNjEyNTAwNjQ2NDlmM2ZhOGI1NjI0ODFj
|
14
|
-
ZjBkYzdlMjRjYzVkZWNjMDk2MjE4MmI2ZmVlNmIyOWE0NzNiZTcxM2EwOTFk
|
15
|
-
ODViZjZiOWU2NzNlMTMyYzA2N2YxOWEzZjU4ZWIwMzVlNDVmOGI=
|