puppet-parse 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +2 -0
- data/README.md +6 -0
- data/lib/puppet-parse/parser.rb +4 -2
- data/lib/puppet-parse/version.rb +1 -1
- data/lib/vendor/puppet/util/monkey_patches.rb +17 -11
- data/puppet-parse.gemspec +1 -1
- metadata +10 -4
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -13,6 +13,12 @@ Analyse puppet manifests and report what classes and defines are specified, and
|
|
13
13
|
rdoc >=3.12, <4.0
|
14
14
|
facter
|
15
15
|
|
16
|
+
## Supported Platforms
|
17
|
+
|
18
|
+
puppet-parse only works on Unix like platforms such as Linux and MacOSX.
|
19
|
+
|
20
|
+
Windows is not supported.
|
21
|
+
|
16
22
|
## Usage
|
17
23
|
|
18
24
|
### By hand
|
data/lib/puppet-parse/parser.rb
CHANGED
@@ -48,8 +48,10 @@ class PuppetParse
|
|
48
48
|
# Skip rdoc items that aren't paragraphs
|
49
49
|
next unless (item.parts.to_s.scan("RDoc::Markup::Paragraph") == ["RDoc::Markup::Paragraph"])
|
50
50
|
# Documentation must be a list - if there's no label then skip
|
51
|
-
|
52
|
-
|
51
|
+
label = item.label
|
52
|
+
next if label.nil?
|
53
|
+
key = label.is_a?(Array) ? label.first : label
|
54
|
+
key = key.tr('^A-Za-z0-9_-', '')
|
53
55
|
docs[key] = item.parts.first.parts
|
54
56
|
end # do item
|
55
57
|
end # endif
|
data/lib/puppet-parse/version.rb
CHANGED
@@ -117,19 +117,25 @@ end
|
|
117
117
|
|
118
118
|
|
119
119
|
class Symbol
|
120
|
-
# So, it turns out that one of the biggest memory allocation hot-spots in
|
121
|
-
#
|
122
|
-
#
|
120
|
+
# So, it turns out that one of the biggest memory allocation hot-spots in our
|
121
|
+
# code was using symbol-to-proc - because it allocated a new instance every
|
122
|
+
# time it was called, rather than caching (in Ruby 1.8.7 and earlier).
|
123
|
+
#
|
124
|
+
# In Ruby 1.9.3 and later Symbol#to_proc does implement a cache so we skip
|
125
|
+
# the change in behavior. our monkey patch.
|
123
126
|
#
|
124
127
|
# Changing this means we can see XX memory reduction...
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
128
|
+
|
129
|
+
if RUBY_VERSION < "1.9.3"
|
130
|
+
if method_defined? :to_proc
|
131
|
+
alias __original_to_proc to_proc
|
132
|
+
def to_proc
|
133
|
+
@my_proc ||= __original_to_proc
|
134
|
+
end
|
135
|
+
else
|
136
|
+
def to_proc
|
137
|
+
@my_proc ||= Proc.new {|*args| args.shift.__send__(self, *args) }
|
138
|
+
end
|
133
139
|
end
|
134
140
|
end
|
135
141
|
|
data/puppet-parse.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = PuppetParse::VERSION
|
17
17
|
|
18
|
-
gem.add_development_dependency "rspec"
|
18
|
+
gem.add_development_dependency "rspec", ">=2.12.0", "<3.0"
|
19
19
|
gem.add_development_dependency "rake"
|
20
20
|
gem.add_runtime_dependency "rdoc", ">=3.12", "<4.0"
|
21
21
|
gem.add_runtime_dependency "facter"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-parse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
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:
|
12
|
+
date: 2014-12-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -18,7 +18,10 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 2.12.0
|
22
|
+
- - <
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '3.0'
|
22
25
|
type: :development
|
23
26
|
prerelease: false
|
24
27
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +29,10 @@ dependencies:
|
|
26
29
|
requirements:
|
27
30
|
- - ! '>='
|
28
31
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
32
|
+
version: 2.12.0
|
33
|
+
- - <
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '3.0'
|
30
36
|
- !ruby/object:Gem::Dependency
|
31
37
|
name: rake
|
32
38
|
requirement: !ruby/object:Gem::Requirement
|