diff --git a/.gitignore b/.gitignore index 3e7b421..f348116 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /dist/ /doc/ /pkg/ +/test/ diff --git a/Gemfile b/Gemfile index e518563..de6a56d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,8 @@ source 'https://rubygems.org' -# Specify your gem's dependencies in rscons.gemspec -gemspec +gem "json" +gem "rspec" +gem "rake" +gem "simplecov" +gem "yard" +gem "rdoc" diff --git a/Gemfile.lock b/Gemfile.lock index ecc8401..07467ef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,3 @@ -PATH - remote: . - specs: - rscons (1.16.0) - json (>= 1.8, < 3.0) - GEM remote: https://rubygems.org/ specs: @@ -37,9 +31,9 @@ PLATFORMS x86-mingw32 DEPENDENCIES + json rake rdoc - rscons! rspec simplecov yard diff --git a/README.md b/README.md index 2179505..3262f0e 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # Rscons Rscons (https://github.com/holtrop/rscons) is a software construction framework -inspired by SCons and implemented in Ruby. - -[![Gem Version](https://badge.fury.io/rb/rscons.png)](http://badge.fury.io/rb/rscons) +inspired by SCons and waf but implemented in Ruby. ## Installation - $ gem install rscons +Rscons is distributed as a standalone Ruby script named ``rscons``. This file +(containing the complete rscons build system) can be checked into your project +and versioned along with your project. ## Usage diff --git a/Rakefile.rb b/Rakefile.rb index 517313c..393d796 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -5,25 +5,29 @@ rescue Bundler::BundlerError => e raise LoadError.new("Unable to setup Bundler; you might need to `bundle install`: #{e.message}") end -require "bundler/gem_tasks" require "rspec/core/rake_task" require "yard" require "rake/clean" +require "fileutils" -CLEAN.include %w[build_test_run .yardoc doc coverage] -CLOBBER.include %w[pkg] +CLEAN.include %w[build_test_run .yardoc doc coverage test] +CLOBBER.include %w[dist pkg] task :build_dist do sh "ruby build_dist.rb" end RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args| + FileUtils.mkdir_p("test") + FileUtils.cp("dist/rscons", "test/rscons.rb") if args.example_string ENV["partial_specs"] = "1" task.rspec_opts = %W[-e "#{args.example_string}" -f documentation] end end +task :spec => :build_dist + YARD::Rake::YardocTask.new do |yard| yard.files = ['lib/**/*.rb'] end diff --git a/bin/rscons b/bin/rscons index 3808f47..d915827 100755 --- a/bin/rscons +++ b/bin/rscons @@ -2,4 +2,6 @@ require "rscons/cli" -Rscons::Cli.run(ARGV) +if __FILE__ == $0 + Rscons::Cli.run(ARGV) +end diff --git a/lib/rscons/version.rb b/lib/rscons/version.rb index 2cf2307..1a85526 100644 --- a/lib/rscons/version.rb +++ b/lib/rscons/version.rb @@ -1,4 +1,4 @@ module Rscons - # gem version + # Project version. VERSION = "1.16.0" end diff --git a/rscons.gemspec b/rscons.gemspec deleted file mode 100644 index c150c65..0000000 --- a/rscons.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- encoding: utf-8 -*- -lib = File.expand_path("../lib", __FILE__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require "rscons/version" - -Gem::Specification.new do |gem| - gem.name = "rscons" - gem.version = Rscons::VERSION - gem.authors = ["Josh Holtrop"] - gem.email = ["jholtrop@gmail.com"] - gem.description = %q{Software construction library inspired by SCons and implemented in Ruby.} - gem.summary = %q{Software construction library inspired by SCons and implemented in Ruby} - gem.homepage = "https://github.com/holtrop/rscons" - gem.license = "MIT" - - gem.files = Dir["{bin,assets,lib}/**/*", "*.gemspec", "LICENSE.txt"] - gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } - gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) - gem.require_paths = ["lib"] - - gem.add_dependency "json", ">= 1.8", "< 3.0" - - gem.add_development_dependency "rspec" - gem.add_development_dependency "rake" - gem.add_development_dependency "simplecov" - gem.add_development_dependency "yard" - gem.add_development_dependency "rdoc" -end diff --git a/spec/build_tests_spec.rb b/spec/build_tests_spec.rb index f2f6489..4cd7ae4 100644 --- a/spec/build_tests_spec.rb +++ b/spec/build_tests_spec.rb @@ -62,7 +62,7 @@ describe Rscons do [] end rscons_args = options[:rscons_args] || [] - command = %W[ruby -I. -r _simplecov_setup #{@owd}/bin/rscons] + rsconsfile_args + rscons_args + command = %W[ruby -I. -r _simplecov_setup #{@owd}/test/rscons.rb] + rsconsfile_args + rscons_args @statics[:build_test_id] ||= 0 @statics[:build_test_id] += 1 command_prefix = @@ -74,6 +74,8 @@ describe Rscons do command_name = "#{command_prefix}#{@statics[:build_test_id]}" File.open("_simplecov_setup.rb", "w") do |fh| fh.puts <