From e81a45ee0085597dad5067cada94b05cf11c6c0c Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Wed, 10 Apr 2013 14:35:42 -0700 Subject: (maint) Make stdlib usable as a Ruby GEM Without this patch it is inconvenient to use the functions included in stdlib in a development setting. The Puppet modulepath must be explicitly set for the functions to be automatically loaded. This patch addresses the problem by adding a gem specification and dependency Gemfile. This makes it possible to directly use stdlib and all of the components it depends upon, like so: $ bundle install --path .bundle/gems/ $ bundle exec puppet apply -e 'notice count([1, 2, 3])' The first command will install all of the dependencies, including Puppet and Facter, into the local project directory. The second command will make stdlib avaialable as a Gem, which will be picked up by Puppet since (#7788) was merged into Puppet in the 3.0 release. --- .gemspec | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .gemspec (limited to '.gemspec') diff --git a/.gemspec b/.gemspec new file mode 100644 index 0000000..805e170 --- /dev/null +++ b/.gemspec @@ -0,0 +1,31 @@ +# +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = "puppetmodule-stdlib" + + s.version = "3.2.0" + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.authors = ["Puppet Labs"] + s.date = "2013-04-10" + s.description = "Puppet Labs Standard Library module" + s.email = "support@puppetlabs.com" + s.executables = [] + s.files = [] + s.homepage = "https://github.com/puppetlabs/puppetlabs-stdlib" + s.rdoc_options = ["--title", "Puppet Standard Library Module", "--main", "README.markdown", "--line-numbers"] + s.require_paths = ["lib"] + s.rubyforge_project = "puppetmodule_stdlib" + s.rubygems_version = "1.8.24" + s.summary = "This module provides a standard library of resources for developing Puppet Modules." + + if s.respond_to? :specification_version then + s.specification_version = 3 + + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then + else + end + else + end +end -- cgit v1.2.3 From 475e29f69827c6e04c620955860617a30b523f4e Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Thu, 11 Apr 2013 14:14:02 -0700 Subject: Update gemspec for 4.0.0 --- .gemspec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to '.gemspec') diff --git a/.gemspec b/.gemspec index 805e170..3e7f774 100644 --- a/.gemspec +++ b/.gemspec @@ -4,7 +4,7 @@ Gem::Specification.new do |s| s.name = "puppetmodule-stdlib" - s.version = "3.2.0" + s.version = "4.0.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Puppet Labs"] @@ -12,11 +12,14 @@ Gem::Specification.new do |s| s.description = "Puppet Labs Standard Library module" s.email = "support@puppetlabs.com" s.executables = [] - s.files = [] + s.files = [ 'CHANGELOG', 'CONTRIBUTING.md', 'Gemfile', 'LICENSE', 'Modulefile', + 'README.markdown', 'README_DEVELOPER.markdown', 'RELEASE_PROCESS.markdown', + 'Rakefile', 'spec/spec.opts' ] + s.files += Dir['lib/**/*.rb'] + Dir['manifests/**/*.pp'] + Dir['tests/**/*.pp'] + Dir['spec/**/*.rb'] s.homepage = "https://github.com/puppetlabs/puppetlabs-stdlib" s.rdoc_options = ["--title", "Puppet Standard Library Module", "--main", "README.markdown", "--line-numbers"] s.require_paths = ["lib"] - s.rubyforge_project = "puppetmodule_stdlib" + s.rubyforge_project = "puppetmodule-stdlib" s.rubygems_version = "1.8.24" s.summary = "This module provides a standard library of resources for developing Puppet Modules." -- cgit v1.2.3 From 77b883cae18c03772f9827777444a8c999480b54 Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Thu, 11 Apr 2013 14:31:29 -0700 Subject: Update gemspec, CHANGELOG, Modulefile for 4.0.1 --- .gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.gemspec') diff --git a/.gemspec b/.gemspec index 3e7f774..294e685 100644 --- a/.gemspec +++ b/.gemspec @@ -4,7 +4,7 @@ Gem::Specification.new do |s| s.name = "puppetmodule-stdlib" - s.version = "4.0.0" + s.version = "4.0.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Puppet Labs"] -- cgit v1.2.3 From 5e0b90ed65b82cb3a88888b33262dec4fa32d975 Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Fri, 12 Apr 2013 09:23:34 -0700 Subject: Update gemspec, Modulefile, CHANGELOG for 4.0.2 Without this patch the information displayed on rubygems.org does not clearly convey the intent of the Gem format of stdlib from the official puppet module format of stdlib. This is a problem because end users might get confused and start installing stdlib from rubygems.org This patch addresses the problem by making it clear that the gem version of stdlib is not intended for end users, but rather is specifically intended to make it easier for other module authors to depend on stdlib and have that dependency automatically resolved using a Gemfile. [ci skip] --- .gemspec | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to '.gemspec') diff --git a/.gemspec b/.gemspec index 294e685..e274950 100644 --- a/.gemspec +++ b/.gemspec @@ -4,24 +4,30 @@ Gem::Specification.new do |s| s.name = "puppetmodule-stdlib" - s.version = "4.0.1" + s.version = "4.0.2" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Puppet Labs"] - s.date = "2013-04-10" - s.description = "Puppet Labs Standard Library module" - s.email = "support@puppetlabs.com" + s.date = "2013-04-12" + s.description = [ 'This Gem format of the stdlib module is intended to make', + 'it easier for _module authors_ to resolve dependencies', + 'using a Gemfile when running automated testing jobs like', + 'Travis or Jenkins. The recommended best practice for', + 'installation by end users is to use the `puppet module', + 'install` command to install stdlib from the [Puppet', + 'Forge](http://forge.puppetlabs.com/puppetlabs/stdlib).' ].join(' ') + s.email = "puppet-dev@puppetlabs.com" s.executables = [] s.files = [ 'CHANGELOG', 'CONTRIBUTING.md', 'Gemfile', 'LICENSE', 'Modulefile', 'README.markdown', 'README_DEVELOPER.markdown', 'RELEASE_PROCESS.markdown', 'Rakefile', 'spec/spec.opts' ] s.files += Dir['lib/**/*.rb'] + Dir['manifests/**/*.pp'] + Dir['tests/**/*.pp'] + Dir['spec/**/*.rb'] - s.homepage = "https://github.com/puppetlabs/puppetlabs-stdlib" - s.rdoc_options = ["--title", "Puppet Standard Library Module", "--main", "README.markdown", "--line-numbers"] + s.homepage = "http://forge.puppetlabs.com/puppetlabs/stdlib" + s.rdoc_options = ["--title", "Puppet Standard Library Development Gem", "--main", "README.markdown", "--line-numbers"] s.require_paths = ["lib"] s.rubyforge_project = "puppetmodule-stdlib" s.rubygems_version = "1.8.24" - s.summary = "This module provides a standard library of resources for developing Puppet Modules." + s.summary = "This gem provides a way to make the standard library available for other module spec testing tasks." if s.respond_to? :specification_version then s.specification_version = 3 -- cgit v1.2.3