lib/teapot/command/create.rb in teapot-2.0.0.pre.rc3 vs lib/teapot/command/create.rb in teapot-2.0.0
- old
+ new
@@ -32,10 +32,13 @@
one :project_name, "The name of the new project in title-case, e.g. 'My Project'."
one :source, "The source repository to use for fetching packages, e.g. https://github.com/kurocha."
many :packages, "Any additional packages you'd like to include in the project."
def invoke(parent)
+ raise ArgumentError, "project_name is required" unless @project_name
+ raise ArgumentError, "source is required" unless @source
+
logger = parent.logger
nested = parent['--root', parent.options[:root] || project_name.gsub(/\s+/, '-').downcase]
root = nested.root
@@ -99,16 +102,21 @@
output.puts "end", ''
output.puts "\# Build Targets", ''
output.puts "\# Configurations", ''
-
- output.puts "define_configuration #{name.target.dump} do |configuration|"
- output.puts "\tconfiguration[:source] = #{source.dump}", ''
+
+ output.puts "define_configuration 'development' do |configuration|"
+ output.puts "\tconfiguration[:source] = #{source.dump}"
+ output.puts "\tconfiguration.import #{name.target.dump}"
packages.each do |name|
output.puts "\tconfiguration.require #{name.dump}"
end
output.puts "end", ''
+
+ output.puts "define_configuration #{name.target.dump} do |configuration|"
+ output.puts "\tconfiguration.public!"
+ output.puts "end"
end
end
end
end
end