<commit_before>
Requirements
============
Ruby
Rails



Installation
============
download the zip file, unzip it, cd into the cyber_dojo directory. Then
  $ script/server -d
  $ open http://localhost:3000
And your cyber-dojo should be running.



Setting up a new exercise
=========================
Make a folder for the name of the exercise. For example if the exercise is called
unsplice and is a c exercise then create a folder called unsplice in a folder called
c in the exercises folder. Then place the files required for the exercise in this folder as 
follows. First, the folder must contain a file called exercise_manifest.rb
This file contains an inspected ruby object defining the exercise parameters (it is
loaded and eval'd in the ruby code). For example:

{
  :visible_files =>
  {
    'unsplice.tests.c' => {},
    'unsplice.c' => {},
    'unsplice.h' => {},
    'notes.txt' => {},
    'run_tests_output' => {},
    'instructions' => { :preloaded => true },
  },

  :hidden_files =>
  {
    'makefile' => {},
    'tequila.h' => {},
    'tequila.c' => {},
    'kata.sh' => { :permissions => 0755 },
  },

  :language => 'c',

  :unit_test_framework => 'tequila',

  :max_run_tests_duration => 10,
}



Explanation of these parameters
-------------------------------
1:visible_files
  These are the names of the files that are visible in the tabbed editor in the browser.
  Each file can have associated information if necessary.
  Any visible file with :preloaded => true will be pre-loaded into the tabbed editor
  when the browser page first opens.

2:hidden_files
  These are the names of necessary and supporting files that are NOT visible in the tabbed editor
  in the browser. Again, each file can have associated information. In the example
  above the file called kata.sh has a permission of 755 (executable) because it is a shell file.
  Some ruby app code checks if a filename has an associated :permission and if so chmod's the file.
  
3:language
  This defines the name of the programming language the exercise uses. 

4:unit_test_framework
  This defines the name of the unit test framework used in the exercise. 

5:max_run_tests_duration
  This is the maximum number of seconds the dojo-server allows an increment to run in
  (the time starts after all the increments files have been copied to the sandbox folder).



Some Notes
----------
1. The filename kata.sh must be present (visible or hidden) as that is the name 
   of the shell file assumed by the ruby app code in the dojo server to be the start point 
   for running an increment.

2. The filename run_tests_output must also be present as a visible file as this is the
   name of the tab for showing the run-tests> output.

3. The output of executing the kata.sh file must also be saved to the file
   called run_tests_output (in the exercise folder). This is because when a player first 
   starts the exercise kata.sh is NOT run.

4. As well as containing the file exercise_manifest.rb the exercise folder must also contain
   all the files named in both the hidden_files section and the visible_files section.<commit_msg>added tab size and font size info in readme.txt<commit_after>
Requirements
============
Ruby
Rails



Installation
============
download the zip file, unzip it, cd into the cyber_dojo directory. Then
  $ script/server -d
  $ open http://localhost:3000
And your cyber-dojo should be running.



Setting up a new exercise
=========================
Make a folder for the name of the exercise. For example if the exercise is called
unsplice and is a c exercise then create a folder called unsplice in a folder called
c in the exercises folder. Then place the files required for the exercise in this folder as 
follows. First, the folder must contain a file called exercise_manifest.rb
This file contains an inspected ruby object defining the exercise parameters (it is
loaded and eval'd in the ruby code). For example:

{
  :visible_files =>
  {
    'unsplice.tests.c' => {},
    'unsplice.c' => {},
    'unsplice.h' => {},
    'notes.txt' => {},
    'run_tests_output' => {},
    'instructions' => { :preloaded => true },
  },

  :hidden_files =>
  {
    'makefile' => {},
    'tequila.h' => {},
    'tequila.c' => {},
    'kata.sh' => { :permissions => 0755 },
  },

  :language => 'c',

  :unit_test_framework => 'tequila',

  :max_run_tests_duration => 10,

  :font_size => 14,

  :tab_size => 8,
}



Explanation of these parameters
-------------------------------
1:visible_files
  These are the names of the files that are visible in the tabbed editor in the browser.
  Each file can have associated information if necessary.
  Any visible file with :preloaded => true will be pre-loaded into the tabbed editor
  when the browser page first opens.

2:hidden_files
  These are the names of necessary and supporting files that are NOT visible in the tabbed editor
  in the browser. Again, each file can have associated information. In the example
  above the file called kata.sh has a permission of 755 (executable) because it is a shell file.
  Some ruby app code checks if a filename has an associated :permission and if so chmod's the file.
  
3:language
  This defines the name of the programming language the exercise uses. 

4:unit_test_framework
  This defines the name of the unit test framework used in the exercise. 

5:max_run_tests_duration
  This is the maximum number of seconds the dojo-server allows an increment to run in
  (the time starts after all the increments files have been copied to the sandbox folder).

6:font_size
  This can be set to values not listed in the editArea font-size drop-down list.
  Optional. The default is 14.

7:tab_size
  Optional. The default is 4.


Some Notes
----------
1. The filename kata.sh must be present (visible or hidden) as that is the name 
   of the shell file assumed by the ruby app code in the dojo server to be the start point 
   for running an increment.

2. The filename run_tests_output must also be present as a visible file as this is the
   name of the tab for showing the run-tests> output.

3. The output of executing the kata.sh file must also be saved to the file
   called run_tests_output (in the exercise folder). This is because when a player first 
   starts the exercise kata.sh is NOT run.

4. As well as containing the file exercise_manifest.rb the exercise folder must also contain
   all the files named in both the hidden_files section and the visible_files section.
{'fraction_non_alphanumeric': 0.0884080370942813, 'fraction_numerical': 0.0080370942812983, 'mean_word_length': 3.426128590971272, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4277257', 'n_tokens_mistral': 1832, 'n_tokens_neox': 1740, 'n_words': 905}