knife-cookbook-doc 0.14.0 → 0.15.0

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWY0ZDM0NzU0Njk3M2Q0NWEwMDBlNGY2M2FkMDk2NTg5MjNkOTBjZg==
4
+ NmNiMDNhYTk3Y2U4MjUzZGExZGY2MGZmOGQzMDMzZTNjZjdjZGUyOQ==
5
5
  data.tar.gz: !binary |-
6
- ODNiODg1ZjA4NTE3ZTI2MmQ3ZjhmZWJhOGIyNGFlOGJmMzUyMjZlYQ==
6
+ ODk5ZDcyMTQzNmQzMWUzYmQ0MGMxMWI1MmJlY2YyODRjNzAyMzU2Mw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZjViNDgzN2MyMzhlNjkwMWUzMDc2NjQwZWMyZmM1NTU3YmI0MDI0NzA2NGZi
10
- MmU4OTAxYWMwNWJkNmNlNWUxODBkZTRjZDkyZDljOTQ0YTA4Yzc5MTAyZjE5
11
- YTEzN2VhMjA3YjBkN2ZkMjgxN2QyYTk1NzFhZDAyMGYyMTk4NDY=
9
+ NWU0ZWQ4YThjNzUzMDE0NzYxNjE3MTlmNjdmNDk1N2M0N2RkZjVmZmRjZWJh
10
+ ODQ2Yjk4NWU1NDRhYzEwNzQ0ZDg4YWU1NjU5NGUwMDMwOGJhMzZjNmMyYzI3
11
+ MzkzZDFlY2E5MzdlMTVkMTA4NGFlOTYyODQ3ZDY3Y2EyYjBlMmM=
12
12
  data.tar.gz: !binary |-
13
- ZWUwYzMyOTZlZDdhOTg3Y2MyM2ZkOGIxZTVjOWEwOWI3NDVlZDkzMGE3OTMz
14
- YmQzNDhhNzRjNTY3YzU0NzViMDU2NjAzNGNjMzQwOTQ2OTQ3YWY1NGUzYjYz
15
- MDEyMjdhODdhNjI4ZTdmYWIzZDJiYzUxMzJkM2UzYmU2ZjgzNWQ=
13
+ ZGNjNTVjMDA5ZTFmZDQ3ODE1OWJhNjQ3MmVmMmYzZTMxMDNkZjgwZjI5ZWM0
14
+ M2NiMjZmODA1ZmFlOTQ4OTRmODBkZDRkNGYwMjcwZDE4ZWJjY2Q3NGFkZWUw
15
+ ZjlkYWFkZmIxYjdmMDMzNjRjZmRlMDQ2NmU0NjU0ODNmNjI4ODU=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # v0.15.0 (Mar 20 2015)
2
+
3
+ * Further bug-fixes for multi-line attributes. Submitted By Drew Blessing.
4
+ * Introduce automated testing infrastructure. Submitted By Drew Blessing.
5
+
1
6
  # v0.14.0 (Mar 17 2015)
2
7
 
3
8
  * Further bug-fixes for multi-line attributes. Submitted By Drew Blessing.
@@ -20,4 +20,5 @@ Gem::Specification.new do |s|
20
20
  s.add_dependency 'erubis'
21
21
 
22
22
  s.add_development_dependency 'rake'
23
+ s.add_development_dependency 'rspec'
23
24
  end
@@ -39,10 +39,10 @@ module KnifeCookbookDoc
39
39
  end
40
40
 
41
41
  # get/parse comments
