Rscons is no longer a gem.

Run specs against the combined distributable standalone script.
This commit is contained in:
Josh Holtrop 2018-09-03 19:32:53 -04:00
parent bcd33fe098
commit 95ee63292e
10 changed files with 27 additions and 49 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
/dist/ /dist/
/doc/ /doc/
/pkg/ /pkg/
/test/

View File

@ -1,4 +1,8 @@
source 'https://rubygems.org' source 'https://rubygems.org'
# Specify your gem's dependencies in rscons.gemspec gem "json"
gemspec gem "rspec"
gem "rake"
gem "simplecov"
gem "yard"
gem "rdoc"

View File

@ -1,9 +1,3 @@
PATH
remote: .
specs:
rscons (1.16.0)
json (>= 1.8, < 3.0)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
@ -37,9 +31,9 @@ PLATFORMS
x86-mingw32 x86-mingw32
DEPENDENCIES DEPENDENCIES
json
rake rake
rdoc rdoc
rscons!
rspec rspec
simplecov simplecov
yard yard

View File

@ -1,13 +1,13 @@
# Rscons # Rscons
Rscons (https://github.com/holtrop/rscons) is a software construction framework Rscons (https://github.com/holtrop/rscons) is a software construction framework
inspired by SCons and implemented in Ruby. inspired by SCons and waf but implemented in Ruby.
[![Gem Version](https://badge.fury.io/rb/rscons.png)](http://badge.fury.io/rb/rscons)
## Installation ## 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 ## Usage

View File

@ -5,25 +5,29 @@ rescue Bundler::BundlerError => e
raise LoadError.new("Unable to setup Bundler; you might need to `bundle install`: #{e.message}") raise LoadError.new("Unable to setup Bundler; you might need to `bundle install`: #{e.message}")
end end
require "bundler/gem_tasks"
require "rspec/core/rake_task" require "rspec/core/rake_task"
require "yard" require "yard"
require "rake/clean" require "rake/clean"
require "fileutils"
CLEAN.include %w[build_test_run .yardoc doc coverage] CLEAN.include %w[build_test_run .yardoc doc coverage test]
CLOBBER.include %w[pkg] CLOBBER.include %w[dist pkg]
task :build_dist do task :build_dist do
sh "ruby build_dist.rb" sh "ruby build_dist.rb"
end end
RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args| 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 if args.example_string
ENV["partial_specs"] = "1" ENV["partial_specs"] = "1"
task.rspec_opts = %W[-e "#{args.example_string}" -f documentation] task.rspec_opts = %W[-e "#{args.example_string}" -f documentation]
end end
end end
task :spec => :build_dist
YARD::Rake::YardocTask.new do |yard| YARD::Rake::YardocTask.new do |yard|
yard.files = ['lib/**/*.rb'] yard.files = ['lib/**/*.rb']
end end

View File

@ -2,4 +2,6 @@
require "rscons/cli" require "rscons/cli"
Rscons::Cli.run(ARGV) if __FILE__ == $0
Rscons::Cli.run(ARGV)
end

View File

@ -1,4 +1,4 @@
module Rscons module Rscons
# gem version # Project version.
VERSION = "1.16.0" VERSION = "1.16.0"
end end

View File

@ -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

View File

@ -62,7 +62,7 @@ describe Rscons do
[] []
end end
rscons_args = options[:rscons_args] || [] 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] ||= 0
@statics[:build_test_id] += 1 @statics[:build_test_id] += 1
command_prefix = command_prefix =
@ -74,6 +74,8 @@ describe Rscons do
command_name = "#{command_prefix}#{@statics[:build_test_id]}" command_name = "#{command_prefix}#{@statics[:build_test_id]}"
File.open("_simplecov_setup.rb", "w") do |fh| File.open("_simplecov_setup.rb", "w") do |fh|
fh.puts <<EOF fh.puts <<EOF
require "bundler"
Bundler.setup
require "simplecov" require "simplecov"
class MyFormatter class MyFormatter
def format(*args) def format(*args)
@ -88,7 +90,6 @@ SimpleCov.start do
end end
formatter(MyFormatter) formatter(MyFormatter)
end end
$LOAD_PATH.unshift(#{@owd.inspect} + "/lib")
# force color off # force color off
ENV["TERM"] = nil ENV["TERM"] = nil
#{options[:ruby_setup_code]} #{options[:ruby_setup_code]}

View File

@ -12,4 +12,4 @@ SimpleCov.start do
merge_timeout 3600 merge_timeout 3600
end end
require "rscons" require_relative "../test/rscons"