Module: Sapling
+ Class: Sapling
+
+ - Inherits:
+ -
+ Thor
+
+
+ - Object
+
+ - Thor
+
+ - Sapling
+
+
+ show all
+
+
+
+
@@ -86,8 +104,7 @@
Overview
-Sapling is the main module for the program. From here, the rest of the
-world starts building.
+The main Sapling interface.
@@ -95,31 +112,275 @@ world starts building.
Defined Under Namespace
-
+
+
+
+
+
+
+
+
+ Instance Method Summary
+ collapse
+
+
+
+
+ -
+
+ #edit(tree = '') ⇒ Object
+
+
+
+
-
- Classes: CLI
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ #export(tree) ⇒ Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ #read(tree) ⇒ Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ #serve(tree) ⇒ Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Instance Method Details
+
+
+
+
+
+ #edit(tree = '') ⇒ Object
+
+
+
+
+
+
+
+
+
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
+
+ # File 'lib/sapling.rb', line 19
+
+def edit(tree = '')
+ puts 'Welcome to Sapling, a Dialogue Tree Utility.'
+ if !tree.empty?
+ puts "Loading tree: #{tree}"
+ exit unless verify_tree(tree)
+ gardner = Planter::Spade.new(YAML.load_file(tree, false))
+ else
+ puts 'Creating a new tree!'
+ gardner = Planter::Spade.new(SKELETON_TREE)
+ end
+ gardner.plant
+end
+
+
+
+
+
+
+
+
+ #export(tree) ⇒ Object
+
+
+
+
+
+
+
+
+
+39
+40
+41
+42
+
+
+ # File 'lib/sapling.rb', line 39
+
+def export(tree)
+ exit unless verify_tree(tree)
+ puts 'Cool feature, bro!'
+end
+
+
+
+
+
+
+
+
+ #read(tree) ⇒ Object
+
+
+
+
+
+
+
+
+
+11
+12
+13
+14
+15
+16
+
+
+ # File 'lib/sapling.rb', line 11
+
+def read(tree)
+ exit unless verify_tree(tree)
+ puts 'Welcome to Sapling, a Dialogue Tree Utility.'
+ speaker = Dialogue::Speaker.new(YAML.load_file(tree), false)
+ speaker.conversation
+end
+
+
+
+
+
+
+
+
+ #serve(tree) ⇒ Object
+
+
+
+
+
+
+
+
+
+
+
+33
+34
+35
+36
+
+
+ # File 'lib/sapling.rb', line 33
+
+def serve(tree)
+ exit unless verify_tree(tree)
+ puts 'Sinatra will be cool.'
+end
+
+
+
+
+
+
diff --git a/doc/_index.html b/doc/_index.html
index 86da46c..ae95d40 100644
--- a/doc/_index.html
+++ b/doc/_index.html
@@ -93,21 +93,6 @@
-
- - C
-
-
- -
- CLI
-
- (Sapling)
-
-
-
-
-
-
-
- D
@@ -159,7 +144,7 @@
-
- Sapling
+ Sapling
@@ -189,9 +174,9 @@
diff --git a/doc/class_list.html b/doc/class_list.html
index 4edf910..728036b 100644
--- a/doc/class_list.html
+++ b/doc/class_list.html
@@ -43,7 +43,7 @@
-- DialogueTop Level Namespace
- Speaker < ObjectDialogue
- GardnerTop Level Namespace
- PlanterTop Level Namespace
- SaplingTop Level Namespace
- CLI < ObjectSapling
+- DialogueTop Level Namespace
- Speaker < ObjectDialogue
- GardnerTop Level Namespace
- PlanterTop Level Namespace
- Sapling < ThorTop Level Namespace
diff --git a/doc/file.CONTRIBUTING.html b/doc/file.CONTRIBUTING.html
index 9b7f6a2..0a3c9da 100644
--- a/doc/file.CONTRIBUTING.html
+++ b/doc/file.CONTRIBUTING.html
@@ -74,9 +74,9 @@ feel free to submit an issue or reach out to me directly.
diff --git a/doc/file.LICENSE.html b/doc/file.LICENSE.html
index 70625c3..0349eb2 100644
--- a/doc/file.LICENSE.html
+++ b/doc/file.LICENSE.html
@@ -82,9 +82,9 @@ DEALINGS IN THE SOFTWARE.
diff --git a/doc/file.README.html b/doc/file.README.html
index 1ab7dc9..253301c 100644
--- a/doc/file.README.html
+++ b/doc/file.README.html
@@ -59,6 +59,10 @@
Sapling: A Dialogue Tree CLI Utility
+
+
Sapling allows for easy creation and use of dialogue trees.
A dialogue tree is a series of dialogues which follow sequentially, though with
@@ -75,25 +79,25 @@ branch represents a choice taken in the dialogue. Branches flow to each other
through leafs, which are the actual choices.
You can experience this yourself, by loading "Example Quest! - A Meta Dialogue
-Tree!". You can find the tree itself at trees/example_quest.yaml. To run it, just type sapling -t
-trees/example_quest.yaml
.
+Tree!". You can find the tree itself at var/trees/example_quest.yaml.
+To run it, just type sapling read path/to/example_quest.yaml
.
Building a New Tree
To build a new tree, you have two options. You can manually edit a configuration
file, or go through the construction wizard. Either way, the end result is a
plain-text configuration file, which can be easily shared, edited, and viewed.
-For more details on the configuration file itself, check out the Configuration
-File documentation, or the self-documented
-configuration file example. Alternatively,
-you can checkout Example Quest for a complete
-tree.
+For more details on the configuration file itself, check out the Configuration
+File documentation, or the
+self-documented configuration file example.
+Alternatively, you can checkout Example Quest
+for a complete tree.
Manual Edit
- Open your preferred text editor.
-- Refer to the Configuration File documentation
+- Refer to the Configuration File documentation
- Make your changes.
- Save your changes.
@@ -101,16 +105,16 @@ tree.
Automatic Edit -- Coming Soon(tm)!
-- Run the configuration editor:
sapling --edit [--new][--file FILE]
-- If you choose to create a new dialogue,
sapling
will generate a new file in
-your current directory.
+- Run the configuration editor:
sapling edit [TREE]
+- If you don't include a TREE,
sapling
will create a new tree in the current
+directory.
- If you choose to modify an existing file,
sapling
will open the tree at the
trunk, and show you the first branch.
- Make your changes.
- Save your changes.
-More details on the editor can be found in the Editor
+More details on the editor can be found in the Editor
documentation.
Contributing
@@ -120,7 +124,7 @@ documentation.
- Fork this repository.
- In your fork, make your changes.
-- Make sure your changes respect the contribution
+
- Make sure your changes respect the contribution
guidelines.
- Submit a pull request.
@@ -128,13 +132,13 @@ guidelines.
License
Sapling is licensed under the MIT license. The full text can be found in
-LICENSE.
+LICENSE.
diff --git a/doc/file.config_file.html b/doc/file.config_file.html
index 03a9d92..725b618 100644
--- a/doc/file.config_file.html
+++ b/doc/file.config_file.html
@@ -126,9 +126,9 @@ branch", and the program will end after reaching it.
diff --git a/doc/file.config_file_example.html b/doc/file.config_file_example.html
index 9374e60..e72c020 100644
--- a/doc/file.config_file_example.html
+++ b/doc/file.config_file_example.html
@@ -100,9 +100,9 @@
diff --git a/doc/file.editor.html b/doc/file.editor.html
index f2263ab..ce01b15 100644
--- a/doc/file.editor.html
+++ b/doc/file.editor.html
@@ -72,9 +72,9 @@ allows for editing all parts of a tree, from the trunk to the leaves.
diff --git a/doc/index.html b/doc/index.html
index 5348f78..19a6d47 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -59,6 +59,10 @@
Sapling: A Dialogue Tree CLI Utility
+
+
Sapling allows for easy creation and use of dialogue trees.
A dialogue tree is a series of dialogues which follow sequentially, though with
@@ -75,25 +79,25 @@ branch represents a choice taken in the dialogue. Branches flow to each other
through leafs, which are the actual choices.
You can experience this yourself, by loading "Example Quest! - A Meta Dialogue
-Tree!". You can find the tree itself at trees/example_quest.yaml. To run it, just type sapling -t
-trees/example_quest.yaml
.
+Tree!". You can find the tree itself at var/trees/example_quest.yaml.
+To run it, just type sapling read path/to/example_quest.yaml
.
Building a New Tree
To build a new tree, you have two options. You can manually edit a configuration
file, or go through the construction wizard. Either way, the end result is a
plain-text configuration file, which can be easily shared, edited, and viewed.
-For more details on the configuration file itself, check out the Configuration
-File documentation, or the self-documented
-configuration file example. Alternatively,
-you can checkout Example Quest for a complete
-tree.
+For more details on the configuration file itself, check out the Configuration
+File documentation, or the
+self-documented configuration file example.
+Alternatively, you can checkout Example Quest
+for a complete tree.
Manual Edit
- Open your preferred text editor.
-- Refer to the Configuration File documentation
+- Refer to the Configuration File documentation
- Make your changes.
- Save your changes.
@@ -101,16 +105,16 @@ tree.
Automatic Edit -- Coming Soon(tm)!
-- Run the configuration editor:
sapling --edit [--new][--file FILE]
-- If you choose to create a new dialogue,
sapling
will generate a new file in
-your current directory.
+- Run the configuration editor:
sapling edit [TREE]
+- If you don't include a TREE,
sapling
will create a new tree in the current
+directory.
- If you choose to modify an existing file,
sapling
will open the tree at the
trunk, and show you the first branch.
- Make your changes.
- Save your changes.
-More details on the editor can be found in the Editor
+More details on the editor can be found in the Editor
documentation.
Contributing
@@ -120,7 +124,7 @@ documentation.
- Fork this repository.
- In your fork, make your changes.
-- Make sure your changes respect the contribution
+
- Make sure your changes respect the contribution
guidelines.
- Submit a pull request.
@@ -128,13 +132,13 @@ guidelines.
License
Sapling is licensed under the MIT license. The full text can be found in
-LICENSE.
+LICENSE.
diff --git a/doc/method_list.html b/doc/method_list.html
index a22cb7c..52443d6 100644
--- a/doc/method_list.html
+++ b/doc/method_list.html
@@ -78,24 +78,56 @@
-
- #edit_branch
- Planter::Spade
+ display_branch
+ Dialogue
-
- #edit_leaf
- Planter::Spade
+ display_trunk
+ Dialogue
-
- #edit_trunk
- Planter::Spade
+ #edit
+ Sapling
+
+
+
+
+ -
+
+ #edit_branch
+ Planter::Plot
+
+
+
+
+ -
+
+ #edit_leaf
+ Planter::Plot
+
+
+
+
+ -
+
+ #edit_trunk
+ Planter::Plot
+
+
+
+
+ -
+
+ #export
+ Sapling
@@ -110,8 +142,24 @@
-
- grow
- Gardner
+ #get_response
+ Planter::Spade
+
+
+
+
+ -
+
+ #get_response
+ Dialogue::Speaker
+
+
+
+
+ -
+
+ #initialize
+ Planter::Spade
@@ -126,7 +174,7 @@
-
- #plant
+ #parse_response
Planter::Spade
@@ -134,15 +182,15 @@
-
- prune_branches
- Gardner
+ #plant
+ Planter::Spade
-
- prune_leaves
+ prune_branches
Gardner
@@ -150,7 +198,7 @@
-
- prune_trunk
+ prune_leaves
Gardner
@@ -158,8 +206,24 @@
-
- #talk
- Sapling::CLI
+ prune_trunk
+ Gardner
+
+
+
+
+ -
+
+ #read
+ Sapling
+
+
+
+
+ -
+
+ #serve
+ Sapling
diff --git a/doc/top-level-namespace.html b/doc/top-level-namespace.html
index 3eae178..f6508e7 100644
--- a/doc/top-level-namespace.html
+++ b/doc/top-level-namespace.html
@@ -82,10 +82,12 @@
- Modules: Dialogue, Gardner, Planter, Sapling
+ Modules: Dialogue, Gardner, Planter
+ Classes: Sapling
+
@@ -301,8 +303,7 @@ can point to branch 0 to immediately exit."
55
56
57
-58
-59
+58
# File 'lib/sapling/utility.rb', line 43
@@ -322,7 +323,6 @@ can point to branch 0 to immediately exit."
end
results.include?(false) ? false : true
-
end
@@ -334,9 +334,9 @@ can point to branch 0 to immediately exit."
Class: Sapling
-
+
- Inherits: +
-
+ Thor
+
+
-
+
- Object + +
- Thor + +
- Sapling + +
+
Overview
Sapling is the main module for the program. From here, the rest of the -world starts building.
+The main Sapling interface.
Defined Under Namespace
-+
+ Instance Method Summary + collapse +
+ +-
+
+
- + + #edit(tree = '') ⇒ Object + + + + - - Classes: CLI - - + + + + + + + + + + + + +
- + + + #export(tree) ⇒ Object + + + + + + + + + + + + + + + + + + +
- + + + #read(tree) ⇒ Object + + + + + + + + + + + + + + + + + + +
- + + + #serve(tree) ⇒ Object + + + + + + + + + + + + + + + + + + +
Instance Method Details
+ + ++ + #edit(tree = '') ⇒ Object + + + + + +
+ +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30+ |
+
+ # File 'lib/sapling.rb', line 19 + +def edit(tree = '') + puts 'Welcome to Sapling, a Dialogue Tree Utility.' + if !tree.empty? + puts "Loading tree: #{tree}" + exit unless verify_tree(tree) + gardner = Planter::Spade.new(YAML.load_file(tree, false)) + else + puts 'Creating a new tree!' + gardner = Planter::Spade.new(SKELETON_TREE) + end + gardner.plant +end+ |
+
+ + #export(tree) ⇒ Object + + + + + +
+ +39 +40 +41 +42+ |
+
+ # File 'lib/sapling.rb', line 39 + +def export(tree) + exit unless verify_tree(tree) + puts 'Cool feature, bro!' +end+ |
+
+ + #read(tree) ⇒ Object + + + + + +
+ +11 +12 +13 +14 +15 +16+ |
+
+ # File 'lib/sapling.rb', line 11 + +def read(tree) + exit unless verify_tree(tree) + puts 'Welcome to Sapling, a Dialogue Tree Utility.' + speaker = Dialogue::Speaker.new(YAML.load_file(tree), false) + speaker.conversation +end+ |
+
+ + #serve(tree) ⇒ Object + + + + + +
+ + + +33 +34 +35 +36+ |
+
+ # File 'lib/sapling.rb', line 33 + +def serve(tree) + exit unless verify_tree(tree) + puts 'Sinatra will be cool.' +end+ |
+
-
-
- C -
- - CLI - - (Sapling) - - - -
-
-
-
- D
- - Sapling + Sapling @@ -189,9 +174,9 @@ diff --git a/doc/class_list.html b/doc/class_list.html index 4edf910..728036b 100644 --- a/doc/class_list.html +++ b/doc/class_list.html @@ -43,7 +43,7 @@
- -
- DialogueTop Level Namespace
- Speaker < ObjectDialogue
- GardnerTop Level Namespace
- PlanterTop Level Namespace
- SaplingTop Level Namespace
- CLI < ObjectSapling
+ - DialogueTop Level Namespace
- Speaker < ObjectDialogue
- GardnerTop Level Namespace
- PlanterTop Level Namespace
- Sapling < ThorTop Level Namespace
- Open your preferred text editor. -
- Refer to the Configuration File documentation +
- Refer to the Configuration File documentation
- Make your changes.
- Save your changes.
- Run the configuration editor:
sapling --edit [--new][--file FILE]
- - If you choose to create a new dialogue,
sapling
will generate a new file in -your current directory.
+ - Run the configuration editor:
sapling edit [TREE]
+ - If you don't include a TREE,
sapling
will create a new tree in the current +directory. - If you choose to modify an existing file,
sapling
will open the tree at the trunk, and show you the first branch. - Make your changes.
- Save your changes.
- Fork this repository.
- In your fork, make your changes. -
- Make sure your changes respect the contribution
+
- Make sure your changes respect the contribution guidelines.
- Submit a pull request.
- Open your preferred text editor. -
- Refer to the Configuration File documentation +
- Refer to the Configuration File documentation
- Make your changes.
- Save your changes.
- Run the configuration editor:
sapling --edit [--new][--file FILE]
- - If you choose to create a new dialogue,
sapling
will generate a new file in -your current directory.
+ - Run the configuration editor:
sapling edit [TREE]
+ - If you don't include a TREE,
sapling
will create a new tree in the current +directory. - If you choose to modify an existing file,
sapling
will open the tree at the trunk, and show you the first branch. - Make your changes.
- Save your changes.
- Fork this repository.
- In your fork, make your changes. -
- Make sure your changes respect the contribution
+
- Make sure your changes respect the contribution guidelines.
- Submit a pull request.
-
- #edit_branch - Planter::Spade + display_branch + Dialogue
-
- #edit_leaf - Planter::Spade + display_trunk + Dialogue
-
- #edit_trunk - Planter::Spade + #edit + Sapling ++
+
+
+
-
+ + #edit_branch + Planter::Plot ++
+
+
+
-
+ + #edit_leaf + Planter::Plot ++
+
+
+
-
+ + #edit_trunk + Planter::Plot ++
+
+
+
-
+ + #export + Sapling
@@ -110,8 +142,24 @@
-
- grow - Gardner + #get_response + Planter::Spade ++
+
+
+
-
+ + #get_response + Dialogue::Speaker ++
+
+
+
-
+ + #initialize + Planter::Spade
@@ -126,7 +174,7 @@
-
- #plant + #parse_response Planter::Spade
@@ -134,15 +182,15 @@
-
- prune_branches - Gardner + #plant + Planter::Spade
-
- prune_leaves + prune_branches Gardner
@@ -150,7 +198,7 @@
-
- prune_trunk + prune_leaves Gardner
@@ -158,8 +206,24 @@
-
- #talk - Sapling::CLI + prune_trunk + Gardner ++
+
+
+
-
+ + #read + Sapling ++
+
+
+
-
+ + #serve + Sapling
diff --git a/doc/top-level-namespace.html b/doc/top-level-namespace.html
index 3eae178..f6508e7 100644
--- a/doc/top-level-namespace.html
+++ b/doc/top-level-namespace.html
@@ -82,10 +82,12 @@
-
@@ -159,7 +144,7 @@
Sapling: A Dialogue Tree CLI Utility
+ +Sapling allows for easy creation and use of dialogue trees.
A dialogue tree is a series of dialogues which follow sequentially, though with @@ -75,25 +79,25 @@ branch represents a choice taken in the dialogue. Branches flow to each other through leafs, which are the actual choices.
You can experience this yourself, by loading "Example Quest! - A Meta Dialogue
-Tree!". You can find the tree itself at trees/example_quest.yaml. To run it, just type sapling -t
-trees/example_quest.yaml
.
sapling read path/to/example_quest.yaml
.
Building a New Tree
To build a new tree, you have two options. You can manually edit a configuration file, or go through the construction wizard. Either way, the end result is a plain-text configuration file, which can be easily shared, edited, and viewed. -For more details on the configuration file itself, check out the Configuration -File documentation, or the self-documented -configuration file example. Alternatively, -you can checkout Example Quest for a complete -tree.
+For more details on the configuration file itself, check out the Configuration +File documentation, or the +self-documented configuration file example. +Alternatively, you can checkout Example Quest +for a complete tree.Manual Edit
Automatic Edit -- Coming Soon(tm)!
-
-
More details on the editor can be found in the Editor
+ More details on the editor can be found in the Editor
documentation.Contributing
@@ -120,7 +124,7 @@ documentation.
License
Sapling is licensed under the MIT license. The full text can be found in -LICENSE.
+LICENSE.Sapling: A Dialogue Tree CLI Utility
+ +Sapling allows for easy creation and use of dialogue trees.
A dialogue tree is a series of dialogues which follow sequentially, though with @@ -75,25 +79,25 @@ branch represents a choice taken in the dialogue. Branches flow to each other through leafs, which are the actual choices.
You can experience this yourself, by loading "Example Quest! - A Meta Dialogue
-Tree!". You can find the tree itself at trees/example_quest.yaml. To run it, just type sapling -t
-trees/example_quest.yaml
.
sapling read path/to/example_quest.yaml
.
Building a New Tree
To build a new tree, you have two options. You can manually edit a configuration file, or go through the construction wizard. Either way, the end result is a plain-text configuration file, which can be easily shared, edited, and viewed. -For more details on the configuration file itself, check out the Configuration -File documentation, or the self-documented -configuration file example. Alternatively, -you can checkout Example Quest for a complete -tree.
+For more details on the configuration file itself, check out the Configuration +File documentation, or the +self-documented configuration file example. +Alternatively, you can checkout Example Quest +for a complete tree.Manual Edit
Automatic Edit -- Coming Soon(tm)!
-
-
More details on the editor can be found in the Editor
+ More details on the editor can be found in the Editor
documentation.Contributing
@@ -120,7 +124,7 @@ documentation.
License
Sapling is licensed under the MIT license. The full text can be found in -LICENSE.
+LICENSE.- Modules: Dialogue, Gardner, Planter, Sapling + Modules: Dialogue, Gardner, Planter + Classes: Sapling +
@@ -301,8 +303,7 @@ can point to branch 0 to immediately exit." 55 56 57 -58 -59 +58# File 'lib/sapling/utility.rb', line 43 @@ -322,7 +323,6 @@ can point to branch 0 to immediately exit." end results.include?(false) ? false : true - end