From 4e2432ac662cdb1b893f277b04323702b4c1b821 Mon Sep 17 00:00:00 2001 From: Bill Niblock Date: Sat, 14 Oct 2017 22:33:21 -0400 Subject: [PATCH] Re-org...again... for gemspec --- {bin => lib}/sapling.rb | 8 ++++---- lib/{ => sapling}/dialogue.rb | 0 lib/{ => sapling}/gardner.rb | 0 lib/{ => sapling}/planter.rb | 0 lib/{ => sapling}/utility.rb | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename {bin => lib}/sapling.rb (84%) rename lib/{ => sapling}/dialogue.rb (100%) rename lib/{ => sapling}/gardner.rb (100%) rename lib/{ => sapling}/planter.rb (100%) rename lib/{ => sapling}/utility.rb (100%) diff --git a/bin/sapling.rb b/lib/sapling.rb similarity index 84% rename from bin/sapling.rb rename to lib/sapling.rb index bcbc006..31cbdb5 100644 --- a/bin/sapling.rb +++ b/lib/sapling.rb @@ -3,7 +3,7 @@ require 'thor' 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. class Sapling < Thor @@ -20,7 +20,7 @@ class Sapling < Thor puts 'Welcome to Sapling, a Dialogue Tree Utility.' if !tree.empty? puts "Loading tree: #{tree}" - exit if verify_tree(tree) + exit unless verify_tree(tree) gardner = Planter::Spade.new(YAML.load_file(tree, false)) else puts 'Creating a new tree!' @@ -31,13 +31,13 @@ class Sapling < Thor desc 'serve TREE', 'Load TREE in a web-based interface' def serve(tree) - exit if verify_tree(tree) + exit unless verify_tree(tree) puts 'Sinatra will be cool.' end desc 'export TREE', 'Save a portable HTML version of TREE' def export(tree) - exit if verify_tree(tree) + exit unless verify_tree(tree) puts 'Cool feature, bro!' end end diff --git a/lib/dialogue.rb b/lib/sapling/dialogue.rb similarity index 100% rename from lib/dialogue.rb rename to lib/sapling/dialogue.rb diff --git a/lib/gardner.rb b/lib/sapling/gardner.rb similarity index 100% rename from lib/gardner.rb rename to lib/sapling/gardner.rb diff --git a/lib/planter.rb b/lib/sapling/planter.rb similarity index 100% rename from lib/planter.rb rename to lib/sapling/planter.rb diff --git a/lib/utility.rb b/lib/sapling/utility.rb similarity index 100% rename from lib/utility.rb rename to lib/sapling/utility.rb