ftw 0.0.6 → 0.0.7

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/test/all.rb CHANGED
@@ -9,8 +9,16 @@ SimpleCov.start
9
9
  # Add '../lib' to the require path.
10
10
  $: << File.join(File.dirname(__FILE__), "..", "lib")
11
11
 
12
- glob = File.join(File.dirname(__FILE__), "ftw", "**", "*.rb")
13
- Dir.glob(glob).each do |path|
12
+ def use(path)
14
13
  puts "Loading tests from #{path}"
15
14
  require File.expand_path(path)
16
15
  end
16
+
17
+ dirname = File.dirname(__FILE__)
18
+ use File.join(dirname, "docs.rb")
19
+
20
+ # Load tests from ./*/**/*.rb (usually ./libraryname/....)
21
+ glob = File.join(dirname, "*", "**", "*.rb")
22
+ Dir.glob(glob).each do |path|
23
+ use path
24
+ end
data/test/docs.rb ADDED
@@ -0,0 +1,42 @@
1
+ require "rubygems"
2
+ require "yard"
3
+ require File.join(File.expand_path(File.dirname(__FILE__)), "testing")
4
+
5
+ describe "documentation tests" do
6
+ before do
7
+ # Use YARD to parse all ruby files found in '../lib'
8
+ libdir = File.join(File.dirname(__FILE__), "..", "lib")
9
+ YARD::Registry.load(Dir.glob(File.join(libdir, "**", "*.rb")))
10
+ @registry = YARD::Registry.all
11
+ end
12
+
13
+ test "All classes, methods, modules, and constants must be documented" do
14
+ # YARD's parser works best in ruby 1.9.x, so skip 1.8.x
15
+ skip if RUBY_VERSION < "1.9.2"
16
+ # Note, the 'find the undocumented things' code here is
17
+ # copied mostly from: YARD 0.7.5's lib/yard/cli/stats.rb
18
+ #
19
+ # Find all undocumented classes, modules, and constants
20
+ undocumented = @registry.select do |o|
21
+ [:class, :module, :constant].include?(o.type) && o.docstring.blank?
22
+ end
23
+
24
+ # Find all undocumented methods
25
+ methods = @registry.select { |m| m.type == :method }
26
+ methods.reject! { |m| m.is_alias? || !m.is_explicit? }
27
+ undocumented += methods.select do |m|
28
+ m.docstring.blank? && !m.overridden_method
29
+ end
30
+
31
+ if (undocumented.length > 0)
32
+ message = ["The following are not documented"]
33
+ undocumented.each do |o|
34
+ message << "* #{o.type.to_s} #{o.to_s} <#{o.file}:#{o.line}>"
35
+ end
36
+
37
+ flunk(message.join("\n"))
38
+ else
39
+ pass
40
+ end
41
+ end
42
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ftw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-14 00:00:00.000000000 Z
12
+ date: 2012-03-05 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: For The Web. Trying to build a solid and sane API for client and server
15
15
  web stuff. Client and Server operations for HTTP, WebSockets, SPDY, etc.
@@ -19,26 +19,34 @@ executables: []
19
19
  extensions: []
20
20
  extra_rdoc_files: []
21
21
  files:
22
- - lib/ftw/websocket.rb
23
- - lib/ftw/pool.rb
24
- - lib/ftw/agent.rb
25
- - lib/ftw/version.rb
26
- - lib/ftw/namespace.rb
27
- - lib/ftw/crlf.rb
28
- - lib/ftw/connection.rb
22
+ - lib/rack/handler/ftw.rb
23
+ - lib/ftw.rb
24
+ - lib/ftw/dns.rb
25
+ - lib/ftw/websocket/rack.rb
26
+ - lib/ftw/websocket/writer.rb
29
27
  - lib/ftw/websocket/parser.rb
30
- - lib/ftw/request.rb
31
- - lib/ftw/cookies.rb
32
- - lib/ftw/http/headers.rb
28
+ - lib/ftw/websocket/constants.rb
29
+ - lib/ftw/poolable.rb
30
+ - lib/ftw/connection.rb
31
+ - lib/ftw/version.rb
32
+ - lib/ftw/agent.rb
33
+ - lib/ftw/pool.rb
34
+ - lib/ftw/server.rb
35
+ - lib/ftw/websocket.rb
33
36
  - lib/ftw/http/message.rb
37
+ - lib/ftw/http/headers.rb
38
+ - lib/ftw/request.rb
39
+ - lib/ftw/protocol.rb
34
40
  - lib/ftw/response.rb
35
- - lib/ftw/dns.rb
36
- - lib/ftw/poolable.rb
37
- - lib/ftw.rb
38
- - test/ftw/crlf.rb
39
- - test/ftw/http/headers.rb
40
- - test/ftw/http/dns.rb
41
+ - lib/ftw/namespace.rb
42
+ - lib/ftw/cookies.rb
43
+ - lib/ftw/singleton.rb
44
+ - lib/ftw/crlf.rb
41
45
  - test/testing.rb
46
+ - test/docs.rb
47
+ - test/ftw/http/dns.rb
48
+ - test/ftw/http/headers.rb
49
+ - test/ftw/crlf.rb
42
50
  - test/all.rb
43
51
  - README.md
44
52
  homepage: http://github.com/jordansissel/ruby-ftw
@@ -63,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
71
  version: '0'
64
72
  requirements: []
65
73
  rubyforge_project:
66
- rubygems_version: 1.8.10
74
+ rubygems_version: 1.8.16
67
75
  signing_key:
68
76
  specification_version: 3
69
77
  summary: For The Web. Trying to build a solid and sane API for client and server web