jruby-lint 0.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -1
- data/README.md +5 -2
- data/lib/jruby/lint/checkers.rb +2 -0
- data/lib/jruby/lint/checkers/system.rb +39 -0
- data/lib/jruby/lint/checkers/timeout.rb +21 -0
- data/lib/jruby/lint/github.crt +21 -74
- data/lib/jruby/lint/version.rb +1 -1
- data/spec/fixtures/C-Extension-Alternatives.html +135 -40
- data/spec/jruby/lint/checkers_spec.rb +52 -0
- metadata +4 -2
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -26,17 +26,20 @@ Here is a list of the current checks implemented:
|
|
26
26
|
provide known alternatives.
|
27
27
|
- Report usage of Kernel#fork (which does not work) and Kernel#exec
|
28
28
|
(which does not replace the current process).
|
29
|
+
- Report usage of Timeout::timeout which, when used excessively tend
|
30
|
+
to be slow and expensive because of native threads
|
31
|
+
- Report behavior difference when using system('ruby'), which launches
|
32
|
+
the command in-process in a new copy of the interpreter for speed
|
29
33
|
|
30
34
|
## TODO
|
31
35
|
|
32
36
|
Here is a list of checks and options we'd like to implement:
|
33
37
|
|
34
|
-
- Timeout.timeout
|
35
38
|
- Options to save report off to a file.
|
36
39
|
- Text, HTML formats
|
40
|
+
- Add in check for `` to make sure not execing ruby ...
|
37
41
|
- Report on more threading and concurrency issues/antipatterns
|
38
42
|
- arr.each {|x| arr.delete(x) }
|
39
|
-
- Warn about `system("ruby ...")` etc. how they are run in-process by default
|
40
43
|
- Try to detect IO/File resource usage without blocks
|
41
44
|
- Check .gemspec files for extensions and extconf.rb for
|
42
45
|
#create_makefile and warn about compiliing C extensions
|
data/lib/jruby/lint/checkers.rb
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
module JRuby::Lint
|
2
|
+
module Checkers
|
3
|
+
class System
|
4
|
+
include Checker
|
5
|
+
|
6
|
+
# Make sure to follow all Kernel.system calls
|
7
|
+
def visitCallNode(node)
|
8
|
+
if node.name == "system" || node.name == "`"
|
9
|
+
@call_node = node
|
10
|
+
add_finding(node) if red_flag?(node)
|
11
|
+
proc { @call_node = nil }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# Visits the function calls for system
|
16
|
+
def visitFCallNode(node)
|
17
|
+
if node.name == "system"
|
18
|
+
add_finding(node) if red_flag?(node)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def add_finding(node)
|
23
|
+
collector.findings << Finding.new("Calling Kernel.system('ruby ...') will get called in-process. Sometimes this works differently than expected",
|
24
|
+
[:system, :warning], node.position)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Defines red_flag when argument matches ruby
|
28
|
+
def red_flag?(node)
|
29
|
+
first_arg = node.args_node.child_nodes.first
|
30
|
+
first_arg && first_arg.node_type.to_s == "STRNODE" && ruby_executable?(first_arg)
|
31
|
+
end
|
32
|
+
|
33
|
+
def ruby_executable?(node)
|
34
|
+
match_on = Regexp.union([/.*ruby$/i, /.*j?irb$/i, /\.rb$/i])
|
35
|
+
node.value.split.first =~ match_on
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module JRuby::Lint
|
2
|
+
module Checkers
|
3
|
+
class Timeout
|
4
|
+
include Checker
|
5
|
+
|
6
|
+
def visitCallNode(node)
|
7
|
+
if node.name == "timeout"
|
8
|
+
begin
|
9
|
+
add_finding(collector, node)
|
10
|
+
rescue
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def add_finding(collector, node)
|
16
|
+
collector.findings << Finding.new("Timeout in JRuby does not work in many cases",
|
17
|
+
[:timeout, :warning], node.position)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/jruby/lint/github.crt
CHANGED
@@ -1,76 +1,23 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
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yj9CYpKlBWTrT3JTW
|
10
|
+
PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM
|
11
|
+
xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB
|
12
|
+
Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3
|
13
|
+
hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg
|
14
|
+
EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF
|
15
|
+
MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA
|
16
|
+
FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
|
17
|
+
nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z
|
18
|
+
eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
|
19
|
+
hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
|
20
|
+
Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
|
21
|
+
vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
|
22
|
+
+OkuE6N36B9K
|
76
23
|
-----END CERTIFICATE-----
|
data/lib/jruby/lint/version.rb
CHANGED
@@ -8,11 +8,12 @@
|
|
8
8
|
<head>
|
9
9
|
<meta charset='utf-8'>
|
10
10
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
11
|
+
<script>var NREUMQ=[];NREUMQ.push(["mark","firstbyte",new Date().getTime()]);</script>
|
11
12
|
<title>C Extension Alternatives - GitHub</title>
|
12
13
|
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
|
13
14
|
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub" />
|
14
15
|
|
15
|
-
<link href="https://d3nwyuy0nl342s.cloudfront.net/
|
16
|
+
<link href="https://d3nwyuy0nl342s.cloudfront.net/709540747571a12d9ee0e981881190bbacde01fe/stylesheets/bundle_github.css" media="screen" rel="stylesheet" type="text/css" />
|
16
17
|
|
17
18
|
|
18
19
|
<script type="text/javascript">
|
@@ -26,9 +27,8 @@
|
|
26
27
|
var github_user = null
|
27
28
|
|
28
29
|
</script>
|
29
|
-
<script src="https://d3nwyuy0nl342s.cloudfront.net/
|
30
|
-
<script src="https://d3nwyuy0nl342s.cloudfront.net/
|
31
|
-
<script src="https://d3nwyuy0nl342s.cloudfront.net/ba26f6a198e5e881573c321692d2255635b24eb8/javascripts/bundle_github.js" type="text/javascript"></script>
|
30
|
+
<script src="https://d3nwyuy0nl342s.cloudfront.net/javascripts/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
|
31
|
+
<script src="https://d3nwyuy0nl342s.cloudfront.net/32997e5cd4ce47f6467e629aedf849edcf5a7376/javascripts/bundle_github.js" type="text/javascript"></script>
|
32
32
|
|
33
33
|
|
34
34
|
|
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
|
42
42
|
<link href="https://github.com/jruby/jruby/commits/master.atom" rel="alternate" title="Recent Commits to jruby:master" type="application/atom+xml" />
|
43
|
-
<script src="https://d3nwyuy0nl342s.cloudfront.net/
|
43
|
+
<script src="https://d3nwyuy0nl342s.cloudfront.net/a5293f39de14a50f19260ef05b2ae4a145b2cbce/javascripts/bundle_wiki.js" type="text/javascript"></script>
|
44
44
|
|
45
45
|
<script src="/javascripts/other/MathJax/MathJax.js" type="text/javascript">
|
46
46
|
if (window.location.protocol == "https:") {
|
@@ -57,7 +57,7 @@
|
|
57
57
|
<script type="text/javascript">
|
58
58
|
GitHub.nameWithOwner = GitHub.nameWithOwner || "jruby/jruby";
|
59
59
|
GitHub.currentRef = 'master';
|
60
|
-
GitHub.commitSHA = "
|
60
|
+
GitHub.commitSHA = "f03b829c28c581c661f8916b54978b552cc03ff5";
|
61
61
|
GitHub.currentPath = '';
|
62
62
|
GitHub.masterBranch = "master";
|
63
63
|
|
@@ -93,17 +93,14 @@
|
|
93
93
|
|
94
94
|
|
95
95
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
96
|
<div class="subnavd" id="main">
|
101
97
|
<div id="header" class="true">
|
102
98
|
|
103
99
|
<a class="logo boring" href="https://github.com">
|
104
|
-
|
100
|
+
|
101
|
+
<img alt="github" class="default" height="45" src="https://d3nwyuy0nl342s.cloudfront.net/images/modules/header/logov5.png" />
|
105
102
|
<!--[if (gt IE 8)|!(IE)]><!-->
|
106
|
-
<img alt="github" class="hover" src="https://d3nwyuy0nl342s.cloudfront.net/images/modules/header/
|
103
|
+
<img alt="github" class="hover" height="45" src="https://d3nwyuy0nl342s.cloudfront.net/images/modules/header/logov5-hover.png" />
|
107
104
|
<!--<![endif]-->
|
108
105
|
</a>
|
109
106
|
|
@@ -111,10 +108,14 @@
|
|
111
108
|
<div class="topsearch">
|
112
109
|
|
113
110
|
<ul class="nav logged_out">
|
111
|
+
|
114
112
|
<li class="pricing"><a href="/plans">Pricing and Signup</a></li>
|
113
|
+
|
115
114
|
<li class="explore"><a href="/explore">Explore GitHub</a></li>
|
116
115
|
<li class="features"><a href="/features">Features</a></li>
|
116
|
+
|
117
117
|
<li class="blog"><a href="/blog">Blog</a></li>
|
118
|
+
|
118
119
|
<li class="login"><a href="/login?return_to=%2Fjruby%2Fjruby%2Fwiki%2FC-Extension-Alternatives">Login</a></li>
|
119
120
|
</ul>
|
120
121
|
|
@@ -144,24 +145,23 @@
|
|
144
145
|
|
145
146
|
<li class="for-owner" style="display:none"><a href="/jruby/jruby/admin" class="minibutton btn-admin "><span><span class="icon"></span>Admin</span></a></li>
|
146
147
|
<li>
|
147
|
-
<a href="/jruby/jruby/toggle_watch" class="minibutton btn-watch " id="watch_button" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', '
|
148
|
-
<a href="/jruby/jruby/toggle_watch" class="minibutton btn-watch " id="unwatch_button" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', '
|
148
|
+
<a href="/jruby/jruby/toggle_watch" class="minibutton btn-watch " id="watch_button" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', '39136b986bbed8c260a8aa8d9ff8b1c9bd2b9ac8'); f.appendChild(s);f.submit();return false;" style="display:none"><span><span class="icon"></span>Watch</span></a>
|
149
|
+
<a href="/jruby/jruby/toggle_watch" class="minibutton btn-watch " id="unwatch_button" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', '39136b986bbed8c260a8aa8d9ff8b1c9bd2b9ac8'); f.appendChild(s);f.submit();return false;" style="display:none"><span><span class="icon"></span>Unwatch</span></a>
|
149
150
|
</li>
|
150
151
|
|
151
152
|
|
152
|
-
<li class="for-notforked" style="display:none"><a href="/jruby/jruby/fork" class="minibutton btn-fork " id="fork_button" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', '
|
153
|
+
<li class="for-notforked" style="display:none"><a href="/jruby/jruby/fork" class="minibutton btn-fork " id="fork_button" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', '39136b986bbed8c260a8aa8d9ff8b1c9bd2b9ac8'); f.appendChild(s);f.submit();return false;"><span><span class="icon"></span>Fork</span></a></li>
|
153
154
|
<li class="for-hasfork" style="display:none"><a href="#" class="minibutton btn-fork " id="your_fork_button"><span><span class="icon"></span>Your Fork</span></a></li>
|
154
155
|
|
155
156
|
|
156
157
|
|
157
|
-
|
158
158
|
|
159
159
|
|
160
160
|
|
161
161
|
<li class="repostats">
|
162
162
|
<ul class="repo-stats">
|
163
|
-
<li class="watchers"><a href="/jruby/jruby/watchers" title="Watchers" class="tooltipped downwards">
|
164
|
-
<li class="forks"><a href="/jruby/jruby/network" title="Forks" class="tooltipped downwards">
|
163
|
+
<li class="watchers"><a href="/jruby/jruby/watchers" title="Watchers" class="tooltipped downwards">512</a></li>
|
164
|
+
<li class="forks"><a href="/jruby/jruby/network" title="Forks" class="tooltipped downwards">114</a></li>
|
165
165
|
</ul>
|
166
166
|
</li>
|
167
167
|
</ul>
|
@@ -242,8 +242,6 @@
|
|
242
242
|
|
243
243
|
|
244
244
|
|
245
|
-
|
246
|
-
|
247
245
|
</div>
|
248
246
|
<div class="flash-messages"></div>
|
249
247
|
|
@@ -292,7 +290,7 @@
|
|
292
290
|
Last edited by headius, <abbr class="relatize" title="2011-05-15 17:25:54">Sun May 15 17:25:54 -0700 2011</abbr>
|
293
291
|
</p>
|
294
292
|
<p id="delete-link">
|
295
|
-
<a href="/jruby/jruby/wiki/C-Extension-Alternatives" onclick="if (confirm('Are you sure you want to delete this page?')) { var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method'); m.setAttribute('value', 'delete'); f.appendChild(m);var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', '
|
293
|
+
<a href="/jruby/jruby/wiki/C-Extension-Alternatives" onclick="if (confirm('Are you sure you want to delete this page?')) { var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method'); m.setAttribute('value', 'delete'); f.appendChild(m);var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', '39136b986bbed8c260a8aa8d9ff8b1c9bd2b9ac8'); f.appendChild(s);f.submit(); };return false;"><span>Delete this Page</span></a>
|
296
294
|
</p>
|
297
295
|
</div>
|
298
296
|
</div>
|
@@ -305,27 +303,31 @@
|
|
305
303
|
|
306
304
|
<div id="footer" class="clearfix">
|
307
305
|
<div class="site">
|
308
|
-
|
309
|
-
<
|
310
|
-
<
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
306
|
+
|
307
|
+
<div class="sponsor">
|
308
|
+
<a href="http://www.rackspace.com" class="logo">
|
309
|
+
<img alt="Dedicated Server" height="36" src="https://d3nwyuy0nl342s.cloudfront.net/images/modules/footer/rackspace_logo.png?v2" width="38" />
|
310
|
+
</a>
|
311
|
+
Powered by the <a href="http://www.rackspace.com ">Dedicated
|
312
|
+
Servers</a> and<br/> <a href="http://www.rackspacecloud.com">Cloud
|
313
|
+
Computing</a> of Rackspace Hosting<span>®</span>
|
314
|
+
</div>
|
315
|
+
|
316
316
|
|
317
317
|
<ul class="links">
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
318
|
+
|
319
|
+
<li class="blog"><a href="https://github.com/blog">Blog</a></li>
|
320
|
+
<li><a href="https://github.com/about">About</a></li>
|
321
|
+
<li><a href="https://github.com/contact">Contact & Support</a></li>
|
322
|
+
<li><a href="https://github.com/training">Training</a></li>
|
323
|
+
<li><a href="http://jobs.github.com">Job Board</a></li>
|
324
|
+
<li><a href="http://shop.github.com">Shop</a></li>
|
325
|
+
<li><a href="http://developer.github.com">API</a></li>
|
326
|
+
<li><a href="http://status.github.com">Status</a></li>
|
327
|
+
|
326
328
|
</ul>
|
327
329
|
<ul class="sosueme">
|
328
|
-
<li class="main">© 2011 <span id="_rrt" title="0.
|
330
|
+
<li class="main">© 2011 <span id="_rrt" title="0.09826s from fe4.rs.github.com">GitHub</span> Inc. All rights reserved.</li>
|
329
331
|
<li><a href="/site/terms">Terms of Service</a></li>
|
330
332
|
<li><a href="/site/privacy">Privacy</a></li>
|
331
333
|
<li><a href="https://github.com/security">Security</a></li>
|
@@ -333,7 +335,7 @@
|
|
333
335
|
</div>
|
334
336
|
</div><!-- /#footer -->
|
335
337
|
|
336
|
-
<script>window._auth_token = "
|
338
|
+
<script>window._auth_token = "39136b986bbed8c260a8aa8d9ff8b1c9bd2b9ac8"</script>
|
337
339
|
|
338
340
|
|
339
341
|
<div id="keyboard_shortcuts_pane" class="instapaper_ignore readability-extra" style="display:none">
|
@@ -535,6 +537,98 @@
|
|
535
537
|
</div>
|
536
538
|
</div>
|
537
539
|
|
540
|
+
<div id="markdown-help" class="instapaper_ignore readability-extra">
|
541
|
+
<h2>Markdown Cheat Sheet</h2>
|
542
|
+
|
543
|
+
<div class="cheatsheet-content">
|
544
|
+
|
545
|
+
<div class="mod">
|
546
|
+
<div class="col">
|
547
|
+
<h3>Format Text</h3>
|
548
|
+
<p>Headers</p>
|
549
|
+
<pre>
|
550
|
+
# This is an <h1> tag
|
551
|
+
## This is an <h2> tag
|
552
|
+
###### This is an <h6> tag</pre>
|
553
|
+
<p>Text styles</p>
|
554
|
+
<pre>
|
555
|
+
*This text will be italic*
|
556
|
+
_This will also be italic_
|
557
|
+
**This text will be bold**
|
558
|
+
__This will also be bold__
|
559
|
+
|
560
|
+
*You **can** combine them*
|
561
|
+
</pre>
|
562
|
+
</div>
|
563
|
+
<div class="col">
|
564
|
+
<h3>Lists</h3>
|
565
|
+
<p>Unordered</p>
|
566
|
+
<pre>
|
567
|
+
* Item 1
|
568
|
+
* Item 2
|
569
|
+
* Item 2a
|
570
|
+
* Item 2b</pre>
|
571
|
+
<p>Ordered</p>
|
572
|
+
<pre>
|
573
|
+
1. Item 1
|
574
|
+
2. Item 2
|
575
|
+
3. Item 3
|
576
|
+
* Item 3a
|
577
|
+
* Item 3b</pre>
|
578
|
+
</div>
|
579
|
+
<div class="col">
|
580
|
+
<h3>Miscellaneous</h3>
|
581
|
+
<p>Images</p>
|
582
|
+
<pre>
|
583
|
+
![GitHub Logo](/images/logo.png)
|
584
|
+
Format: ![Alt Text](url)
|
585
|
+
</pre>
|
586
|
+
<p>Links</p>
|
587
|
+
<pre>
|
588
|
+
http://github.com - automatic!
|
589
|
+
[GitHub](http://github.com)</pre>
|
590
|
+
<p>Blockquotes</p>
|
591
|
+
<pre>
|
592
|
+
As Kanye West said:
|
593
|
+
> We're living the future so
|
594
|
+
> the present is our past.
|
595
|
+
</pre>
|
596
|
+
</div>
|
597
|
+
</div>
|
598
|
+
<div class="rule"></div>
|
599
|
+
|
600
|
+
<h3>Code Examples in Markdown</h3>
|
601
|
+
<div class="col">
|
602
|
+
<p>Syntax highlighting with <a href="http://github.github.com/github-flavored-markdown/" title="GitHub Flavored Markdown">GFM</a></p>
|
603
|
+
<pre>
|
604
|
+
```javascript
|
605
|
+
function fancyAlert(arg) {
|
606
|
+
if(arg) {
|
607
|
+
$.facebox({div:'#foo'})
|
608
|
+
}
|
609
|
+
}
|
610
|
+
```</pre>
|
611
|
+
</div>
|
612
|
+
<div class="col">
|
613
|
+
<p>Or, indent your code 4 spaces</p>
|
614
|
+
<pre>
|
615
|
+
Here is a Python code example
|
616
|
+
without syntax highlighting:
|
617
|
+
|
618
|
+
def foo:
|
619
|
+
if not bar:
|
620
|
+
return true</pre>
|
621
|
+
</div>
|
622
|
+
<div class="col">
|
623
|
+
<p>Inline code for comments</p>
|
624
|
+
<pre>
|
625
|
+
I think you should use an
|
626
|
+
`<addr>` element here instead.</pre>
|
627
|
+
</div>
|
628
|
+
</div>
|
629
|
+
|
630
|
+
</div>
|
631
|
+
</div>
|
538
632
|
|
539
633
|
|
540
634
|
<!--[if IE 8]>
|
@@ -550,8 +644,9 @@
|
|
550
644
|
<![endif]-->
|
551
645
|
|
552
646
|
|
553
|
-
<script type='text/javascript'></script>
|
554
647
|
|
648
|
+
|
649
|
+
<script>(function(){var d=document;var e=d.createElement("script");e.async=true;e.src="https://d1ros97qkrwjf5.cloudfront.net/10/eum/rum.js ";var s=d.getElementsByTagName("script")[0];s.parentNode.insertBefore(e,s);})();NREUMQ.push(["nrf2","beacon-3.newrelic.com","2f94e4d8c2",64799,"dw1bEBZcX1RWRhoBFFUSXRdLQ1JKR11WDxZVFlwLCg==",0,151,new Date().getTime()])</script>
|
555
650
|
</body>
|
556
651
|
</html>
|
557
652
|
|
@@ -132,4 +132,56 @@ describe JRuby::Lint::Checkers do
|
|
132
132
|
Then { collector.findings.size.should == 0 }
|
133
133
|
end
|
134
134
|
end
|
135
|
+
|
136
|
+
context "Timeout::timeout" do
|
137
|
+
Given(:checker) { JRuby::Lint::Checkers::Timeout.new }
|
138
|
+
|
139
|
+
context "::timeout usage" do
|
140
|
+
Given(:script) { "Timeout::timeout(5) { sleep 10 }"}
|
141
|
+
When { collector.run }
|
142
|
+
Then { collector.findings.size.should == 1}
|
143
|
+
end
|
144
|
+
|
145
|
+
context ".timeout usage" do
|
146
|
+
Given(:script) { "Timeout.timeout(5) { sleep 10 }" }
|
147
|
+
When { collector.run }
|
148
|
+
Then { collector.findings.size.should == 1}
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
|
153
|
+
context "System" do
|
154
|
+
Given(:checker) { JRuby::Lint::Checkers::System.new }
|
155
|
+
|
156
|
+
context "calling ruby -v in system" do
|
157
|
+
Given(:script) { "system('echo'); system('/usr/bin/ruby -v')"}
|
158
|
+
When { collector.run }
|
159
|
+
Then { collector.findings.size.should == 1}
|
160
|
+
end
|
161
|
+
|
162
|
+
context "calling ruby in the first argument to system" do
|
163
|
+
Given(:script) { "system('/usr/bin/ruby', '-v')"}
|
164
|
+
When { collector.run }
|
165
|
+
Then { collector.findings.size.should == 1}
|
166
|
+
end
|
167
|
+
|
168
|
+
context "calling irb or jirb from system" do
|
169
|
+
Given(:script) { "system('jirb'); system('irb')"}
|
170
|
+
When { collector.run }
|
171
|
+
Then { collector.findings.size.should == 2 }
|
172
|
+
end
|
173
|
+
|
174
|
+
context "calling a .rb file from system" do
|
175
|
+
Given(:script) { "system('asdf.rb')" }
|
176
|
+
When { collector.run }
|
177
|
+
Then { collector.findings.size.should == 1 }
|
178
|
+
end
|
179
|
+
|
180
|
+
context "calling ruby -v in Kernel.system should have a finding" do
|
181
|
+
Given(:script) { "Kernel.system('ruby -v'); Kernel.system('echo \"zomg\"')"}
|
182
|
+
When { collector.run }
|
183
|
+
Then { collector.findings.size.should == 1}
|
184
|
+
end
|
185
|
+
|
186
|
+
end
|
135
187
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: jruby-lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version:
|
5
|
+
version: 0.2.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Nick Sieger
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-06-03 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -122,7 +122,9 @@ files:
|
|
122
122
|
- lib/jruby/lint/checkers/gem.rb
|
123
123
|
- lib/jruby/lint/checkers/gemspec.rb
|
124
124
|
- lib/jruby/lint/checkers/object_space.rb
|
125
|
+
- lib/jruby/lint/checkers/system.rb
|
125
126
|
- lib/jruby/lint/checkers/thread_critical.rb
|
127
|
+
- lib/jruby/lint/checkers/timeout.rb
|
126
128
|
- lib/jruby/lint/cli.rb
|
127
129
|
- lib/jruby/lint/collectors.rb
|
128
130
|
- lib/jruby/lint/collectors/bundler.rb
|