From 0dc8d95ce40a7e50297d66dd96d208e0bb41f737 Mon Sep 17 00:00:00 2001 From: David Danzilio Date: Wed, 2 Sep 2015 16:09:01 -0400 Subject: [PATCH] (PDOC-28) Adding syntax higlighting. Refactoring the gemspec a bit. --- Gemfile | 1 - README.md | 10 +++++++--- puppet-strings.gemspec | 18 ++++++++---------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index 2bf86c4..c98da00 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,6 @@ source 'https://rubygems.org' gemspec -gem 'yard' gem 'rgen' gem 'redcarpet' diff --git a/README.md b/README.md index 7de39a6..cf4b38e 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ style guide. ### Functions Here's an example of how you might document a 4x function: -``` +```ruby # When given two numbers, returns the one that is larger. # You could have a several line description here if you wanted, # 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: -``` +```puppet # This class is meant to serve as an example of how one might # want to document a manifest in a way that is compatible. # 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`: - 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`: +```ruby require 'puppet-strings/rake_tasks' +``` Developing and Contributing ----- diff --git a/puppet-strings.gemspec b/puppet-strings.gemspec index 6f88e84..fe78ed1 100644 --- a/puppet-strings.gemspec +++ b/puppet-strings.gemspec @@ -3,16 +3,14 @@ require 'json' puppet_metadata = JSON.load File.open(File.expand_path(File.join(__FILE__, '..', 'metadata.json'))).read Gem::Specification.new do |s| - s.name = 'puppet-strings' - s.author = puppet_metadata['author'] - s.version = puppet_metadata['version'] - s.license = puppet_metadata['license'] - s.summary = puppet_metadata['summary'] - s.homepage = puppet_metadata['project_page'] + %w(name author version license summary).each do |section| + s.send("#{section}=", puppet_metadata[section]) + end - s.description = s.summary - s.files = Dir['lib/**/*'].reject { |f| f if File.directory?(f) } + s.homepage = puppet_metadata['project_page'] + 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 'yard' + s.add_runtime_dependency 'puppet', '>= 3.7.0' + s.add_runtime_dependency 'yard', '~> 0.8' end