Skip to content

Commit

Permalink
Remove Jeweler dependency; bump version to 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
John Keiser committed Sep 8, 2011
1 parent 8818f33 commit 3318b8d
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 38 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*.sw?
.DS_Store
mixlib-cli.gemspec
coverage
rdoc
pkg
5 changes: 5 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
62 changes: 29 additions & 33 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 0 additions & 4 deletions VERSION.yml

This file was deleted.

6 changes: 6 additions & 0 deletions lib/mixlib/cli/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Mixlib
module CLI
VERSION = "1.2.2"
end
end

21 changes: 21 additions & 0 deletions mixlib-cli.gemspec
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3318b8d

Please sign in to comment.