drud 0.0.1 → 0.0.2
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 +4 -4
- data/.gitignore +6 -0
- data/Gemfile +0 -1
- data/README.md +16 -18
- data/Rakefile +10 -6
- data/drud.gemspec +33 -25
- data/lib/drud.rb +2 -7
- data/lib/drud/readme.rb +188 -0
- data/lib/drud/version.rb +6 -0
- data/spec/drud_spec.rb +7 -0
- data/spec/spec_helper.rb +1 -34
- data/templates/readme.md.erb +73 -0
- metadata +88 -100
- data/.travis.yml +0 -17
- data/bin/drud +0 -9
- data/lib/drud/cli.rb +0 -25
- data/spec/rescue_spec.rb +0 -13
- data/spec/version_spec.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebd5fb41a15f144c14fe4dbe6709ee11d72336b6
|
4
|
+
data.tar.gz: 8e629b42a457671b63e8ccbc0b5d1879e0f9aa3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c0b9ed6a2ff38dbd2182684fb9a48e254556c7b5991745d6700ada880d02d87136bdc57e1c3777352e8ff331a50ad9c71c9a0533334dad79443937d716c5994
|
7
|
+
data.tar.gz: 904991edd28bb5460803447cde01b6437ca645aaf21e637513f8bc457f9227348ee18bb7e49efb43eeb54e8a415d7aeb317293fdc09a617969efb79477b15d4e
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
[](https://travis-ci.org/newmediadenver/drud) [](https://coveralls.io/r/newmediadenver/drud?branch=master) [](https://gemnasium.com/newmediadenver/drud) [](https://codeclimate.com/github/newmediadenver/drud)
|
2
|
-
|
3
1
|
# Drud
|
4
2
|
|
5
|
-
|
3
|
+
Evaluates an opscode chef cookbook's [metadata](https://github.com/cyberswat){http://docs.opscode.com/essentials_cookbook_metadata.html} and [github](https://github.com/) history to generate a README.md file. The README.md is placed in the root level of the cookbook. This forces cookbook developers to properly use metadata to document their cookbooks efficiently. Additionally, it provides proper attribution for all committers in the project with links back to the contributors github profile. It is written to take advantage of cookbooks that properly utilize both Rake tasks and metadata.
|
4
|
+
|
5
|
+
You can see this in use in our cookbooks. Our reference cookbook is https://github.com/newmediadenver/nmd-skeletor
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -18,22 +18,20 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
$ gem install drud
|
20
20
|
|
21
|
-
##
|
22
|
-
|
23
|
-
Fork it.
|
24
|
-
|
25
|
-
http://github.com/<my-github-username>/drud/fork
|
21
|
+
## Usage
|
26
22
|
|
27
|
-
|
23
|
+
Here's an example rake task that could be placed in your cookbooks Rake file.
|
28
24
|
|
29
|
-
|
25
|
+
desc 'Generate the Readme.md file.'
|
26
|
+
task :readme do
|
27
|
+
drud = Drud::Readme.new(File.dirname(__FILE__))
|
28
|
+
drud.render
|
29
|
+
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
$ git commit -am 'Add some feature'
|
34
|
-
|
35
|
-
Push to the branch.
|
36
|
-
|
37
|
-
$ git push origin my-new-feature
|
31
|
+
## Contributing
|
38
32
|
|
39
|
-
|
33
|
+
1. Fork it ( https://github.com/[my-github-username]/drud/fork )
|
34
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
35
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
36
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
37
|
+
5. Create a new Pull Request
|
data/Rakefile
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'rspec/core/rake_task'
|
3
|
+
require 'bundler/gem_tasks'
|
3
4
|
require 'rubocop/rake_task'
|
5
|
+
require 'rdoc/task'
|
4
6
|
|
5
|
-
|
7
|
+
RDoc::Task.new do |rdoc|
|
8
|
+
rdoc.main = 'README.rdoc'
|
9
|
+
rdoc.rdoc_files.include('lib/*.rb', 'lib/drud/*.rb')
|
10
|
+
end
|
6
11
|
|
7
|
-
|
8
|
-
task test: [:rubocop, :spec]
|
9
|
-
|
10
|
-
desc 'Run RSpec tests'
|
12
|
+
desc 'Run rspec tests'
|
11
13
|
RSpec::Core::RakeTask.new(:spec)
|
12
14
|
|
13
15
|
desc 'Run RuboCop style and lint checks'
|
14
|
-
|
16
|
+
RuboCop::RakeTask.new(:rubocop)
|
17
|
+
|
18
|
+
task default: :rubocop
|
data/drud.gemspec
CHANGED
@@ -1,34 +1,42 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'drud/version'
|
4
5
|
|
5
6
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name
|
7
|
-
spec.version
|
8
|
-
spec.authors
|
9
|
-
spec.email
|
10
|
-
spec.summary
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
spec.name = 'drud'
|
8
|
+
spec.version = Drud::VERSION
|
9
|
+
spec.authors = ['Kevin Bridges']
|
10
|
+
spec.email = ['kevin@cyberswat.com']
|
11
|
+
spec.summary = 'Generates the README.md file for Chef cookbooks.'
|
12
|
+
desc = 'Evaluates an opscode chef cookbook\'s metadata and github history to'
|
13
|
+
desc << ' generate a README.md file. The README.rb is placed in the root '
|
14
|
+
desc << 'level of the cookbook. This forces cookbook developers to properly '
|
15
|
+
desc << 'use metadata to document their cookbooks efficiently. Additionally'
|
16
|
+
desc << ', it provides proper attribution for all committers in the project '
|
17
|
+
desc << 'with links back to the contributors github profile. It is written '
|
18
|
+
desc << 'to take advantage of cookbooks that properly utilize both Rake '
|
19
|
+
desc << 'tasks and metadata.'
|
15
20
|
|
16
|
-
spec.
|
17
|
-
spec.
|
18
|
-
spec.
|
19
|
-
.map { |f| File.basename(f) }
|
20
|
-
spec.require_paths = ['lib']
|
21
|
+
spec.description = desc
|
22
|
+
spec.homepage = 'https://newmediadenver.com/'
|
23
|
+
spec.license = 'MIT'
|
21
24
|
|
22
|
-
spec.
|
25
|
+
spec.files = `git ls-files -z`.split("\x0")
|
26
|
+
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
|
27
|
+
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
|
28
|
+
spec.require_paths = ['lib']
|
23
29
|
|
24
|
-
spec.
|
25
|
-
spec.
|
26
|
-
spec.
|
27
|
-
spec.
|
28
|
-
spec.
|
29
|
-
spec.
|
30
|
-
spec.
|
31
|
-
spec.
|
32
|
-
|
33
|
-
|
30
|
+
spec.add_runtime_dependency 'chef', '~>11.12.8'
|
31
|
+
spec.add_runtime_dependency 'octokit', '~>3.0'
|
32
|
+
spec.add_runtime_dependency 'rake', '~>10.3.2'
|
33
|
+
spec.add_runtime_dependency 'foodcritic', '~>4.0'
|
34
|
+
spec.add_runtime_dependency 'rubocop', '~>0.24.1'
|
35
|
+
spec.add_runtime_dependency 'test-kitchen', '~>1.2.1'
|
36
|
+
spec.add_runtime_dependency 'kitchen-vagrant', '~>0.15.0'
|
37
|
+
spec.add_runtime_dependency 'vagrant-wrapper', '~>1.2.1.1'
|
38
|
+
spec.add_runtime_dependency 'berkshelf', '~>3.1.4'
|
39
|
+
spec.add_runtime_dependency 'rspec', '~> 3.0.0'
|
40
|
+
spec.add_runtime_dependency 'bundler', '~> 1.6.4'
|
41
|
+
spec.add_runtime_dependency 'simplecov', '~> 0.9.0'
|
34
42
|
end
|
data/lib/drud.rb
CHANGED
data/lib/drud/readme.rb
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
require 'chef/cookbook/metadata'
|
2
|
+
require 'octokit'
|
3
|
+
require 'rake'
|
4
|
+
require 'rake/task_manager'
|
5
|
+
require 'erb'
|
6
|
+
require 'ostruct'
|
7
|
+
require 'yaml'
|
8
|
+
|
9
|
+
module Drud
|
10
|
+
# Constructs a new ERB object for rendering a Readme.md file.
|
11
|
+
class ReadmeTemplate < OpenStruct
|
12
|
+
# Desribe the behaviour of the method
|
13
|
+
#
|
14
|
+
# ==== Attributes
|
15
|
+
#
|
16
|
+
# * +:template+ - The template to render against.
|
17
|
+
#
|
18
|
+
# ==== Examples
|
19
|
+
# Assuming this is the content of template.erb:
|
20
|
+
# My metadata is <%= metadata %>
|
21
|
+
# You would render it with the following:
|
22
|
+
# markdown = ReadmeTemplate.new(metadata: @metadata)
|
23
|
+
# markdown.render(File.read('template.erb'))
|
24
|
+
def render(template)
|
25
|
+
ERB.new(template).result(binding)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
# Evaluates an opscode chef cookbook's
|
29
|
+
# {metadata}[http://docs.opscode.com/essentials_cookbook_metadata.html] and
|
30
|
+
# {github}[https://github.com/] history to generate a README.md file. The
|
31
|
+
# README.rb is placed in the root level of the cookbook. This forces cookbook
|
32
|
+
# developers to properly use metadata to document their cookbooks
|
33
|
+
# efficiently. Additionally, it provides proper attribution for all
|
34
|
+
# committers in the project with links back to the contributors github
|
35
|
+
# profile. It is written to take advantage of cookbooks that properly utilize
|
36
|
+
# both Rake tasks and metadata.
|
37
|
+
class Readme
|
38
|
+
# The path to the cookbook being processed.
|
39
|
+
attr_accessor :cookbook
|
40
|
+
# The cookbook as represented by Chef::Cookbook::Metadata.
|
41
|
+
attr_accessor :metadata
|
42
|
+
# The raw git log for the cookbook.
|
43
|
+
attr_accessor :logs
|
44
|
+
# A scaled down version of the logs, eg: {commit, author}
|
45
|
+
attr_accessor :commits
|
46
|
+
# A hash containing credit information by author keyed by the authors
|
47
|
+
# github profile uri.
|
48
|
+
attr_accessor :credit
|
49
|
+
# Rake task information extracted from the target cookbook.
|
50
|
+
attr_accessor :tasks
|
51
|
+
|
52
|
+
# Initialize a new instance of Drud::Readme
|
53
|
+
#
|
54
|
+
# ==== Attributes
|
55
|
+
#
|
56
|
+
# * +:path+ - The local path of the cookbook.
|
57
|
+
#
|
58
|
+
# ==== Examples
|
59
|
+
# This can be placed in a convenient location, such as a Rake task inside
|
60
|
+
# the cookbook. When the render method is called, it will overwrite the
|
61
|
+
# cookbooks README.md
|
62
|
+
# readme = Drud::Readme.new(File.dirname(__FILE__))
|
63
|
+
# readme.render
|
64
|
+
def initialize(path)
|
65
|
+
@cookbook = path
|
66
|
+
@type = :chef
|
67
|
+
@metadata = load_metadata
|
68
|
+
@logs = load_logs
|
69
|
+
@commits, @credit, @tasks = {}, {}, {}
|
70
|
+
parse_rake_tasks
|
71
|
+
parse_commits
|
72
|
+
parse_credit
|
73
|
+
end
|
74
|
+
|
75
|
+
# Renders the README.md file and saves it in the cookbooks path.
|
76
|
+
def render
|
77
|
+
markdown = ReadmeTemplate.new(
|
78
|
+
metadata: @metadata, tasks: @tasks, credit: @credit
|
79
|
+
)
|
80
|
+
template_path = File.join(
|
81
|
+
File.dirname(File.expand_path(__FILE__)),
|
82
|
+
'../../templates/readme.md.erb'
|
83
|
+
)
|
84
|
+
readme = markdown.render(File.read(template_path))
|
85
|
+
File.open("#{@cookbook}/README.md", 'w') { |file| file.write(readme) }
|
86
|
+
end
|
87
|
+
|
88
|
+
private
|
89
|
+
|
90
|
+
# Reads the cookbooks metadata and instantiates an instance of
|
91
|
+
# Chef::Cookbook::Metadata
|
92
|
+
def load_metadata # :doc:
|
93
|
+
metadata = Chef::Cookbook::Metadata.new
|
94
|
+
metadata.from_file("#{@cookbook}/metadata.rb")
|
95
|
+
metadata
|
96
|
+
end
|
97
|
+
|
98
|
+
# Uses the git log command to extract the cookbook's log information.
|
99
|
+
def load_logs # :doc:
|
100
|
+
logs = `cd #{@cookbook} && git log`.split('commit ')
|
101
|
+
logs.shift
|
102
|
+
logs
|
103
|
+
end
|
104
|
+
|
105
|
+
# Parses the results of git log and creates a simplified hash, eg:
|
106
|
+
# {commit, author}.
|
107
|
+
def parse_commits # :doc:
|
108
|
+
@logs.map do |log|
|
109
|
+
@commits[log.split("\n").shift] = /(^A[a-z]+: )(.+)$/.match(log)[2]
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
# Parses a hash of commit information and generates a hash containing the
|
114
|
+
# authors github profile path and number of commits. Some authors may have
|
115
|
+
# multiple author names so the resulting hash is passed to format_credit
|
116
|
+
# for additional processing.
|
117
|
+
def parse_credit # :doc:
|
118
|
+
credit = {}
|
119
|
+
@commits.each do |commit, author|
|
120
|
+
credit[author][:count] += 1 unless credit[author].nil?
|
121
|
+
next unless credit[author].nil?
|
122
|
+
credit[author] = {}
|
123
|
+
credit[author][:count] = 1
|
124
|
+
credit[author][:html_url] = github_html_url commit
|
125
|
+
end
|
126
|
+
format_credit credit
|
127
|
+
end
|
128
|
+
|
129
|
+
# Formats the hash generated by parse_credit.
|
130
|
+
#
|
131
|
+
# ==== Attributes
|
132
|
+
#
|
133
|
+
# * +:credit+ - A hash of credit information to parse.
|
134
|
+
def format_credit(credit) # :doc:
|
135
|
+
f = @credit
|
136
|
+
credit.each do |name, data|
|
137
|
+
f[data[:html_url]] = {} if f[data[:html_url]].nil?
|
138
|
+
f[data[:html_url]][:names] = Set.new if f[data[:html_url]][:names].nil?
|
139
|
+
clean_name = /([^<]*)/.match(name)[1].strip
|
140
|
+
f[data[:html_url]][:names].add(clean_name)
|
141
|
+
count = f[data[:html_url]][:count]
|
142
|
+
f[data[:html_url]][:count] += data[:count] unless count.nil?
|
143
|
+
f[data[:html_url]][:count] = data[:count] if count.nil?
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
# Uses the Ocktokit client to read information about a commit from the
|
148
|
+
# cookbooks origin. This is an unauthenticated request to the github API
|
149
|
+
# and might be throttled if you exceed github's limits. It is only called
|
150
|
+
# once per author in a cookbooks project. This only returns the html_url to
|
151
|
+
# the authors github profile.
|
152
|
+
#
|
153
|
+
# ==== Attributes
|
154
|
+
#
|
155
|
+
# * +:commit+ - The commit hash to get information from.
|
156
|
+
def github_html_url(commit) # :doc:
|
157
|
+
info = `cd #{@cookbook} && git remote -v`
|
158
|
+
origin = /^origin.+?:([^\.+]*)/.match(info)[1]
|
159
|
+
client = Octokit::Client.new
|
160
|
+
detail = client.commit(origin, commit)
|
161
|
+
detail[:author][:html_url]
|
162
|
+
end
|
163
|
+
|
164
|
+
# Loads an instance of Rake::Application from the cookbooks Rakefile for
|
165
|
+
# additional processing.
|
166
|
+
def load_rake # :doc:
|
167
|
+
Dir.chdir @cookbook
|
168
|
+
rake = Rake::Application.new
|
169
|
+
Rake::TaskManager.record_task_metadata = true
|
170
|
+
Rake.application = rake
|
171
|
+
rake.init
|
172
|
+
rake.load_rakefile
|
173
|
+
end
|
174
|
+
|
175
|
+
# Parses metadata from the cookbooks Rake Tasks.
|
176
|
+
def parse_rake_tasks # :doc:
|
177
|
+
load_rake
|
178
|
+
Rake.application.tasks.each do |t|
|
179
|
+
@tasks[t] = {
|
180
|
+
'sources' => t.sources, 'full_comment' => t.full_comment,
|
181
|
+
'actions' => t.actions, 'application' => t.application,
|
182
|
+
'comment' => t.comment, 'prerequisites' => t.prerequisites,
|
183
|
+
'scope' => t.scope
|
184
|
+
}
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
data/lib/drud/version.rb
ADDED
data/spec/drud_spec.rb
ADDED
data/spec/spec_helper.rb
CHANGED
@@ -1,39 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'simplecov'
|
3
|
-
require 'coveralls'
|
4
|
-
|
5
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
6
|
-
SimpleCov::Formatter::HTMLFormatter,
|
7
|
-
Coveralls::SimpleCov::Formatter
|
8
|
-
]
|
9
|
-
|
10
3
|
SimpleCov.start do
|
11
|
-
add_filter '/
|
12
|
-
minimum_coverage(80.00)
|
4
|
+
add_filter 'vendor/'
|
13
5
|
end
|
14
|
-
|
15
|
-
require 'bundler/setup'
|
16
6
|
require 'drud'
|
17
|
-
Bundler.setup
|
18
|
-
$0 = 'drud'
|
19
|
-
ARGV.clear
|
20
|
-
|
21
|
-
RSpec.configure do |config|
|
22
|
-
# Use color output for RSpec
|
23
|
-
config.color_enabled = true
|
24
|
-
|
25
|
-
# Use documentation output formatter
|
26
|
-
config.formatter = :documentation
|
27
|
-
def capture(stream)
|
28
|
-
begin
|
29
|
-
stream = stream.to_s
|
30
|
-
eval "$#{stream} = StringIO.new" # rubocop:disable Eval
|
31
|
-
yield
|
32
|
-
result = eval("$#{stream}").string # rubocop:disable Eval
|
33
|
-
ensure
|
34
|
-
eval("$#{stream} = #{stream.upcase}") # rubocop:disable Eval
|
35
|
-
end
|
36
|
-
|
37
|
-
result
|
38
|
-
end
|
39
|
-
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
<%= metadata.maintainer %>'s <%= metadata.name %> cookbook
|
2
|
+
=============================
|
3
|
+
|
4
|
+
<%= metadata.name %> (<%= metadata.version %>) <%= metadata.description %>
|
5
|
+
|
6
|
+
<%= metadata.long_description %>
|
7
|
+
|
8
|
+
Requirements
|
9
|
+
------------
|
10
|
+
|
11
|
+
### Platforms
|
12
|
+
<% metadata.platforms.each do |os, version| %>
|
13
|
+
`<%= os %> <%= version %>`
|
14
|
+
<% end %>
|
15
|
+
### Dependencies
|
16
|
+
<% metadata.dependencies.each do |os, version| %>
|
17
|
+
`<%= os %> <%= version %>`
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
Attributes
|
21
|
+
----------
|
22
|
+
<% metadata.attributes.each do |name, values| %>
|
23
|
+
<%= name %>
|
24
|
+
calculated: <%= values['calculated'] %>
|
25
|
+
choice: <%= values['choice'].inspect %>
|
26
|
+
default: <%= values['default'] %>
|
27
|
+
description: <%= values['description'] %>
|
28
|
+
display_name: <%= values['display_name'] %>
|
29
|
+
type: <%= values['type'] %>
|
30
|
+
recipes: <%= values['recipes'].inspect %>
|
31
|
+
required: <%= values['required'] %>
|
32
|
+
<% end %>
|
33
|
+
|
34
|
+
Recipes
|
35
|
+
-------
|
36
|
+
<% metadata.recipes.each do |name, desc| %>
|
37
|
+
<%= name %>
|
38
|
+
<%= desc %>
|
39
|
+
<% end %>
|
40
|
+
Testing and Utility
|
41
|
+
-------<% tasks.each do |task, detail| %>
|
42
|
+
<%= task.inspect %><%= "\n #{detail['full_comment']}" unless detail['full_comment'].nil? %>
|
43
|
+
<% end %>
|
44
|
+
License and Authors
|
45
|
+
------------------
|
46
|
+
|
47
|
+
The following engineers have contributed to this code:
|
48
|
+
<% credit.each do |html_url, data| %> * [<%= data[:names].to_a.join(', ') %>](<%= html_url %>) - <%= data[:count] %> commits
|
49
|
+
<% end %>
|
50
|
+
Copyright:: 2014, NewMedia Denver
|
51
|
+
|
52
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
53
|
+
you may not use this file except in compliance with the License.
|
54
|
+
You may obtain a copy of the License at
|
55
|
+
|
56
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
57
|
+
|
58
|
+
Unless required by applicable law or agreed to in writing, software
|
59
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
60
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
61
|
+
See the License for the specific language governing permissions and
|
62
|
+
limitations under the License.
|
63
|
+
|
64
|
+
Contributing
|
65
|
+
------------
|
66
|
+
|
67
|
+
We welcome contributed improvements and bug fixes via the usual workflow:
|
68
|
+
|
69
|
+
1. Fork this repository
|
70
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
71
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
72
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
73
|
+
5. Create a new pull request
|
metadata
CHANGED
@@ -1,219 +1,209 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Bridges
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: chef
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 0.19.1
|
19
|
+
version: 11.12.8
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 0.19.1
|
26
|
+
version: 11.12.8
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
28
|
+
name: octokit
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
31
|
- - "~>"
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
40
|
-
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 1.5.3
|
43
|
-
type: :development
|
33
|
+
version: '3.0'
|
34
|
+
type: :runtime
|
44
35
|
prerelease: false
|
45
36
|
version_requirements: !ruby/object:Gem::Requirement
|
46
37
|
requirements:
|
47
38
|
- - "~>"
|
48
39
|
- !ruby/object:Gem::Version
|
49
|
-
version: '
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: 1.5.3
|
40
|
+
version: '3.0'
|
53
41
|
- !ruby/object:Gem::Dependency
|
54
42
|
name: rake
|
55
43
|
requirement: !ruby/object:Gem::Requirement
|
56
44
|
requirements:
|
57
45
|
- - "~>"
|
58
46
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
60
|
-
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 10.3.1
|
63
|
-
type: :development
|
47
|
+
version: 10.3.2
|
48
|
+
type: :runtime
|
64
49
|
prerelease: false
|
65
50
|
version_requirements: !ruby/object:Gem::Requirement
|
66
51
|
requirements:
|
67
52
|
- - "~>"
|
68
53
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
70
|
-
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: 10.3.1
|
54
|
+
version: 10.3.2
|
73
55
|
- !ruby/object:Gem::Dependency
|
74
|
-
name:
|
56
|
+
name: foodcritic
|
75
57
|
requirement: !ruby/object:Gem::Requirement
|
76
58
|
requirements:
|
77
59
|
- - "~>"
|
78
60
|
- !ruby/object:Gem::Version
|
79
|
-
version: '
|
80
|
-
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 2.14.1
|
83
|
-
type: :development
|
61
|
+
version: '4.0'
|
62
|
+
type: :runtime
|
84
63
|
prerelease: false
|
85
64
|
version_requirements: !ruby/object:Gem::Requirement
|
86
65
|
requirements:
|
87
66
|
- - "~>"
|
88
67
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
90
|
-
- - ">="
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: 2.14.1
|
68
|
+
version: '4.0'
|
93
69
|
- !ruby/object:Gem::Dependency
|
94
70
|
name: rubocop
|
95
71
|
requirement: !ruby/object:Gem::Requirement
|
96
72
|
requirements:
|
97
73
|
- - "~>"
|
98
74
|
- !ruby/object:Gem::Version
|
99
|
-
version:
|
100
|
-
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 0.21.0
|
103
|
-
type: :development
|
75
|
+
version: 0.24.1
|
76
|
+
type: :runtime
|
104
77
|
prerelease: false
|
105
78
|
version_requirements: !ruby/object:Gem::Requirement
|
106
79
|
requirements:
|
107
80
|
- - "~>"
|
108
81
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
110
|
-
- - ">="
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version: 0.21.0
|
82
|
+
version: 0.24.1
|
113
83
|
- !ruby/object:Gem::Dependency
|
114
|
-
name:
|
84
|
+
name: test-kitchen
|
115
85
|
requirement: !ruby/object:Gem::Requirement
|
116
86
|
requirements:
|
117
87
|
- - "~>"
|
118
88
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
120
|
-
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version: 0.8.2
|
123
|
-
type: :development
|
89
|
+
version: 1.2.1
|
90
|
+
type: :runtime
|
124
91
|
prerelease: false
|
125
92
|
version_requirements: !ruby/object:Gem::Requirement
|
126
93
|
requirements:
|
127
94
|
- - "~>"
|
128
95
|
- !ruby/object:Gem::Version
|
129
|
-
version:
|
130
|
-
- - ">="
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: 0.8.2
|
96
|
+
version: 1.2.1
|
133
97
|
- !ruby/object:Gem::Dependency
|
134
|
-
name:
|
98
|
+
name: kitchen-vagrant
|
135
99
|
requirement: !ruby/object:Gem::Requirement
|
136
100
|
requirements:
|
137
101
|
- - "~>"
|
138
102
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
140
|
-
|
141
|
-
- !ruby/object:Gem::Version
|
142
|
-
version: 0.7.0
|
143
|
-
type: :development
|
103
|
+
version: 0.15.0
|
104
|
+
type: :runtime
|
144
105
|
prerelease: false
|
145
106
|
version_requirements: !ruby/object:Gem::Requirement
|
146
107
|
requirements:
|
147
108
|
- - "~>"
|
148
109
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: 0.7.0
|
110
|
+
version: 0.15.0
|
153
111
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
112
|
+
name: vagrant-wrapper
|
155
113
|
requirement: !ruby/object:Gem::Requirement
|
156
114
|
requirements:
|
157
115
|
- - "~>"
|
158
116
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
160
|
-
|
161
|
-
- !ruby/object:Gem::Version
|
162
|
-
version: 1.6.10
|
163
|
-
type: :development
|
117
|
+
version: 1.2.1.1
|
118
|
+
type: :runtime
|
164
119
|
prerelease: false
|
165
120
|
version_requirements: !ruby/object:Gem::Requirement
|
166
121
|
requirements:
|
167
122
|
- - "~>"
|
168
123
|
- !ruby/object:Gem::Version
|
169
|
-
version:
|
170
|
-
|
124
|
+
version: 1.2.1.1
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: berkshelf
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
171
130
|
- !ruby/object:Gem::Version
|
172
|
-
version: 1.
|
131
|
+
version: 3.1.4
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 3.1.4
|
173
139
|
- !ruby/object:Gem::Dependency
|
174
|
-
name:
|
140
|
+
name: rspec
|
175
141
|
requirement: !ruby/object:Gem::Requirement
|
176
142
|
requirements:
|
177
143
|
- - "~>"
|
178
144
|
- !ruby/object:Gem::Version
|
179
|
-
version:
|
180
|
-
|
145
|
+
version: 3.0.0
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
181
151
|
- !ruby/object:Gem::Version
|
182
|
-
version:
|
183
|
-
|
152
|
+
version: 3.0.0
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: bundler
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 1.6.4
|
160
|
+
type: :runtime
|
184
161
|
prerelease: false
|
185
162
|
version_requirements: !ruby/object:Gem::Requirement
|
186
163
|
requirements:
|
187
164
|
- - "~>"
|
188
165
|
- !ruby/object:Gem::Version
|
189
|
-
version:
|
190
|
-
|
166
|
+
version: 1.6.4
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: simplecov
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 0.9.0
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
191
179
|
- !ruby/object:Gem::Version
|
192
|
-
version: 0.
|
193
|
-
description:
|
194
|
-
|
180
|
+
version: 0.9.0
|
181
|
+
description: Evaluates an opscode chef cookbook's metadata and github history to generate
|
182
|
+
a README.md file. The README.rb is placed in the root level of the cookbook. This
|
183
|
+
forces cookbook developers to properly use metadata to document their cookbooks
|
184
|
+
efficiently. Additionally, it provides proper attribution for all committers in
|
185
|
+
the project with links back to the contributors github profile. It is written to
|
186
|
+
take advantage of cookbooks that properly utilize both Rake tasks and metadata.
|
195
187
|
email:
|
196
188
|
- kevin@cyberswat.com
|
197
|
-
executables:
|
198
|
-
- drud
|
189
|
+
executables: []
|
199
190
|
extensions: []
|
200
191
|
extra_rdoc_files: []
|
201
192
|
files:
|
202
193
|
- ".gitignore"
|
203
194
|
- ".rubocop.yml"
|
204
|
-
- ".travis.yml"
|
205
195
|
- Gemfile
|
206
196
|
- LICENSE.txt
|
207
197
|
- README.md
|
208
198
|
- Rakefile
|
209
|
-
- bin/drud
|
210
199
|
- drud.gemspec
|
211
200
|
- lib/drud.rb
|
212
|
-
- lib/drud/
|
213
|
-
-
|
201
|
+
- lib/drud/readme.rb
|
202
|
+
- lib/drud/version.rb
|
203
|
+
- spec/drud_spec.rb
|
214
204
|
- spec/spec_helper.rb
|
215
|
-
-
|
216
|
-
homepage: https://
|
205
|
+
- templates/readme.md.erb
|
206
|
+
homepage: https://newmediadenver.com/
|
217
207
|
licenses:
|
218
208
|
- MIT
|
219
209
|
metadata: {}
|
@@ -236,9 +226,7 @@ rubyforge_project:
|
|
236
226
|
rubygems_version: 2.2.2
|
237
227
|
signing_key:
|
238
228
|
specification_version: 4
|
239
|
-
summary:
|
229
|
+
summary: Generates the README.md file for Chef cookbooks.
|
240
230
|
test_files:
|
241
|
-
- spec/
|
231
|
+
- spec/drud_spec.rb
|
242
232
|
- spec/spec_helper.rb
|
243
|
-
- spec/version_spec.rb
|
244
|
-
has_rdoc:
|
data/.travis.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 1.9.3
|
4
|
-
- 2.0.0
|
5
|
-
- 2.1.1
|
6
|
-
before_install: 'echo ''gem: --no-ri --no-rdoc'' > ~/.gemrc'
|
7
|
-
script: bundle exec rake test
|
8
|
-
branches:
|
9
|
-
only:
|
10
|
-
- master
|
11
|
-
notifications:
|
12
|
-
hipchat:
|
13
|
-
rooms:
|
14
|
-
secure: chCwvs4r/T0iZKrHtvr6eYsM4QNPWUo90lxg6U/pWvbPGr3dWTUsAfCCrUAErY6kdh+bsm+l4dyZa0FdWnBrgSGAmUlD1myXot0thIyDtrFbHNb6wX4jv+UWi70P55zqPY/wrvrtgV0GZTPIJvbnC2XUjOaCreLFePCQmFI0pbI=
|
15
|
-
env:
|
16
|
-
global:
|
17
|
-
secure: ox4PooiCwoyJanrirdmxMCRxp3q+k42N2sbGEdUR4FCVZKeXZynRg6Gd/7DA1CCg2gvQvrPyfs1sKaMAYPxwbv5O32k8bFXD4Ju5OTIqrOK/Rgu1MW/QDeUX7/Z10M3APjWMGDDl1JnEKC82C1rnRYunozjE0Zq6+Hzvbdei8Oc=
|
data/bin/drud
DELETED
data/lib/drud/cli.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'drud'
|
3
|
-
require 'thor'
|
4
|
-
|
5
|
-
module Drud
|
6
|
-
# The CLI module serves as the command line client wrapper for Drud.
|
7
|
-
class CLI < Thor
|
8
|
-
# The current drud version.
|
9
|
-
VERSION = Drud::VERSION
|
10
|
-
|
11
|
-
desc 'version', 'The current version of this software.'
|
12
|
-
# Sends the current {Drud::VERSION drud version} to stdout.
|
13
|
-
def version
|
14
|
-
say(Drud::VERSION, :green)
|
15
|
-
end
|
16
|
-
# Provides error trapping for the command line client.
|
17
|
-
def self.rescue
|
18
|
-
shell = Thor::Base.shell.new
|
19
|
-
yield
|
20
|
-
rescue Thor::Error => e
|
21
|
-
shell.say(e.message, :red)
|
22
|
-
exit 1
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/spec/rescue_spec.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'drud'
|
4
|
-
|
5
|
-
describe Drud, 'rescue' do
|
6
|
-
it 'rescues Thor::Error and raises SystemExit' do
|
7
|
-
expect do
|
8
|
-
Drud::CLI.rescue do
|
9
|
-
fail Thor::Error.new(''), ''
|
10
|
-
end
|
11
|
-
end.to raise_error(SystemExit)
|
12
|
-
end
|
13
|
-
end
|
data/spec/version_spec.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'drud/cli'
|
4
|
-
|
5
|
-
describe Drud do
|
6
|
-
it 'Returns a semantic version number.' do
|
7
|
-
expect(Drud::VERSION).to match(/^\d+\.\d+\.\d+$/)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
describe Drud::CLI do
|
12
|
-
it 'Returns the same constant version as Drud.' do
|
13
|
-
expect(Drud::CLI::VERSION).to eq Drud::VERSION
|
14
|
-
end
|
15
|
-
|
16
|
-
describe '#version' do
|
17
|
-
before do
|
18
|
-
@content = capture(:stdout) { Drud::CLI.start(['version']) }
|
19
|
-
end
|
20
|
-
it 'Executing `drud version` returns the correct version.' do
|
21
|
-
expect(@content).to match(/^#{Drud::VERSION}/)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|