webpoke 0.0.4 → 0.0.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -0
- data/bin/poke +8 -4
- data/lib/Webpoke/version.rb +1 -1
- data/lib/webpoke.rb +16 -3
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3596d36159166986f4e8f87bb343c9e8837213e9
|
4
|
+
data.tar.gz: 378d9e7f555a2f408f37de6645c91bf2eef51f2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25b604131713ef91116f20565cc826c1d3bf180e2133e8cadb7af1660fe12305032879e15792d351194dad6a35a0fd85fa13735e1f1b8d81c24ac9e90eef104e
|
7
|
+
data.tar.gz: 2239c8e52c24202c8c436a484582e2824e30519760ae4153cde15216a8034328d7f8a5dceea357fe33ac8a1302b313bb91a3b48fd2ea67a4c53d5f81ccb7c3fa
|
data/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
#Webpoke
|
2
|
+
|
3
|
+
I'm too lazy to document right now...
|
4
|
+
|
5
|
+
##Installation
|
6
|
+
|
7
|
+
As a gem:
|
8
|
+
|
9
|
+
gem install webpoke
|
10
|
+
|
11
|
+
Or by hand:
|
12
|
+
|
13
|
+
gem install httparty
|
14
|
+
git clone https://github.com/unRob/webpoke
|
15
|
+
|
16
|
+
|
17
|
+
##License
|
18
|
+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
19
|
+
Version 2, December 2004
|
20
|
+
|
21
|
+
(C) 2012 Roberto Hidalgo <un@rob.mx>, Those listed at CONTRIBUTORS
|
22
|
+
|
23
|
+
Everyone is permitted to copy and distribute verbatim or modified
|
24
|
+
copies of this license document, and changing it is allowed as long
|
25
|
+
as the name is changed.
|
26
|
+
|
27
|
+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
28
|
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
29
|
+
|
30
|
+
0. You just DO WHAT THE FUCK YOU WANT TO.
|
data/bin/poke
CHANGED
@@ -29,7 +29,13 @@ optparser = OptionParser.new do |opts|
|
|
29
29
|
|
30
30
|
options[:doc] = false
|
31
31
|
opts.on('-d <file>', '--document <document>', "Generate documentation for test instead of running") do |file|
|
32
|
-
|
32
|
+
|
33
|
+
if (file != 'stdout')
|
34
|
+
out = File.open(File.expand_path(file), 'w+')
|
35
|
+
else
|
36
|
+
out = $stdout
|
37
|
+
end
|
38
|
+
options[:doc] = out
|
33
39
|
end
|
34
40
|
|
35
41
|
options[:format] = false
|
@@ -66,9 +72,7 @@ elsif (File.file?(file))
|
|
66
72
|
end
|
67
73
|
|
68
74
|
if options[:doc]
|
69
|
-
|
70
|
-
f << Webpoke.document(options[:group])
|
71
|
-
end
|
75
|
+
options[:doc] << Webpoke.document(options[:group])
|
72
76
|
exit 0
|
73
77
|
end
|
74
78
|
|
data/lib/Webpoke/version.rb
CHANGED
data/lib/webpoke.rb
CHANGED
@@ -44,6 +44,7 @@ module Webpoke
|
|
44
44
|
$tests = [];
|
45
45
|
$log = ""
|
46
46
|
$config = nil
|
47
|
+
$groups = {};
|
47
48
|
|
48
49
|
# Adds a test to the queue
|
49
50
|
# @param block [Proc] the configuration for this test
|
@@ -51,6 +52,14 @@ module Webpoke
|
|
51
52
|
$tests << Test.new(&block)
|
52
53
|
end
|
53
54
|
|
55
|
+
|
56
|
+
def group (groupName, description: nil)
|
57
|
+
$groups[groupName] = {
|
58
|
+
name: groupName,
|
59
|
+
description: description,
|
60
|
+
tests: []
|
61
|
+
}
|
62
|
+
end
|
54
63
|
|
55
64
|
def args_for_test(test)
|
56
65
|
|
@@ -142,18 +151,22 @@ module Webpoke
|
|
142
151
|
$stdout << "\n" if newLine
|
143
152
|
end
|
144
153
|
|
154
|
+
|
145
155
|
def Webpoke.document(group)
|
146
156
|
|
147
|
-
|
157
|
+
groups = {}
|
148
158
|
|
149
159
|
$tests.each do |test|
|
150
160
|
return if group && !test.group == group
|
151
161
|
|
152
|
-
|
162
|
+
if (!groups.has_key? test.group)
|
163
|
+
groups[test.group] = $groups[test.group] || {tests:[], name: test.group}
|
164
|
+
end
|
153
165
|
|
166
|
+
groups[test.group][:tests] << test.describe
|
154
167
|
end
|
155
168
|
|
156
|
-
return
|
169
|
+
return JSON.pretty_generate groups.values
|
157
170
|
|
158
171
|
end
|
159
172
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webpoke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.41
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Hidalgo
|
@@ -34,6 +34,7 @@ extra_rdoc_files: []
|
|
34
34
|
files:
|
35
35
|
- .gitignore
|
36
36
|
- Gemfile
|
37
|
+
- README.md
|
37
38
|
- Rakefile
|
38
39
|
- bin/poke
|
39
40
|
- lib/Webpoke/Class.rb
|