asker-tool 2.1.3 → 2.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -17
  3. data/lib/asker.rb +40 -83
  4. data/lib/asker/application.rb +1 -1
  5. data/lib/asker/checker.rb +42 -25
  6. data/lib/asker/cli.rb +1 -1
  7. data/lib/asker/data/world.rb +2 -0
  8. data/lib/asker/{exporter/code_screen_exporter.rb → displayer/code_displayer.rb} +6 -6
  9. data/lib/asker/{exporter/concept_ai_screen_exporter.rb → displayer/concept_ai_displayer.rb} +27 -29
  10. data/lib/asker/displayer/concept_displayer.rb +27 -0
  11. data/lib/asker/displayer/stats_displayer.rb +13 -0
  12. data/lib/asker/exporter/code_gift_exporter.rb +10 -11
  13. data/lib/asker/exporter/concept_ai_gift_exporter.rb +9 -9
  14. data/lib/asker/exporter/concept_ai_yaml_exporter.rb +2 -4
  15. data/lib/asker/exporter/concept_doc_exporter.rb +9 -15
  16. data/lib/asker/exporter/output_file_exporter.rb +18 -0
  17. data/lib/asker/files/example-concept.haml +25 -8
  18. data/lib/asker/formatter/concept_string_formatter.rb +9 -8
  19. data/lib/asker/lang/lang.rb +3 -4
  20. data/lib/asker/lang/locales/du/templates.yaml +50 -0
  21. data/lib/asker/lang/locales/en/connectors.yaml +44 -0
  22. data/lib/asker/lang/locales/en/mistakes.yaml +37 -0
  23. data/lib/asker/lang/locales/en/templates.yaml +29 -0
  24. data/lib/asker/lang/locales/es/connectors.yaml +92 -0
  25. data/lib/asker/lang/locales/es/mistakes.yaml +82 -0
  26. data/lib/asker/lang/locales/es/templates.yaml +29 -0
  27. data/lib/asker/lang/locales/fr/connectors.yaml +92 -0
  28. data/lib/asker/lang/locales/fr/mistakes.yaml +82 -0
  29. data/lib/asker/lang/locales/fr/templates.yaml +29 -0
  30. data/lib/asker/lang/locales/javascript/connectors.yaml +11 -0
  31. data/lib/asker/lang/locales/javascript/mistakes.yaml +30 -0
  32. data/lib/asker/lang/locales/javascript/templates.yaml +3 -0
  33. data/lib/asker/lang/locales/math/connectors.yaml +2 -0
  34. data/lib/asker/lang/locales/math/mistakes.yaml +2 -0
  35. data/lib/asker/lang/locales/math/templates.yaml +1 -0
  36. data/lib/asker/lang/locales/python/connectors.yaml +11 -0
  37. data/lib/asker/lang/locales/python/mistakes.yaml +26 -0
  38. data/lib/asker/lang/locales/python/templates.yaml +3 -0
  39. data/lib/asker/lang/locales/ruby/connectors.yaml +11 -0
  40. data/lib/asker/lang/locales/ruby/mistakes.yaml +33 -0
  41. data/lib/asker/lang/locales/ruby/templates.yaml +3 -0
  42. data/lib/asker/lang/locales/sql/connectors.yaml +6 -0
  43. data/lib/asker/lang/locales/sql/mistakes.yaml +11 -0
  44. data/lib/asker/lang/locales/sql/templates.yaml +2 -0
  45. data/lib/asker/loader/input_loader.rb +22 -5
  46. data/lib/asker/loader/project_loader.rb +25 -24
  47. data/lib/asker/logger.rb +1 -2
  48. data/lib/asker/project.rb +5 -3
  49. data/lib/asker/skeleton.rb +25 -24
  50. metadata +47 -63
  51. data/docs/changelog/v2.1.md +0 -99
  52. data/docs/commands.md +0 -12
  53. data/docs/contributions.md +0 -18
  54. data/docs/history.md +0 -40
  55. data/docs/idea.md +0 -44
  56. data/docs/inputs/README.md +0 -39
  57. data/docs/inputs/code.md +0 -69
  58. data/docs/inputs/concepts.md +0 -142
  59. data/docs/inputs/jedi.md +0 -68
  60. data/docs/inputs/tables.md +0 -112
  61. data/docs/inputs/templates.md +0 -87
  62. data/docs/install/README.md +0 -38
  63. data/docs/install/manual.md +0 -26
  64. data/docs/install/scripts.md +0 -38
  65. data/docs/revise/asker-file.md +0 -41
  66. data/docs/revise/buenas-practicas/01-convocatoria.md +0 -30
  67. data/docs/revise/buenas-practicas/02-formulario.md +0 -35
  68. data/docs/revise/buenas-practicas/03-descripcion.md +0 -63
  69. data/docs/revise/buenas-practicas/04-resultados.md +0 -17
  70. data/docs/revise/buenas-practicas/05-reproducir.md +0 -10
  71. data/docs/revise/ejemplos/01/README.md +0 -27
  72. data/docs/revise/ejemplos/02/README.md +0 -31
  73. data/docs/revise/ejemplos/03/README.md +0 -31
  74. data/docs/revise/ejemplos/04/README.md +0 -37
  75. data/docs/revise/ejemplos/05/README.md +0 -25
  76. data/docs/revise/ejemplos/06/README.md +0 -43
  77. data/docs/revise/ejemplos/README.md +0 -11
  78. data/docs/revise/projects.md +0 -74
  79. data/lib/asker/exporter/concept_screen_exporter.rb +0 -25
  80. data/lib/asker/exporter/main.rb +0 -9