42
- resource_data = resource_data.gsub(/^=begin\s*\n\s*\#\<\s*\n(.*?)\n^\s*\#\>\n=end\s*\n#{ATTRIBUTE_REGEX}/) do
42
+ resource_data = resource_data.gsub(/^=begin\s*\n\s*\#\<\s*\n(.*?)^\s*\#\>\n=end\s*\n#{ATTRIBUTE_REGEX}/m) do
43
43
  update_attribute($2, $1)
44
44
  end
45
- resource_data = resource_data.gsub(/^\s*\#\<\n(.*?)\n^\s*\#\>\n#{ATTRIBUTE_REGEX}/) do
45
+ resource_data = resource_data.gsub(/^\s*\#\<\n(.*?)^\s*\#\>\n#{ATTRIBUTE_REGEX}/m) do
46
46
  update_attribute($2, $1.gsub(/^\s*\# ?/, ''))
47
47
  end
48
48
  resource_data = resource_data.gsub(/^\s*\#\<\>\s(.*?$)\n#{ATTRIBUTE_REGEX}/) do
@@ -1,3 +1,3 @@
1
1
  module KnifeCookbookDoc
2
- VERSION = '0.14.0'
2
+ VERSION = '0.15.0'
3
3
  end
@@ -0,0 +1,99 @@
1
+ require 'spec_helper'
2
+
3
+ describe KnifeCookbookDoc::AttributesModel do
4
+ describe '#load_descriptions' do
5
+ before do
6
+ allow(IO).to receive(:read).with('attributes/default.rb').and_return(attributes)
7
+ end
8
+ let(:attributes) {
9
+ <<EOS
10
+ #<> Single line comment
11
+ default['knife_cookbook_doc']['attr1'] = 'attr1_value'
12
+
13
+ #<
14
+ # Multiline comment with single line of text
15
+ #>
16
+ default['knife_cookbook_doc']['attr2'] = 'attr2_value'
17
+
18
+ =begin
19
+ #<
20
+ Multiline begin/end with single line of text
21
+ #>
22
+ =end
23
+ default['knife_cookbook_doc']['attr3'] = 'attr3_value'
24
+
25
+ #<
26
+ # Multiline comment with
27
+ multiple lines of text
28
+ #>
29
+ default['knife_cookbook_doc']['attr4'] = 'attr4_value'
30
+
31
+ =begin
32
+ #<
33
+ Multiline begin/end with
34
+ multiple lines of text
35
+ #>
36
+ =end
37
+ default['knife_cookbook_doc']['attr5'] = 'attr5_value'
38
+ EOS
39
+ }
40
+ subject do
41
+ KnifeCookbookDoc::AttributesModel.new('attributes/default.rb').attributes
42
+ end
43
+
44
+ it do
45
+ is_expected.to include(
46
+ [
47
+ "node['knife_cookbook_doc']['attr1']",
48
+ 'Single line comment',
49
+ 'attr1_value',
50
+ []
51
+ ]
52
+ )
53
+ end
54
+
55
+ it do
56
+ is_expected.to include(
57
+ [
58
+ "node['knife_cookbook_doc']['attr2']",
59
+ 'Multiline comment with single line of text',
60
+ 'attr2_value',
61
+ []
62
+ ]
63
+ )
64
+ end
65
+
66
+ it do
67
+ is_expected.to include(
68
+ [
69
+ "node['knife_cookbook_doc']['attr3']",
70
+ 'Multiline begin/end with single line of text',
71
+ 'attr3_value',
72
+ []
73
+ ]
74
+ )
75
+ end
76
+
77
+ it do
78
+ is_expected.to include(
79
+ [
80
+ "node['knife_cookbook_doc']['attr4']",
81
+ "Multiline comment with\nmultiple lines of text",
82
+ 'attr4_value',
83
+ []
84
+ ]
85
+ )
86
+ end
87
+
88
+ it do
89
+ is_expected.to include(
90
+ [
91
+ "node['knife_cookbook_doc']['attr5']",
92
+ "Multiline begin/end with\nmultiple lines of text",
93
+ 'attr5_value',
94
+ []
95
+ ]
96
+ )
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,2 @@
1
+ require 'rspec'
2
+ require_relative '../lib/knife_cookbook_doc/attributes_model'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-cookbook-doc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathias Lafeldt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-18 00:00:00.000000000 Z
12
+ date: 2015-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
@@ -53,6 +53,20 @@ dependencies:
53
53
  - - ! '>='
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rspec
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
56
70
  description: Knife plugin to generate README.md for a cookbook
57
71
  email:
58
72
  - mathias.lafeldt@gmail.com
@@ -80,6 +94,8 @@ files:
80
94
  - lib/knife_cookbook_doc/recipe_model.rb
81
95
  - lib/knife_cookbook_doc/resource_model.rb
82
96
  - lib/knife_cookbook_doc/version.rb
97
+ - spec/knife_cookbook_doc/attribute_model_spec.rb
98
+ - spec/spec_helper.rb
83
99
  homepage: http://realityforge.github.com/knife-cookbook-doc
84
100
  licenses:
85
101
  - Apache 2.0
@@ -104,5 +120,7 @@ rubygems_version: 2.0.3
104
120
  signing_key:
105
121
  specification_version: 4
106
122
  summary: Knife plugin to generate README.md for a cookbook
107
- test_files: []
123
+ test_files:
124
+ - spec/knife_cookbook_doc/attribute_model_spec.rb
125
+ - spec/spec_helper.rb
108
126
  has_rdoc: