From 8044eb5921b61ef43ecb7ecf7e4a3eec6d78541b Mon Sep 17 00:00:00 2001 From: ellemenno Date: Sun, 28 Aug 2016 14:35:14 -0400 Subject: [PATCH 1/3] update version to 2.0.1 --- lib/tasks/support.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/support.rb b/lib/tasks/support.rb index 1e5c082..f48689d 100644 --- a/lib/tasks/support.rb +++ b/lib/tasks/support.rb @@ -4,7 +4,7 @@ module LoomTasks - VERSION = '2.0.0' + VERSION = '2.0.1' EXIT_OK = 0 From 7ec9d6cf3b0d5e24950864612092db8c1c29a6f7 Mon Sep 17 00:00:00 2001 From: ellemenno Date: Sun, 28 Aug 2016 14:37:27 -0400 Subject: [PATCH 2/3] add optional name argument to new:loom lib task --- lib/tasks/scaffolding.rake | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/tasks/scaffolding.rake b/lib/tasks/scaffolding.rake index 2bccecf..e953c98 100644 --- a/lib/tasks/scaffolding.rake +++ b/lib/tasks/scaffolding.rake @@ -3,6 +3,9 @@ require 'fileutils' require 'json' require 'pathname' +require File.join(File.dirname(__FILE__), 'support') +include LoomTasks + def global_config_file File.join(Dir.home, '.loom', 'loom.config') @@ -13,7 +16,7 @@ def default_loom_sdk end def lib_name() - Pathname.new(Dir.pwd).basename.to_s + @lib_name || fail("no lib name defined") end def template_dir @@ -121,12 +124,12 @@ task :default => :usage task :usage do |t, args| this_file = File.basename(__FILE__) puts '' - puts "#{this_file}: a utility to create a new loomlib directory structure" + puts "#{this_file} v#{VERSION}: a utility to create a new loomlib directory structure" puts '' puts 'typically this is run from another directory, to bootstrap a new loomlib project there:' puts '' puts '$ cd MyLoomlib' - puts "$ rake -f #{File.join(Dir.home, '.loom', 'tasks', this_file)} new:loomlib" + puts "$ rake -f #{File.join(Dir.home, '.loom', 'tasks', this_file)} new:loomlib[MyLoomlib]" puts '$ rake' end @@ -153,11 +156,21 @@ namespace :new do create_from_template(lib_testspec_pathname, lib_testspec_template, binding) end + task :scaffold => [:gitignore, :rakefile, :libdir, :testdir] + desc [ "scaffolds the directories and files for a new loomlib project", + "if no name argument is given, the current directory name is used", "creates a .gitignore file, rakefile, and template library and test code", "this code assumes (but does not enforce) being run in an empty directory", ].join("\n") - task :loomlib => [:gitignore, :rakefile, :libdir, :testdir] + task :loomlib, [:name] do |t, args| + args.with_defaults(:name => Pathname.new(Dir.pwd).basename.to_s) + @lib_name = args.name + + Rake::Task['new:scaffold'].invoke() + puts "project prepared to generate #{lib_name}.loomlib" + puts "run `rake` to see available tasks" + end end From bd062e7996aba0002e1f1a29664198b80a36ae3e Mon Sep 17 00:00:00 2001 From: ellemenno Date: Thu, 15 Sep 2016 00:25:58 -0400 Subject: [PATCH 3/3] broaden file list glob pattern for test app source files simplify and expand to all *.ls under test/src/ --- lib/tasks/loomlib.rake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/tasks/loomlib.rake b/lib/tasks/loomlib.rake index 531994f..5e9b518 100644 --- a/lib/tasks/loomlib.rake +++ b/lib/tasks/loomlib.rake @@ -171,11 +171,7 @@ file APP => LIBRARY do |t, args| puts '' end -FileList[File.join('test', 'src', 'app', '*.ls')].each do |src| - file APP => src -end - -FileList[File.join('test', 'src', 'spec', '*.ls')].each do |src| +FileList[File.join('test', 'src', '**', '*.ls')].each do |src| file APP => src end