puppet-validator 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/public/gist.png +0 -0
- data/public/prism.js +1 -1
- data/public/scripts.js +52 -1
- data/public/styles.css +13 -0
- data/public/testing.html +1 -0
- data/views/index.erb +2 -1
- data/views/result.erb +11 -2
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a8844ff2f61370de5412e932959747fa2f6c0a5
|
4
|
+
data.tar.gz: d9737a5ccd70a93cdcc4505d50fb5806b6a6d317
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9dbbae1c479485c6d4fb67d1a25567187c432092f6753ac1a7e51fd0adc07020c7c0a2151300e5f1deb3a5116b4b0b374614096507ae0e2addb72cb0f54d13e
|
7
|
+
data.tar.gz: 9d6833e36e27f4dc18d60ef31234a35251cb9bec346a01876933905c8da44c1baa469ddb26906ac7db6ae6bc6a4fbd13128d51e65b5857ddd0f4dd8892045581
|
data/public/gist.png
ADDED
Binary file
|
data/public/prism.js
CHANGED
@@ -763,7 +763,7 @@ var isLineHeightRounded = (function() {
|
|
763
763
|
return function() {
|
764
764
|
if(typeof res === 'undefined') {
|
765
765
|
var d = document.createElement('div');
|
766
|
-
d.style.fontSize = '
|
766
|
+
d.style.fontSize = '1em';
|
767
767
|
d.style.lineHeight = '1.5';
|
768
768
|
d.style.padding = 0;
|
769
769
|
d.style.border = 0;
|
data/public/scripts.js
CHANGED
@@ -6,7 +6,57 @@ function toggleChecks() {
|
|
6
6
|
|
7
7
|
function toggleMenu() {
|
8
8
|
$('#checks-menu').slideToggle();
|
9
|
-
|
9
|
+
}
|
10
|
+
|
11
|
+
function gist() {
|
12
|
+
var code = $('#code').text();
|
13
|
+
if (typeof(code) == 'string' && $.trim(code).length != 0) {
|
14
|
+
var data = {
|
15
|
+
"description": "Validated by puppetlinter.com",
|
16
|
+
"public": true,
|
17
|
+
"files": {
|
18
|
+
"init.pp": {
|
19
|
+
"content": code
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
$.ajax({
|
24
|
+
url: 'https://api.github.com/gists',
|
25
|
+
type: 'POST',
|
26
|
+
dataType: 'json',
|
27
|
+
data: JSON.stringify(data)
|
28
|
+
})
|
29
|
+
.success(function(response) {
|
30
|
+
console.log(response);
|
31
|
+
popup(null, 'Gist posted to:', response['html_url']);
|
32
|
+
})
|
33
|
+
.error(function(error) {
|
34
|
+
console.warn("Cannot save gist: ", error);
|
35
|
+
popup('Gist save failed.', error);
|
36
|
+
});
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
function popup(title, text, url) {
|
41
|
+
var dialog = $('<div id="popup" />');
|
42
|
+
$(dialog).append( $("<p/>").text(text) );
|
43
|
+
|
44
|
+
if(url) {
|
45
|
+
$(dialog).append( '<ul><li id="url"></li></ul>' )
|
46
|
+
$(dialog).find('li#url').append( $("<a />", { href: url, text: url }) );
|
47
|
+
}
|
48
|
+
|
49
|
+
$(dialog).dialog({
|
50
|
+
modal: true,
|
51
|
+
title: title,
|
52
|
+
width: 425,
|
53
|
+
buttons: {
|
54
|
+
Ok: function () {
|
55
|
+
$(this).dialog("close");
|
56
|
+
$("#dlg").remove();
|
57
|
+
}
|
58
|
+
}
|
59
|
+
});
|
10
60
|
}
|
11
61
|
|
12
62
|
$( document ).ready(function() {
|
@@ -44,4 +94,5 @@ $( document ).ready(function() {
|
|
44
94
|
});
|
45
95
|
}
|
46
96
|
|
97
|
+
$('.share_icon').tooltip();
|
47
98
|
});
|
data/public/styles.css
CHANGED
@@ -64,6 +64,13 @@ div.line-highlight.with-tooltip {
|
|
64
64
|
.results p {
|
65
65
|
margin: 0;
|
66
66
|
}
|
67
|
+
.results img.share_icon {
|
68
|
+
float: right;
|
69
|
+
cursor: pointer;
|
70
|
+
}
|
71
|
+
.results hr {
|
72
|
+
clear: both;
|
73
|
+
}
|
67
74
|
.results div.row:first-of-type {
|
68
75
|
margin-top: 0.5em;
|
69
76
|
}
|
@@ -92,6 +99,7 @@ div.entry {
|
|
92
99
|
}
|
93
100
|
div.entry textarea {
|
94
101
|
width: 100%;
|
102
|
+
font-family: monospace;
|
95
103
|
}
|
96
104
|
|
97
105
|
input#validate,
|
@@ -142,3 +150,8 @@ p.info {
|
|
142
150
|
p.info:first-line {
|
143
151
|
font-weight: bold;
|
144
152
|
}
|
153
|
+
|
154
|
+
/* jquery UI overrides */
|
155
|
+
.ui-widget {
|
156
|
+
font-size: 0.85em;
|
157
|
+
}
|
data/public/testing.html
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
|
6
6
|
</head>
|
7
7
|
<body>
|
8
|
+
<a href="https://github.com/puppetlabs/puppet-validator"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
|
8
9
|
<h1>Testing Puppet Code</h1>
|
9
10
|
<p>
|
10
11
|
This tool will validate the Puppet DSL syntax. It won't actually compile a catalog or
|
data/views/index.erb
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
<script src="scripts.js"></script>
|
7
7
|
</head>
|
8
8
|
<body>
|
9
|
+
<a href="https://github.com/puppetlabs/puppet-validator"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
|
9
10
|
<h1>Puppet Code Validator</h1>
|
10
11
|
<p>Paste Puppet code into the following textbox and check it for validity.</p>
|
11
12
|
<form action="/validate" method="post">
|
@@ -20,7 +21,7 @@
|
|
20
21
|
<% end %>
|
21
22
|
</select>
|
22
23
|
<label><input type="checkbox" name="lint" id="lint" onchange="toggleChecks();">Include <code>puppet-lint</code> style checks.</label>
|
23
|
-
<a class="button" href="
|
24
|
+
<a class="button" href="javascript:toggleMenu();">customize ▾</a>
|
24
25
|
<fieldset id="checks-menu" class="menu">
|
25
26
|
<legend>Enabled Lint Checks</legend>
|
26
27
|
<ul id="checks">
|
data/views/result.erb
CHANGED
@@ -2,15 +2,24 @@
|
|
2
2
|
<head>
|
3
3
|
<title>Puppet Validator</title>
|
4
4
|
<link rel="stylesheet" href="prism-default.css">
|
5
|
+
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
|
5
6
|
<link rel="stylesheet" href="styles.css">
|
6
7
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
|
8
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
|
7
9
|
<script src="prism.js"></script>
|
10
|
+
<script src="scripts.js"></script>
|
8
11
|
</head>
|
9
12
|
<body>
|
13
|
+
<a href="https://github.com/puppetlabs/puppet-validator"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
|
10
14
|
<h1>Validation Results</h1>
|
11
15
|
<fieldset class="results <%= @status %>">
|
12
16
|
<legend>Puppet version <%= @version %></legend>
|
13
|
-
<p
|
17
|
+
<p>
|
18
|
+
<%= @message %>
|
19
|
+
<% if @status == :success %>
|
20
|
+
<img class="share_icon" title="Gist this validated code..." src="gist.png" onclick="gist();" />
|
21
|
+
<% end %>
|
22
|
+
</p>
|
14
23
|
<% if @line %>
|
15
24
|
<div class="row">
|
16
25
|
<span class="label">Line Number:</span><span class="message"><%= @line %></span>
|
@@ -26,7 +35,7 @@
|
|
26
35
|
<p>See inline <code>puppet-lint</code> warnings.</p>
|
27
36
|
<% end %>
|
28
37
|
</fieldset>
|
29
|
-
<pre data-line='<%= @highlights %>' class="line-numbers language-puppet"><code class="line-numbers language-puppet"><%= @code %></code></pre>
|
38
|
+
<pre data-line='<%= @highlights %>' class="line-numbers language-puppet"><code id="code" class="line-numbers language-puppet"><%= @code %></code></pre>
|
30
39
|
<div class="links"><a href="javascript:history.back();">Try Again</a> • <a href="/">Validate More Code</a></div>
|
31
40
|
<p class="info">
|
32
41
|
Be aware that this has <em>only validated syntax</em>. It will not compile or
|
metadata
CHANGED
@@ -1,61 +1,61 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Ford
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: puppet
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.7'
|
34
|
-
- - <
|
34
|
+
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: '5.0'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- -
|
41
|
+
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '2.7'
|
44
|
-
- - <
|
44
|
+
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '5.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: puppet-lint
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - ~>
|
51
|
+
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '1.1'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - ~>
|
58
|
+
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '1.1'
|
61
61
|
description: |2
|
@@ -68,19 +68,20 @@ executables:
|
|
68
68
|
extensions: []
|
69
69
|
extra_rdoc_files: []
|
70
70
|
files:
|
71
|
-
- LICENSE
|
72
71
|
- README.md
|
73
|
-
-
|
72
|
+
- LICENSE
|
74
73
|
- config.ru
|
74
|
+
- bin/puppet-validator
|
75
75
|
- lib/puppet-validator.rb
|
76
|
+
- views/index.erb
|
77
|
+
- views/result.erb
|
78
|
+
- public/gist.png
|
76
79
|
- public/info.png
|
77
80
|
- public/prism-default.css
|
78
81
|
- public/prism.js
|
79
82
|
- public/scripts.js
|
80
83
|
- public/styles.css
|
81
84
|
- public/testing.html
|
82
|
-
- views/index.erb
|
83
|
-
- views/result.erb
|
84
85
|
homepage: https://github.com/puppetlabs/puppet-validator/
|
85
86
|
licenses: []
|
86
87
|
metadata: {}
|
@@ -90,19 +91,18 @@ require_paths:
|
|
90
91
|
- lib
|
91
92
|
required_ruby_version: !ruby/object:Gem::Requirement
|
92
93
|
requirements:
|
93
|
-
- -
|
94
|
+
- - ">="
|
94
95
|
- !ruby/object:Gem::Version
|
95
96
|
version: '0'
|
96
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
98
|
requirements:
|
98
|
-
- -
|
99
|
+
- - ">="
|
99
100
|
- !ruby/object:Gem::Version
|
100
101
|
version: '0'
|
101
102
|
requirements: []
|
102
103
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.0.14.1
|
104
105
|
signing_key:
|
105
106
|
specification_version: 4
|
106
107
|
summary: Puppet code validator as a service
|
107
108
|
test_files: []
|
108
|
-
has_rdoc: false
|