puppet-parse 0.1.0 → 0.1.1

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/.travis.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.1.0
4
+ - 2.0.0
3
5
  - 1.9.3
4
6
  - 1.8.7
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
@@ -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
- next if item.label.nil?
52
- key = item.label.tr('^A-Za-z0-9_-', '')
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
@@ -1,3 +1,3 @@
1
1
  class PuppetParse
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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
- # our code was using symbol-to-proc - because it allocated a new instance
122
- # every time it was called, rather than caching.
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
- if method_defined? :to_proc
126
- alias __original_to_proc to_proc
127
- def to_proc
128
- @my_proc ||= __original_to_proc
129
- end
130
- else
131
- def to_proc
132
- @my_proc ||= Proc.new {|*args| args.shift.__send__(self, *args) }
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.0
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: 2013-03-15 00:00:00.000000000 Z
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: '0'
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: '0'
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