webpoke 0.0.4 → 0.0.41

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be902de90c305d014335c28d1a27e777e00bd228
4
- data.tar.gz: 30e2f79e091ce784ad1fbe70f6eadf834e474089
3
+ metadata.gz: 3596d36159166986f4e8f87bb343c9e8837213e9
4
+ data.tar.gz: 378d9e7f555a2f408f37de6645c91bf2eef51f2f
5
5
  SHA512:
6
- metadata.gz: 8960c831b32710d73af4b54692306b5d925e209cb129c332a6cc81e21d7ff77dc07c9f263807a67524d8784e6a238c324063bee0836e1c340503f22bcdd784fc
7
- data.tar.gz: 67e62ad540e2088334ad629b7f9be5f793c7612299a75cb6332d0b631b913d0aef6e0577635acad598deaa29633472dc2d46d1d9f0c1c746ee6f06b956957010
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
- options[:doc] = File.expand_path file
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
- File.open(options[:doc], 'w+') do |f|
70
- f << Webpoke.document(options[:group])
71
- end
75
+ options[:doc] << Webpoke.document(options[:group])
72
76
  exit 0
73
77
  end
74
78
 
@@ -1,3 +1,3 @@
1
1
  module Webpoke
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.41"
3
3
  end
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
- data = []
157
+ groups = {}
148
158
 
149
159
  $tests.each do |test|
150
160
  return if group && !test.group == group
151
161
 
152
- data << test.describe
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 data.to_json
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
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