@@ -1,142 +0,0 @@
1
-
2
- [<< back](README.md)
3
-
4
- # Learn basics
5
-
6
- To know how to build our asker input files, we need to learn
7
- main keywords:
8
- * map
9
- * concept
10
- * names
11
- * tags
12
- * def
13
-
14
- Let's start!.
15
-
16
- ---
17
-
18
- # Text plain editor
19
-
20
- * Create a text file, called for example: `demo/furniture.haml`.
21
- * **map**: Once, at first line, we write keyword `map`. Example:
22
-
23
- ```ruby
24
- %map{ :lang => 'en', :context => 'furniture, home', :version => '1'}
25
- ```
26
-
27
- | Attribute | Description |
28
- | --------- | ---------------------------------------------- |
29
- | lang | Output texts will be created in English. Valid values: en, es |
30
- | context | Comma separated labels that define map content |
31
- | version | Input file format version. Valid value: 1 |
32
-
33
- This input file will contain concepts about furniture context.
34
- Use diferents input files to define diferents contexts.
35
-
36
- > Use separated contexts is good idea. Sometimes, diferents concept from diferents contexts has the same `names` value. For example:
37
- > * free as free of charge, costless.
38
- > * free as in freedom.
39
-
40
- * **concept, names, tags**: So we define our first concept:
41
-
42
- ```
43
- %concept
44
- %names chair
45
- %tags single, seat, leg, backrest
46
- ```
47
-
48
- | Param | Description |
49
- | ----- | ------------------------------- |
50
- | names | Comma separated concept's names |
51
- | tags | Comma separated tags that help to identify this concept |
52
-
53
- * **def**: Use def keyword to add concept meaning. The `def` content must uniquely identifies our concept. You can use `def` more than once.
54
-
55
- ```
56
- %concept
57
- %names chair
58
- %tags single, seat, leg, backrest
59
- %def Single seat with legs and backrest
60
- %def Furniture that is placed around the table to sit
61
- ```
62
-
63
- At this time, we may generate questions with:
64
-
65
- ```bash
66
- asker demo/furniture.haml
67
- ```
68
-
69
- ---
70
-
71
- # Formats
72
-
73
- HAML is a special format. It's necesary write exactly:
74
- * 0 spaces before map.
75
- * 2 spaces before concept.
76
- * 4 spaces before names, tags and def.
77
-
78
- It's posible write the same using XML format instead. Take a look:
79
-
80
- ```xml
81
- <map lang='en' context='furniture, home' version='1'>
82
- <concept>
83
- <names>chair</names>
84
- <tags>single, seat, leg, backrest</tags>
85
- <def>Single seat with legs and backrest</def>
86
- <def>Furniture that is placed around the table to sit</def>
87
- </concept>
88
- </map>
89
- ```
90
-
91
- Notice that `demo/furniture.haml` is HAML file and `demo/furniture.xml` a XML file. Both are valid.
92
-
93
- > HAML format files are the same as XML format files.
94
- Internaly HAML files are translated automaticaly to an XML equivalent.
95
- >
96
- > Why write into HAML instead of XML? HAML It's easier (for me).
97
- You don't have to close every tag, only be carefuly with indentation.
98
- >
99
- > If you prefer, you could write your input files using XML.
100
-
101
- ---
102
-
103
- # Adding images
104
-
105
- Example:
106
- ![](https://www.portobellostreet.es/imagenes_muebles/Muebles-Silla-colonial-Fusta-Bora-Bora.jpg)
107
-
108
- **def** can be used with image URL. So we have to find an image that uniquely identifies our concept and write this:
109
-
110
- ```
111
- %def{:type => 'image_url'}https://www.portobellostreet.es/imagenes_muebles/Muebles-Silla-colonial-Fusta-Bora-Bora.jpg
112
- ```
113
-
114
- | Attribute | Description |
115
- | --------- | ------------ |
116
- | type | Content type |
117
-
118
- ---
119
-
120
- # Increase questions number
121
-
122
- Adding more concepts will increase questions number generated by ASKER:
123
-
124
- ```
125
- %concept
126
- %names couch
127
- %tags furniture, seat, two, threee, people, bench, armrest
128
-
129
- %concept
130
- %names table
131
- %tags furniture, flat, top, leg, surface, work, eat
132
-
133
- %concept
134
- %names bed
135
- %tags furniture, place, sleep, relax
136
- ```
137
-
138
- Examples:
139
- * [furniture.haml](../examples/home/furniture.haml)
140
- * [furniture.xml](../examples/home/xml/furniture.xml)
141
-
142
- [>> Learn about tables](tables.md)
data/docs/inputs/jedi.md DELETED
@@ -1,68 +0,0 @@
1
-
2
- # Jedi
3
-
4
- Inputs
5
- ======
6
-
7
- Into *maps* directory we save our own concept map files. We could use subdirectories to
8
- better organization. As example we have the file `maps/demo/starwars/jedi.haml`, that
9
- contains one concept map about Jedi characters of StarWars film into HAML format.
10
-
11
- Let's take a look (Spanish example, I know. Soon I'll write the english version):
12
- ```
13
- %map{ :lang => 'en', :context => 'character, starwars', :version => '1'}
14
-
15
- %concept
16
- %names obiwan
17
- %tags jedi, teacher, annakin, skywalker, pupil, quigon-jinn
18
- %def Jedi, teacher of Annakin Skywalker
19
- %def Jedi, pupil of Quigon-Jinn
20
- %table{ :fields => 'attribute, value' }
21
- %title Associate every attribute with their value
22
- %row
23
- %col race
24
- %col human
25
- %row
26
- %col laser sabel color
27
- %col green
28
- %row
29
- %col hair color
30
- %col red
31
-
32
- %concept
33
- %names yoda
34
- %tags teacher, jedi
35
- %def Jedi, teacher of all jedis
36
- %def The Main Teacher of Jedi and one of the most important members of the Main Jedi Council, in the last days of Star Republic.
37
- %def He has exceptional combat abilities with light sable, using acrobatics tecnics from Ataru.
38
- %def He was master of all light sable combat styles and was considered during years as a Sword Master.
39
- %table{ :fields => 'attribute, value' }
40
- %row
41
- %col color laser sabel
42
- %col green
43
- %row
44
- %col hair color
45
- %col white
46
- %row
47
- %col skin color
48
- %col green
49
- %row
50
- %col high
51
- %col 65 centimetres
52
- ...
53
- ```
54
- As we see, we defined 2 concepts about Jedi characters. This are `obiwan` and `yoda`.
55
- And we use special sintax (tags) to define it.
56
-
57
- At now we have a this list of tags to define our own sintax for build conceptual maps:
58
- * **context**: List of comma separated words, that identify the context where this concept "lives" or "exists".
59
- * **names**: List of one or more names that identify the concept. At least one is requiered, of course!.
60
- * **tags**: List of comma separated words, that briefly describe the concept. I mean, a short list of words
61
- that came in mind when we think in it, and are useful for their identification.
62
- * **def**: We use this tags as many times we need. In it, we write using natural language descriptions
63
- asssociated to the concept. This are definitions/descriptions that are uniques
64
- for this concept, but don't write the name of the concept into the text.
65
- * **table**: Other way to build more sofisticated definitions/schemas is using "tables". It's similar
66
- to HTML tag. I mean, with this "table", we build tables of knowledge into the concept. We use "row",
67
- and "col", to defines table-rows and row-cols, of course. We could see an
68
- example into `input/en/starwars/jedi.haml`.
@@ -1,112 +0,0 @@
1
-
2
- [<< back](README.md)
3
-
4
- # Learn tables
5
-
6
- Now, we are going to learn keywords:
7
- * table
8
- * row
9
- * col
10
-
11
- Let's go!.
12
-
13
- ---
14
-
15
- # Def limits
16
-
17
- We have learn that:
18
- * **map** serves to identify an input file.
19
- * **concept**, **names** and **tags** serves to identify a concept.
20
- * **def** serves to add meaning to a concept.
21
-
22
- But, it's not enough. **def** only contains meaning that could only be associated to one unique concept. For example:
23
- ```
24
- %concept
25
- %names AC/DC, ACDC
26
- %tags rock, band, australia
27
- %def Australian rock band formed by Scottish-born brothers Malcolm and Angus Young
28
- ```
29
-
30
- **def** is good but we need other keyword to add meaning that isn't uniquely associated to one concept. That is **table** keyword.
31
-
32
- ---
33
- # Tables
34
-
35
- ## Table with 1 field
36
-
37
- Example, adding meaning using 1 field table. Field called `members`:
38
-
39
- ```
40
- %concept
41
- %names AC/DC, ACDC
42
- %tags single, seat, leg, backrest
43
- %tags rock, band, australia
44
- %table{ :fields => 'members'}
45
- %row Bon Scott
46
- %row Angus Young
47
- %row Malcolm Young
48
- %row Phil Rudd
49
- %row Cliff Williams
50
- ```
51
-
52
- | Param | Description |
53
- | ------ | ----------- |
54
- | table | Group rows |
55
- | fields | Comma separated values with field name |
56
- | row | Field value |
57
-
58
- ## Table with 2 fields
59
-
60
- Example, adding meaning using 2 fields table. Fields called `attribute` and `value`:
61
-
62
- ```
63
- %concept
64
- %names AC/DC, ACDC
65
- %tags single, seat, leg, backrest
66
- %tags rock, band, australia
67
- %table{ :fields => 'attribute, value'}
68
- %row
69
- %col Genres
70
- %col Hard rock blues rock rock and roll
71
- %row
72
- %col Years active
73
- %col 1973–present
74
- %row
75
- %col Origin
76
- %col Sydney
77
- ```
78
-
79
- | Param | Description |
80
- | ------ | ------------------ |
81
- | table | Group rows |
82
- | fields | Comma separated values with field names |
83
- | row | Group cols |
84
- | col | Field column value |
85
-
86
- ## Table with Sequence
87
-
88
- Sometimes we have a 1 field table where rows are sorted or form a sequence. In that cases we also could take advantage defining a `sequence`, like:
89
-
90
- ```
91
- %concept
92
- %names AC/DC, ACDC
93
- %tags single, seat, leg, backrest
94
- %tags rock, band, australia
95
- %table{ :fields => 'Albums', :sequence => 'Albums sorted by date'}
96
- %row Albums High Voltage
97
- %row Powerage
98
- %row Highway to Hell
99
- %row Back in Black
100
- %row Ballbreaker
101
- %row Rock or Bust
102
- ```
103
-
104
- | Param | Description |
105
- | -------- | ------------------ |
106
- | table | Group rows |
107
- | fields | Field name |
108
- | sequence | Label form ordered values |
109
- | row | Field value |
110
-
111
- Example:
112
- * [acdc.haml](../examples/bands/acdc.haml)
@@ -1,87 +0,0 @@
1
-
2
- [<< back](README.md)
3
-
4
- # Learn templates
5
-
6
- Now, we are going to learn `template` keyword.
7
-
8
- ---
9
-
10
- # Powerfull tables
11
-
12
- Table is usefull keyword to add information associated to concepts using table struct (That means with rows and columns scheme).
13
-
14
- ## Example 01: repetitive rows
15
-
16
- Let's see this repetitive row example about OS commands:
17
-
18
- ```
19
- %concept
20
- %names command
21
- %tags computing,directive,computer,perform,specific,task
22
- %def In computing, is a directive to a computer program to perform a specific task.
23
- %table{:action, :description}
24
- %row
25
- %col mkdir Endor
26
- %col Create Endor directory
27
- %row
28
- %col mkdir Naboo
29
- %col Create Naboo directory
30
- %row
31
- %col mkdir Dagobah
32
- %col Create Dagobah directory
33
- ```
34
-
35
- ## Example 02: Using template
36
-
37
- To be more productive, we could use `template` keyword.
38
-
39
- ```
40
- %concept
41
- %names command
42
- %tags computing,directive,computer,perform,specific,task
43
- %def In computing, is a directive to a computer program to perform a specific task.
44
- %table{:action, :description}
45
- %template{:DIRNAME => 'Endor,Naboo,Dabobah'}
46
- %row
47
- %col mkdir DIRNAME
48
- %col Create DIRNAME directory
49
- ```
50
-
51
- We see example 01 produce the same result, but with less input lines.
52
- Template will be apply to every definition inside.
53
-
54
- | Param | Description |
55
- | -------- | ----------- |
56
- | template | Begin template definition |
57
- | DIRNAME | Token o variable that will be replaced with value list |
58
- | Endor,Naboo,Dagobah |Comma separated value list |
59
-
60
- ## Example 03: Going crazy
61
-
62
- ```
63
- %concept
64
- %names command
65
- %tags computing,directive,computer,perform,specific,task
66
- %def In computing, is a directive to a computer program to perform a specific task.
67
- %table{:action, :description}
68
- %template{:NAME => 'Endor,Naboo,Dabobah'}
69
- %row
70
- %col mkdir NAME
71
- %col Create NAME directory
72
- %row
73
- %col rmdir NAME
74
- %col Delete NAME directory
75
- %row
76
- %col touch NAME
77
- %col Create NAME file
78
- %row
79
- %col rm NAME
80
- %col Delete NAME file
81
- %row
82
- %col useradd NAME
83
- %col Create user NAME
84
- %row
85
- %col userdel NAME
86
- %col Delete user NAME
87
- ```
@@ -1,38 +0,0 @@
1
-
2
- [<< back](../../README.md)
3
-
4
- # Installation
5
-
6
- * **Install** Asker:
7
- 1. Install Ruby on your system.
8
- 2. `gem install asker-tool`
9
-
10
- Run `asker version` to check that your installation is ok.
11
-
12
- > **FIND asker COMMAND**: If you have problems to find `asker`command (OpenSUSE distro), try this:
13
- > * `find / -name asker`, to find absolute path to teuton command.
14
- > * As superuser do `ln -s /PATH/TO/bin/asker /usr/local/bin/asker`, to create symbolic link to asker command.
15
-
16
- * **Update** Asker with `gem asker-tool update`.
17
- * **Uninstall** Asker with `gem uninstall asker-tool`
18
-
19
- > Others ways to install Asker:
20
- > * [Installation scripts](scripts.md)
21
- >* [Manual installation](manual.md)
22
-
23
- ---
24
- # Configuring Asker
25
-
26
- There exist `config.ini`file, into Asker base directory with some configurable options.
27
-
28
- | Section | Param | Default | Values | Description |
29
- | ----------- | -------- | ------- | --------- | ----------- |
30
- | [global] | internet | no | yes or no | Accept to connect Google and download find images URLs |
31
- | [questions] | exclude | | Comma separated strings| Exclude questions with this texts into their names |
32
-
33
- ---
34
- # Download input examples
35
-
36
- If you want to download our repository with asker input files:
37
-
38
- `git clone https://github.com/dvarrui/asker-inputs.git`