diff options
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | Rakefile | 92 | ||||
-rw-r--r-- | VERSION.yml | 4 | ||||
-rw-r--r-- | features/mixlib_cli.feature | 9 | ||||
-rw-r--r-- | features/step_definitions/mixlib_cli_steps.rb | 0 | ||||
-rw-r--r-- | features/support/env.rb | 9 | ||||
-rw-r--r-- | mixlib-cli.gemspec | 44 | ||||
-rwxr-xr-x | script/destroy | 14 | ||||
-rwxr-xr-x | script/generate | 14 | ||||
-rw-r--r-- | spec/mixlib/cli_spec.rb | 2 |
10 files changed, 115 insertions, 78 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..00c0b86 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.sw? +.DS_Store +coverage +rdoc +pkg @@ -1,60 +1,54 @@ require 'rubygems' -require 'rake/gempackagetask' -require 'rubygems/specification' -require 'date' +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 +rescue LoadError + puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" +end + require 'spec/rake/spectask' -require 'cucumber/rake/task' - -GEM = "mixlib-cli" -GEM_VERSION = "1.0.0" -AUTHOR = "Opscode, Inc." -EMAIL = "info@opscode.com" -HOMEPAGE = "http://www.opscode.com" -SUMMARY = "A simple mixin for CLI interfaces, including option parsing" - -spec = Gem::Specification.new do |s| - s.name = GEM - s.version = GEM_VERSION - s.platform = Gem::Platform::RUBY - s.has_rdoc = true - s.extra_rdoc_files = ["README.rdoc", "LICENSE", "NOTIFY" ] - s.summary = SUMMARY - s.description = s.summary - s.author = AUTHOR - s.email = EMAIL - s.homepage = HOMEPAGE - - # Uncomment this to add a dependency - # s.add_dependency "foo" - - s.require_path = 'lib' - s.autorequire = GEM - s.files = %w(LICENSE README.rdoc Rakefile NOTIFY) + Dir.glob("{lib,spec}/**/*") +Spec::Rake::SpecTask.new(:spec) do |spec| + spec.libs << 'lib' << 'spec' + spec.spec_files = FileList['spec/**/*_spec.rb'] end -task :default => :test +Spec::Rake::SpecTask.new(:rcov) do |spec| + spec.libs << 'lib' << 'spec' + spec.pattern = 'spec/**/*_spec.rb' + spec.rcov = true +end -desc "Run specs" -Spec::Rake::SpecTask.new do |t| - t.spec_files = FileList['spec/**/*_spec.rb'] - t.spec_opts = %w(-fs --color) +begin + require 'cucumber/rake/task' + Cucumber::Rake::Task.new(:features) +rescue LoadError + task :features do + abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber" + end end -desc "Run the spec" -task :test => [ :spec ] +task :default => :spec -Rake::GemPackageTask.new(spec) do |pkg| - pkg.gem_spec = spec -end +require 'rake/rdoctask' +Rake::RDocTask.new do |rdoc| + if File.exist?('VERSION.yml') + config = YAML.load(File.read('VERSION.yml')) + version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}" + else + version = "" + end -desc "install the gem locally" -task :install => [:package] do - sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}} + rdoc.rdoc_dir = 'rdoc' + rdoc.title = "mixlib-cli #{version}" + rdoc.rdoc_files.include('README*') + rdoc.rdoc_files.include('lib/**/*.rb') end -desc "create a gemspec file" -task :make_spec do - File.open("#{GEM}.gemspec", "w") do |file| - file.puts spec.to_ruby - end -end
\ No newline at end of file diff --git a/VERSION.yml b/VERSION.yml new file mode 100644 index 0000000..726d87c --- /dev/null +++ b/VERSION.yml @@ -0,0 +1,4 @@ +--- +:major: 1 +:minor: 0 +:patch: 2 diff --git a/features/mixlib_cli.feature b/features/mixlib_cli.feature new file mode 100644 index 0000000..b908b60 --- /dev/null +++ b/features/mixlib_cli.feature @@ -0,0 +1,9 @@ +Feature: something something + In order to something something + A user something something + something something something + + Scenario: something something + Given inspiration + When I create a sweet new gem + Then everyone should see how awesome I am diff --git a/features/step_definitions/mixlib_cli_steps.rb b/features/step_definitions/mixlib_cli_steps.rb new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/features/step_definitions/mixlib_cli_steps.rb diff --git a/features/support/env.rb b/features/support/env.rb new file mode 100644 index 0000000..e62e6ea --- /dev/null +++ b/features/support/env.rb @@ -0,0 +1,9 @@ +$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib') +require 'mixlib_cli' + +require 'spec/expectations' + +World do |world| + + world +end diff --git a/mixlib-cli.gemspec b/mixlib-cli.gemspec new file mode 100644 index 0000000..84bb764 --- /dev/null +++ b/mixlib-cli.gemspec @@ -0,0 +1,44 @@ +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = %q{mixlib-cli} + s.version = "1.0.2" + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.authors = ["Opscode, Inc."] + s.date = %q{2009-05-12} + s.email = %q{info@opscode.com} + s.extra_rdoc_files = [ + "LICENSE", + "README.rdoc" + ] + s.files = [ + "LICENSE", + "README.rdoc", + "Rakefile", + "VERSION.yml", + "lib/mixlib/cli.rb", + "spec/mixlib/cli_spec.rb", + "spec/spec_helper.rb" + ] + s.has_rdoc = true + s.homepage = %q{http://www.opscode.com} + s.rdoc_options = ["--charset=UTF-8"] + s.require_paths = ["lib"] + s.rubygems_version = %q{1.3.2} + s.summary = %q{A simple mixin for CLI interfaces, including option parsing} + s.test_files = [ + "spec/mixlib/cli_spec.rb", + "spec/spec_helper.rb" + ] + + if s.respond_to? :specification_version then + current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION + s.specification_version = 3 + + if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then + else + end + else + end +end diff --git a/script/destroy b/script/destroy deleted file mode 100755 index 40901a8..0000000 --- a/script/destroy +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby -APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) - -begin - require 'rubigen' -rescue LoadError - require 'rubygems' - require 'rubigen' -end -require 'rubigen/scripts/destroy' - -ARGV.shift if ['--help', '-h'].include?(ARGV[0]) -RubiGen::Base.use_component_sources! [:newgem_simple, :test_unit] -RubiGen::Scripts::Destroy.new.run(ARGV) diff --git a/script/generate b/script/generate deleted file mode 100755 index 5c8ed01..0000000 --- a/script/generate +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby -APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) - -begin - require 'rubigen' -rescue LoadError - require 'rubygems' - require 'rubigen' -end -require 'rubigen/scripts/generate' - -ARGV.shift if ['--help', '-h'].include?(ARGV[0]) -RubiGen::Base.use_component_sources! [:newgem_simple, :test_unit] -RubiGen::Scripts::Generate.new.run(ARGV) diff --git a/spec/mixlib/cli_spec.rb b/spec/mixlib/cli_spec.rb index 45bf340..a5fec6c 100644 --- a/spec/mixlib/cli_spec.rb +++ b/spec/mixlib/cli_spec.rb @@ -194,4 +194,4 @@ end # :on => :tail, # :boolean => true, # :show_options => true, -# :exit => 0
\ No newline at end of file +# :exit => 0 |