Re-org...again... for gemspec

This commit is contained in:
Bill Niblock 2017-10-14 22:33:21 -04:00
parent 9575160f29
commit 4e2432ac66
5 changed files with 4 additions and 4 deletions

View file

@ -3,7 +3,7 @@
require 'thor' require 'thor'
require 'yaml' require 'yaml'
Dir[File.join(__dir__, 'lib', '*.rb')].each { |file| require file } Dir[File.join(__dir__, '..', 'lib', '*.rb')].each { |file| require file }
# The main Sapling interface. # The main Sapling interface.
class Sapling < Thor class Sapling < Thor
@ -20,7 +20,7 @@ class Sapling < Thor
puts 'Welcome to Sapling, a Dialogue Tree Utility.' puts 'Welcome to Sapling, a Dialogue Tree Utility.'
if !tree.empty? if !tree.empty?
puts "Loading tree: #{tree}" puts "Loading tree: #{tree}"
exit if verify_tree(tree) exit unless verify_tree(tree)
gardner = Planter::Spade.new(YAML.load_file(tree, false)) gardner = Planter::Spade.new(YAML.load_file(tree, false))
else else
puts 'Creating a new tree!' puts 'Creating a new tree!'
@ -31,13 +31,13 @@ class Sapling < Thor
desc 'serve TREE', 'Load TREE in a web-based interface' desc 'serve TREE', 'Load TREE in a web-based interface'
def serve(tree) def serve(tree)
exit if verify_tree(tree) exit unless verify_tree(tree)
puts 'Sinatra will be cool.' puts 'Sinatra will be cool.'
end end
desc 'export TREE', 'Save a portable HTML version of TREE' desc 'export TREE', 'Save a portable HTML version of TREE'
def export(tree) def export(tree)
exit if verify_tree(tree) exit unless verify_tree(tree)
puts 'Cool feature, bro!' puts 'Cool feature, bro!'
end end
end end