cheatorious 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +3 -4
- data/lib/cheatorious/search.rb +1 -1
- data/lib/cheatorious/version.rb +1 -1
- data/lib/cheatorious/writer.rb +1 -0
- data/lib/cheatorious/writer/alfred.rb +75 -0
- metadata +91 -118
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b3e26b5e25c7e68c5b8f9f78dcd1b4ac02a9ad77
|
4
|
+
data.tar.gz: c50279a651f22742dfa825d15e518050779ab48b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e58c7ef787dc55f7ad6dfd834580fd261d99d6b104fc33623dcfd28f52a33651d6561035ac9311ae9212adfa25891eea923220f43b175db3a6994311569288b5
|
7
|
+
data.tar.gz: 3e9718b98ed884c9903372d90f4155a332b0ee2a6d939f7a023a150fc7dfd18b2935ae4bc8ede08a10ebb25fb9d1a19f043c368cbc587eca9b6be489d253d013
|
data/.travis.yml
CHANGED
data/lib/cheatorious/search.rb
CHANGED
@@ -27,7 +27,7 @@ module Cheatorious
|
|
27
27
|
w = writer.new
|
28
28
|
print_full?(query) ? w.header(info[:name], info[:author], info[:version], info[:description]) : w.search_header(query, results_count, options)
|
29
29
|
write_contents(filtered, w, options)
|
30
|
-
w.footer
|
30
|
+
w.footer
|
31
31
|
|
32
32
|
return w.result
|
33
33
|
end
|
data/lib/cheatorious/version.rb
CHANGED
data/lib/cheatorious/writer.rb
CHANGED
@@ -0,0 +1,75 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module Cheatorious
|
4
|
+
module Writer
|
5
|
+
class Alfred
|
6
|
+
def initialize
|
7
|
+
@section_stack = []
|
8
|
+
@result = ""
|
9
|
+
@query = nil
|
10
|
+
@options = {}
|
11
|
+
end
|
12
|
+
|
13
|
+
def header(name, author = "", version = "", description = "")
|
14
|
+
line "<?xml version=\"1.0\"?>"
|
15
|
+
line "<items>"
|
16
|
+
end
|
17
|
+
|
18
|
+
def search_header(query, results_count, options)
|
19
|
+
@query = query
|
20
|
+
@options = options
|
21
|
+
line "<?xml version=\"1.0\"?>"
|
22
|
+
line "<items>"
|
23
|
+
end
|
24
|
+
|
25
|
+
def footer
|
26
|
+
line "</items>"
|
27
|
+
end
|
28
|
+
|
29
|
+
def section_start(section)
|
30
|
+
@section_stack.push(section)
|
31
|
+
end
|
32
|
+
|
33
|
+
def section_end
|
34
|
+
@section_stack.pop
|
35
|
+
end
|
36
|
+
|
37
|
+
def entry(name, *values)
|
38
|
+
line " <item arg=\"#{name}\">"
|
39
|
+
value_text = values.join(", ")
|
40
|
+
if @options['reverse']
|
41
|
+
line " <subtitle>#{value_text}</subtitle>"
|
42
|
+
line " <title>#{@section_stack.join(" > ")} > #{name}</title>"
|
43
|
+
else
|
44
|
+
line " <title>#{value_text}</title>"
|
45
|
+
line " <subtitle>#{@section_stack.join(" > ")} > #{name}</subtitle>"
|
46
|
+
end
|
47
|
+
line " <icon></icon>"
|
48
|
+
line " </item>"
|
49
|
+
end
|
50
|
+
|
51
|
+
def result
|
52
|
+
@result
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def line(str = "")
|
58
|
+
if str.empty?
|
59
|
+
if @add_empty_line
|
60
|
+
@result += str + "\n"
|
61
|
+
@add_empty_line = false
|
62
|
+
end
|
63
|
+
else
|
64
|
+
@result += str + "\n"
|
65
|
+
@add_empty_line = true
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def indentation(char)
|
70
|
+
char * 3 * @section_stack.size
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
metadata
CHANGED
@@ -1,123 +1,106 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: cheatorious
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 3
|
9
|
-
- 0
|
10
|
-
version: 0.3.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Luis Cipriani
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2013-07-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: thor
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 43
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 14
|
32
|
-
- 6
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
33
19
|
version: 0.14.6
|
34
20
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: rainbow
|
38
21
|
prerelease: false
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.14.6
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rainbow
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
49
33
|
version: 1.1.3
|
50
34
|
type: :runtime
|
51
|
-
version_requirements: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: hirb
|
54
35
|
prerelease: false
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.1.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: hirb
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
65
47
|
version: 0.6.0
|
66
48
|
type: :runtime
|
67
|
-
version_requirements: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: hirb-unicode
|
70
49
|
prerelease: false
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.6.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: hirb-unicode
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
81
61
|
version: 0.0.5
|
82
62
|
type: :runtime
|
83
|
-
version_requirements: *id004
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: step-up
|
86
63
|
prerelease: false
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.0.5
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: step-up
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
96
76
|
type: :development
|
97
|
-
version_requirements: *id005
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: rake
|
100
77
|
prerelease: false
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
110
90
|
type: :development
|
111
|
-
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
112
97
|
description:
|
113
98
|
email: lfcipriani@gmail.com
|
114
|
-
executables:
|
99
|
+
executables:
|
115
100
|
- cheatorious
|
116
101
|
extensions: []
|
117
|
-
|
118
102
|
extra_rdoc_files: []
|
119
|
-
|
120
|
-
files:
|
103
|
+
files:
|
121
104
|
- .travis.yml
|
122
105
|
- CHANGELOG.md
|
123
106
|
- LICENSE
|
@@ -135,40 +118,30 @@ files:
|
|
135
118
|
- lib/cheatorious/utils.rb
|
136
119
|
- lib/cheatorious/version.rb
|
137
120
|
- lib/cheatorious/writer.rb
|
121
|
+
- lib/cheatorious/writer/alfred.rb
|
138
122
|
- lib/cheatorious/writer/text.rb
|
139
123
|
- lib/cheatorious/writer/tree.rb
|
140
124
|
homepage: https://github.com/abril/cheatorious
|
141
125
|
licenses: []
|
142
|
-
|
126
|
+
metadata: {}
|
143
127
|
post_install_message:
|
144
128
|
rdoc_options: []
|
145
|
-
|
146
|
-
require_paths:
|
129
|
+
require_paths:
|
147
130
|
- lib
|
148
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
none: false
|
159
|
-
requirements:
|
160
|
-
- - ">="
|
161
|
-
- !ruby/object:Gem::Version
|
162
|
-
hash: 3
|
163
|
-
segments:
|
164
|
-
- 0
|
165
|
-
version: "0"
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - '>='
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - '>='
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
166
141
|
requirements: []
|
167
|
-
|
168
142
|
rubyforge_project:
|
169
|
-
rubygems_version:
|
143
|
+
rubygems_version: 2.0.3
|
170
144
|
signing_key:
|
171
|
-
specification_version:
|
145
|
+
specification_version: 4
|
172
146
|
summary: generator of simple, searchable, command line cheatsheets
|
173
147
|
test_files: []
|
174
|
-
|