Skip to content

Commit

Permalink
Merge pull request #6 from ellemenno/v2.0.1
Browse files Browse the repository at this point in the history
v2.0.1
  • Loading branch information
pixeldroid authored Sep 18, 2016
2 parents fc5f04a + bd062e7 commit b91e411
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
6 changes: 1 addition & 5 deletions lib/tasks/loomlib.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 17 additions & 4 deletions lib/tasks/scaffolding.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
2 changes: 1 addition & 1 deletion lib/tasks/support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module LoomTasks

VERSION = '2.0.0'
VERSION = '2.0.1'

EXIT_OK = 0

Expand Down

0 comments on commit b91e411

Please sign in to comment.