diff options
author | John Keiser <jkeiser@opscode.com> | 2011-09-08 12:28:01 -0700 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2011-09-08 12:28:01 -0700 |
commit | 3318b8d2fa71d500b742f53bc760fd861549b72d (patch) | |
tree | f5f0adef1f3dde96c6f78a10930527bde5ae3d80 | |
parent | 8818f334a7c9b7ee42d76396e536f727b34ae86a (diff) | |
download | mixlib-cli-3318b8d2fa71d500b742f53bc760fd861549b72d.tar.gz |
Remove Jeweler dependency; bump version to 1.2.1
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README.rdoc | 5 | ||||
-rw-r--r-- | Rakefile | 62 | ||||
-rw-r--r-- | VERSION.yml | 4 | ||||
-rw-r--r-- | lib/mixlib/cli/version.rb | 6 | ||||
-rw-r--r-- | mixlib-cli.gemspec | 21 |
6 files changed, 61 insertions, 38 deletions
@@ -1,6 +1,5 @@ *.sw? .DS_Store -mixlib-cli.gemspec coverage rdoc pkg diff --git a/README.rdoc b/README.rdoc index 50ddd73..d16ba91 100644 --- a/README.rdoc +++ b/README.rdoc @@ -72,6 +72,11 @@ Available arguments to 'option': :exit:: Exit your program with the exit code when this option is specified. Example: 0 :proc:: If set, the configuration value will be set to the return value of this proc. +=== New in 1.2.2 + +:required works, and we now support Ruby-style boolean option negation +(e.g. '--no-cookie' will set 'cookie' to false if the option is boolean) + === New in 1.2.0 We no longer destructively manipulate ARGV. @@ -1,45 +1,41 @@ require 'rubygems' -require 'rake' - -begin - require 'jeweler' - Jeweler::Tasks.new do |gem| - gem.name = "mixlib-cli" - gem.summary = "A simple mixin for CLI interfaces, including option parsing" - gem.email = "info@opscode.com" - gem.homepage = "http://www.opscode.com" - gem.authors = ["Opscode, Inc."] - end - Jeweler::GemcutterTasks.new -rescue LoadError - puts "Jeweler (or a dependency) not available. Install from gemcutter with: sudo gem install gemcutter jeweler" +require 'rake/gempackagetask' +require 'rspec/core/rake_task' +require 'rdoc/task' + +task :default => :spec + +desc "Run specs" +RSpec::Core::RakeTask.new(:spec) do |spec| + spec.pattern = 'spec/**/*_spec.rb' end -begin - require 'rspec/core/rake_task' - RSpec::Core::RakeTask.new(:spec) do |spec| - spec.pattern = 'spec/**/*_spec.rb' - end -rescue LoadError - task :spec do - abort "RSpec 2.0+ is not available. (sudo) gem install rspec." - end +gem_spec = eval(File.read("mixlib-cli.gemspec")) + +Rake::GemPackageTask.new(gem_spec) do |pkg| + pkg.gem_spec = gem_spec end -task :default => :spec +desc "install the gem locally" +task :install => [:package] do + sh %{gem install pkg/#{gem_spec.name}-#{gem_spec.version}} +end -require 'rdoc/task' -RDoc::Task.new do |rdoc| - if File.exist?('VERSION.yml') - require 'yaml' - config = YAML.load(File.read('VERSION.yml')) - version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}" - else - version = "" +desc "create a gemspec file" +task :make_spec do + File.open("#{gem_spec.name}.gemspec", "w") do |file| + file.puts spec.to_ruby end +end + +desc "remove build files" +task :clean do + sh %Q{ rm -f pkg/*.gem } +end +RDoc::Task.new do |rdoc| rdoc.rdoc_dir = 'rdoc' - rdoc.title = "mixlib-cli #{version}" + rdoc.title = "mixlib-cli #{gem_spec.version}" rdoc.rdoc_files.include('README*') rdoc.rdoc_files.include('lib/**/*.rb') end diff --git a/VERSION.yml b/VERSION.yml deleted file mode 100644 index a6c777a..0000000 --- a/VERSION.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -:major: 1 -:minor: 2 -:patch: 0 diff --git a/lib/mixlib/cli/version.rb b/lib/mixlib/cli/version.rb new file mode 100644 index 0000000..d16abd1 --- /dev/null +++ b/lib/mixlib/cli/version.rb @@ -0,0 +1,6 @@ +module Mixlib + module CLI + VERSION = "1.2.2" + end +end + diff --git a/mixlib-cli.gemspec b/mixlib-cli.gemspec new file mode 100644 index 0000000..f83218e --- /dev/null +++ b/mixlib-cli.gemspec @@ -0,0 +1,21 @@ +require 'mixlib/cli/version' + +Gem::Specification.new do |s| + s.name = "mixlib-cli" + s.version = Mixlib::CLI::VERSION + s.platform = Gem::Platform::RUBY + s.has_rdoc = true + s.extra_rdoc_files = ["README.rdoc", "LICENSE", 'NOTICE'] + s.summary = "A simple mixin for CLI interfaces, including option parsing" + s.description = s.summary + s.author = "Opscode, Inc." + s.email = "info@opscode.com" + s.homepage = "http://www.opscode.com" + + # Uncomment this to add a dependency + #s.add_dependency "mixlib-log" + + s.require_path = 'lib' + s.files = %w(LICENSE README.rdoc Rakefile NOTICE) + Dir.glob("{lib,spec}/**/*") +end + |