(PDOC-28) Adding syntax higlighting. Refactoring the gemspec a bit.

This commit is contained in:
David Danzilio 2015-09-02 16:09:01 -04:00
parent aac19e67b7
commit 0dc8d95ce4
3 changed files with 15 additions and 14 deletions

View File

@ -2,7 +2,6 @@ source 'https://rubygems.org'
gemspec gemspec
gem 'yard'
gem 'rgen' gem 'rgen'
gem 'redcarpet' gem 'redcarpet'

View File

@ -124,7 +124,7 @@ style guide.
### Functions ### Functions
Here's an example of how you might document a 4x function: Here's an example of how you might document a 4x function:
``` ```ruby
# When given two numbers, returns the one that is larger. # When given two numbers, returns the one that is larger.
# You could have a several line description here if you wanted, # You could have a several line description here if you wanted,
# but I don't have much to say about this function. # but I don't have much to say about this function.
@ -147,7 +147,7 @@ Here's an example of how you might document a 4x function:
Here's an example of how you might document a class: Here's an example of how you might document a class:
``` ```puppet
# This class is meant to serve as an example of how one might # This class is meant to serve as an example of how one might
# want to document a manifest in a way that is compatible. # want to document a manifest in a way that is compatible.
# with the strings module # with the strings module
@ -209,11 +209,15 @@ Rake Tasks
This module is also available as a Gem and makes two rake tasks (`generate` and `serve`) available in `puppet-strings/rake_tasks`. To add this to your module's CI workflow, be sure to add this module to your `Gemfile`: This module is also available as a Gem and makes two rake tasks (`generate` and `serve`) available in `puppet-strings/rake_tasks`. To add this to your module's CI workflow, be sure to add this module to your `Gemfile`:
gem 'puppet-strings', :git => 'https://github.com/puppetlabs/puppet-strings.git' ```ruby
gem 'puppetlabs-strings', :git => 'https://github.com/puppetlabs/puppet-strings.git'
```
To use the rake tasks, `require puppet-strings/rake_tasks` in your `Rakefile`: To use the rake tasks, `require puppet-strings/rake_tasks` in your `Rakefile`:
```ruby
require 'puppet-strings/rake_tasks' require 'puppet-strings/rake_tasks'
```
Developing and Contributing Developing and Contributing
----- -----

View File

@ -3,16 +3,14 @@ require 'json'
puppet_metadata = JSON.load File.open(File.expand_path(File.join(__FILE__, '..', 'metadata.json'))).read puppet_metadata = JSON.load File.open(File.expand_path(File.join(__FILE__, '..', 'metadata.json'))).read
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = 'puppet-strings' %w(name author version license summary).each do |section|
s.author = puppet_metadata['author'] s.send("#{section}=", puppet_metadata[section])
s.version = puppet_metadata['version'] end
s.license = puppet_metadata['license']
s.summary = puppet_metadata['summary']
s.homepage = puppet_metadata['project_page']
s.description = s.summary s.homepage = puppet_metadata['project_page']
s.files = Dir['lib/**/*'].reject { |f| f if File.directory?(f) } s.description = s.summary
s.files = Dir['lib/**/*'].reject { |f| f if File.directory?(f) }
s.add_runtime_dependency 'puppet', '>= 3.7.0' s.add_runtime_dependency 'puppet', '>= 3.7.0'
s.add_runtime_dependency 'yard' s.add_runtime_dependency 'yard', '~> 0.8'
end end