asker-tool 2.1.5 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/{LICENSE → LICENSE.txt} +0 -0
- data/README.md +2 -3
- data/bin/asker +1 -0
- data/lib/asker.rb +10 -6
- data/lib/asker/ai/ai.rb +4 -0
- data/lib/asker/ai/code/base_code_ai.rb +104 -0
- data/lib/asker/{code/ai → ai/code}/code_ai_factory.rb +11 -1
- data/lib/asker/{code/ai → ai/code}/javascript_code_ai.rb +2 -5
- data/lib/asker/ai/code/problem_code_ai.rb +176 -0
- data/lib/asker/{code/ai → ai/code}/python_code_ai.rb +2 -5
- data/lib/asker/{code/ai → ai/code}/ruby_code_ai.rb +14 -7
- data/lib/asker/{code/ai → ai/code}/sql_code_ai.rb +2 -5
- data/lib/asker/ai/concept_ai.rb +1 -0
- data/lib/asker/ai/stages/stage_t.rb +76 -76
- data/lib/asker/application.rb +18 -2
- data/lib/asker/checker.rb +112 -30
- data/lib/asker/cli.rb +12 -25
- data/lib/asker/data/code.rb +73 -0
- data/lib/asker/data/column.rb +31 -21
- data/lib/asker/data/concept.rb +42 -45
- data/lib/asker/data/data_field.rb +14 -0
- data/lib/asker/data/row.rb +75 -52
- data/lib/asker/data/table.rb +89 -42
- data/lib/asker/data/world.rb +57 -33
- data/lib/asker/displayer/concept_ai_displayer.rb +56 -37
- data/lib/asker/displayer/concept_displayer.rb +7 -5
- data/lib/asker/displayer/stats_displayer.rb +4 -3
- data/lib/asker/exporter/concept_ai_gift_exporter.rb +5 -3
- data/lib/asker/exporter/concept_ai_yaml_exporter.rb +7 -3
- data/lib/asker/exporter/output_file_exporter.rb +1 -1
- data/lib/asker/files/config.ini +37 -0
- data/lib/asker/files/example-concept.haml +0 -1
- data/lib/asker/{lang/locales → files/language}/du/templates.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/en/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/en/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/en/templates.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/es/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/es/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/es/templates.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/fr/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/fr/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/fr/templates.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/javascript/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/javascript/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/javascript/templates.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/math/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/math/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/math/templates.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/python/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/python/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/python/templates.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/ruby/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/ruby/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/ruby/templates.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/sql/connectors.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/sql/mistakes.yaml +0 -0
- data/lib/asker/{lang/locales → files/language}/sql/templates.yaml +0 -0
- data/lib/asker/lang/lang.rb +17 -10
- data/lib/asker/lang/lang_factory.rb +26 -5
- data/lib/asker/lang/text_actions.rb +87 -69
- data/lib/asker/loader/code_loader.rb +3 -3
- data/lib/asker/loader/content_loader.rb +9 -5
- data/lib/asker/loader/file_loader.rb +2 -11
- data/lib/asker/loader/haml_loader.rb +15 -0
- data/lib/asker/loader/image_url_loader.rb +5 -8
- data/lib/asker/loader/input_loader.rb +8 -9
- data/lib/asker/loader/project_loader.rb +10 -8
- data/lib/asker/logger.rb +3 -3
- data/lib/asker/project.rb +24 -50
- data/lib/asker/skeleton.rb +22 -13
- metadata +39 -37
- data/lib/asker/code/ai/base_code_ai.rb +0 -48
- data/lib/asker/code/code.rb +0 -53
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'rainbow'
|
4
4
|
require 'rexml/document'
|
5
5
|
require_relative '../logger'
|
6
|
-
require_relative '../
|
6
|
+
require_relative '../data/code'
|
7
7
|
|
8
8
|
# Read XML info about Code input data
|
9
9
|
module CodeLoader
|
@@ -24,7 +24,7 @@ module CodeLoader
|
|
24
24
|
# @param xmldata (XML Object)
|
25
25
|
# @param filename (String) File name that contains data
|
26
26
|
# @return Code object
|
27
|
-
def self.read_codedata_from_xml(xmldata, filename)
|
27
|
+
private_class_method def self.read_codedata_from_xml(xmldata, filename)
|
28
28
|
data = { path: '?', type: '?', features: [] }
|
29
29
|
xmldata.elements.each do |i|
|
30
30
|
data[:path] = i.text if i.name == 'path'
|
@@ -38,7 +38,7 @@ module CodeLoader
|
|
38
38
|
# Read features data from XML input
|
39
39
|
# @param xmldata (XML object)
|
40
40
|
# @return Array with features (Strings)
|
41
|
-
def self.read_features(xmldata, filename)
|
41
|
+
private_class_method def self.read_features(xmldata, filename)
|
42
42
|
features = []
|
43
43
|
xmldata.elements.each do |i|
|
44
44
|
if i.name == 'row'
|
@@ -41,7 +41,7 @@ module ContentLoader
|
|
41
41
|
##
|
42
42
|
# Read lang attr from input XML data
|
43
43
|
# @param xmldata (XML Object)
|
44
|
-
def self.read_lang_attribute(xmldata)
|
44
|
+
private_class_method def self.read_lang_attribute(xmldata)
|
45
45
|
begin
|
46
46
|
lang = xmldata.root.attributes['lang']
|
47
47
|
rescue StandardError
|
@@ -53,7 +53,7 @@ module ContentLoader
|
|
53
53
|
##
|
54
54
|
# Read context attr from input XML data
|
55
55
|
# @param xmldata (XML Object)
|
56
|
-
def self.read_context_attribute(xmldata)
|
56
|
+
private_class_method def self.read_context_attribute(xmldata)
|
57
57
|
begin
|
58
58
|
context = xmldata.root.attributes['context']
|
59
59
|
rescue StandardError
|
@@ -68,7 +68,7 @@ module ContentLoader
|
|
68
68
|
# @param filepath (String)
|
69
69
|
# @param lang
|
70
70
|
# @param context
|
71
|
-
def self.read_concept(xmldata, filepath, lang, context)
|
71
|
+
private_class_method def self.read_concept(xmldata, filepath, lang, context)
|
72
72
|
project = Project.instance
|
73
73
|
c = Concept.new(xmldata, filepath, lang, context)
|
74
74
|
if [ File.basename(filepath), :default ].include? project.process_file
|
@@ -81,7 +81,7 @@ module ContentLoader
|
|
81
81
|
# Read code from input XML data
|
82
82
|
# @param xmldata (XML Object)
|
83
83
|
# @param filepath (String)
|
84
|
-
def self.read_code(xmldata, filepath)
|
84
|
+
private_class_method def self.read_code(xmldata, filepath)
|
85
85
|
project = Project.instance
|
86
86
|
c = CodeLoader.load(xmldata, filepath)
|
87
87
|
if [ File.basename(filepath), :default ].include? project.process_file
|
@@ -90,7 +90,11 @@ module ContentLoader
|
|
90
90
|
c
|
91
91
|
end
|
92
92
|
|
93
|
-
|
93
|
+
##
|
94
|
+
# Raise error and save content into error.file
|
95
|
+
# @param filepath (String)
|
96
|
+
# @param content (String)
|
97
|
+
private_class_method def self.raise_error_with(filepath, content)
|
94
98
|
msg = Rainbow("[ERROR] ContentLoader: Format error in #{filepath}").red.bright
|
95
99
|
Logger.verbose msg
|
96
100
|
f = File.open('output/error.xml', 'w')
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'haml'
|
4
3
|
require_relative 'content_loader'
|
4
|
+
require_relative 'haml_loader'
|
5
5
|
require_relative '../logger'
|
6
6
|
|
7
7
|
# Methods that load a filename and return list of concepts
|
@@ -11,7 +11,7 @@ module FileLoader
|
|
11
11
|
# @param filename (String) File name to be load
|
12
12
|
def self.load(filename)
|
13
13
|
if File.extname(filename).casecmp('.haml').zero?
|
14
|
-
file_content =
|
14
|
+
file_content = HamlLoader.load filename
|
15
15
|
elsif File.extname(filename).casecmp('.xml').zero?
|
16
16
|
file_content = File.read(filename)
|
17
17
|
else
|
@@ -21,13 +21,4 @@ module FileLoader
|
|
21
21
|
end
|
22
22
|
ContentLoader.load(filename, file_content)
|
23
23
|
end
|
24
|
-
|
25
|
-
##
|
26
|
-
# Load HAML file name
|
27
|
-
# @param filename (String) HAML file name
|
28
|
-
def self.load_haml(filename)
|
29
|
-
template = File.read(filename)
|
30
|
-
haml_engine = Haml::Engine.new(template)
|
31
|
-
haml_engine.render
|
32
|
-
end
|
33
24
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'haml'
|
4
|
+
|
5
|
+
# HAML file loader
|
6
|
+
module HamlLoader
|
7
|
+
##
|
8
|
+
# Load HAML file name
|
9
|
+
# @param filename (String) HAML file name
|
10
|
+
def self.load(filename)
|
11
|
+
template = File.read(filename)
|
12
|
+
haml_engine = Haml::Engine.new(template)
|
13
|
+
haml_engine.render
|
14
|
+
end
|
15
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
2
|
require 'net/http'
|
3
3
|
require 'uri'
|
4
|
-
require_relative '../project'
|
5
4
|
require_relative '../application'
|
5
|
+
require_relative '../logger'
|
6
6
|
|
7
7
|
# Search URL images on Internet
|
8
8
|
# Methods:
|
@@ -12,9 +12,6 @@ require_relative '../application'
|
|
12
12
|
module ImageUrlLoader
|
13
13
|
# Search "input" images on Google and return URL
|
14
14
|
def self.load(input = [])
|
15
|
-
param = Application.instance.config['global']['internet'] || 'yes'
|
16
|
-
return [] unless param == 'yes'
|
17
|
-
|
18
15
|
filters = []
|
19
16
|
if input.class == String
|
20
17
|
filters += sanitize_string(input.clone)
|
@@ -39,10 +36,10 @@ module ImageUrlLoader
|
|
39
36
|
end
|
40
37
|
end
|
41
38
|
rescue
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
39
|
+
Logger.verboseln '[ERROR] ImageUrlLoader'
|
40
|
+
Logger.verboseln " => #{search_url}"
|
41
|
+
Logger.verboseln ' => Check Internet connections'
|
42
|
+
Logger.verboseln ' => Ensure URL is well formed'
|
46
43
|
end
|
47
44
|
image_urls
|
48
45
|
end
|
@@ -11,10 +11,9 @@ module InputLoader
|
|
11
11
|
# Load input data from every input directory
|
12
12
|
# @param inputdirs (Array)
|
13
13
|
def self.load(inputdirs)
|
14
|
-
data = { concepts: [], codes: [], world: nil,
|
14
|
+
data = { concepts: [], codes: [], world: nil,
|
15
|
+
concepts_ai: [], codes_ai: [] }
|
15
16
|
Logger.verbose "\n[INFO] Loading input data"
|
16
|
-
|
17
|
-
# inputdirs = project.inputdirs.split(',')
|
18
17
|
inputdirs.each do |dirname|
|
19
18
|
temp = DirectoryLoader.load(dirname)
|
20
19
|
data[:concepts] += temp[:concepts]
|
@@ -28,14 +27,14 @@ module InputLoader
|
|
28
27
|
# * Calculate concept neighbours
|
29
28
|
# * TO-DO: Calculate code neighbours
|
30
29
|
data[:world] = World.new(data[:concepts])
|
31
|
-
# Create ConceptAI data
|
30
|
+
# Create ConceptAI data (ConceptAI = concept + questions)
|
32
31
|
data[:concepts].each do |concept|
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
data[:concepts_ai] << ConceptAI.new(concept, data[:world])
|
33
|
+
end
|
34
|
+
# Create CodeAI data (CodeAI = code + questions)
|
35
|
+
data[:codes].each do |code|
|
36
|
+
data[:codes_ai] << CodeAIFactory.get(code)
|
36
37
|
end
|
37
|
-
# Make code questions
|
38
|
-
data[:codes].each(&:make_questions)
|
39
38
|
data
|
40
39
|
end
|
41
40
|
end
|
@@ -40,9 +40,9 @@ module ProjectLoader
|
|
40
40
|
def self.load_from_string(filepath)
|
41
41
|
project = Project.instance
|
42
42
|
unless File.exist?(filepath)
|
43
|
-
msg = Rainbow("[
|
44
|
-
|
45
|
-
|
43
|
+
msg = Rainbow("[ERROR] #{filepath} not found!").red.bright
|
44
|
+
Logger.verbose msg
|
45
|
+
exit 1
|
46
46
|
end
|
47
47
|
|
48
48
|
if File.extname(filepath) == '.haml' || File.extname(filepath) == '.xml'
|
@@ -52,7 +52,7 @@ module ProjectLoader
|
|
52
52
|
elsif File.extname(filepath) == '.yaml'
|
53
53
|
return load_from_yaml(filepath)
|
54
54
|
else
|
55
|
-
|
55
|
+
error_loading(filepath)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -64,9 +64,11 @@ module ProjectLoader
|
|
64
64
|
project
|
65
65
|
end
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
##
|
68
|
+
# Error found and exit application.
|
69
|
+
def self.error_loading(arg)
|
70
|
+
msg = Rainbow("[ERROR] Loading... #{arg}").red.bright
|
71
|
+
Logger.verbose msg
|
72
|
+
exit 1
|
71
73
|
end
|
72
74
|
end
|
data/lib/asker/logger.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative 'application'
|
3
4
|
require_relative 'project'
|
4
5
|
|
5
6
|
# Display and log project messages
|
@@ -7,9 +8,8 @@ module Logger
|
|
7
8
|
##
|
8
9
|
# Display and log text
|
9
10
|
def self.verbose(msg)
|
10
|
-
|
11
|
-
|
12
|
-
project.get(:logfile)&.write("#{msg}\n")
|
11
|
+
puts msg if Application.instance.config['global']['verbose'] == 'yes'
|
12
|
+
Project.instance.get(:logfile)&.write("#{msg}\n")
|
13
13
|
end
|
14
14
|
|
15
15
|
##
|
data/lib/asker/project.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'singleton'
|
4
4
|
require 'rainbow'
|
5
|
-
require 'fileutils'
|
5
|
+
# require 'fileutils'
|
6
6
|
require_relative 'application'
|
7
7
|
require_relative 'logger'
|
8
8
|
|
@@ -21,16 +21,8 @@ class Project
|
|
21
21
|
# Reset project params
|
22
22
|
def reset
|
23
23
|
@default = { inputbasedir: FileUtils.pwd,
|
24
|
-
outputdir: 'output',
|
25
|
-
category: :none,
|
26
|
-
formula_weights: [1, 1, 1],
|
27
|
-
lang: 'en',
|
28
|
-
locales: %w[en es javascript math python ruby sql],
|
29
|
-
show_mode: :default,
|
30
|
-
verbose: true,
|
31
24
|
stages: { d: true, b: true, f: true, i: true, s: true, t: true },
|
32
|
-
threshold: 0.5
|
33
|
-
color_output: true }
|
25
|
+
threshold: 0.5 }
|
34
26
|
@param = {}
|
35
27
|
end
|
36
28
|
|
@@ -59,33 +51,27 @@ class Project
|
|
59
51
|
# * process_file
|
60
52
|
# * inputdirs
|
61
53
|
def open
|
62
|
-
|
63
|
-
|
64
|
-
|
54
|
+
config = Application.instance.config
|
55
|
+
ext = File.extname(@param[:process_file]) || '.haml'
|
56
|
+
#@param[:process_file] = @param[:process_file] ||
|
57
|
+
# get(:projectdir).split(File::SEPARATOR).last + ext
|
65
58
|
@param[:projectname] = @param[:projectname] ||
|
66
59
|
File.basename(@param[:process_file], ext)
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
@param[:logname] = @param[:
|
71
|
-
|
72
|
-
@param[:
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
@param[:
|
77
|
-
|
78
|
-
|
79
|
-
@param[:
|
80
|
-
|
81
|
-
|
82
|
-
File.join(get(:outputdir), @param[:outputname])
|
83
|
-
@param[:lessonpath] = @param[:lessonpath] ||
|
84
|
-
File.join(get(:outputdir), @param[:lessonname])
|
85
|
-
@param[:yamlpath] = @param[:yamlpath] ||
|
86
|
-
File.join(get(:outputdir), @param[:yamlname])
|
87
|
-
|
88
|
-
Dir.mkdir(get(:outputdir)) unless Dir.exist?(get(:outputdir))
|
60
|
+
#@param[:inputdirs] = @param[:inputdirs] ||
|
61
|
+
# File.join(get(:inputbasedir), @param[:projectdir])
|
62
|
+
|
63
|
+
@param[:logname] = "#{@param[:projectname]}-log.txt"
|
64
|
+
@param[:outputname] = "#{@param[:projectname]}-gift.txt"
|
65
|
+
@param[:lessonname] = "#{@param[:projectname]}-doc.txt"
|
66
|
+
@param[:yamlname] = "#{@param[:projectname]}.yaml"
|
67
|
+
|
68
|
+
outputdir = config['global']['outputdir']
|
69
|
+
@param[:logpath] = File.join(outputdir, get(:logname))
|
70
|
+
@param[:outputpath] = File.join(outputdir, get(:outputname))
|
71
|
+
@param[:lessonpath] = File.join(outputdir, get(:lessonname))
|
72
|
+
@param[:yamlpath] = File.join(outputdir, get(:yamlname))
|
73
|
+
|
74
|
+
Dir.mkdir(outputdir) unless Dir.exist?(outputdir)
|
89
75
|
create_log_file
|
90
76
|
create_output_file
|
91
77
|
create_lesson_file
|
@@ -101,20 +87,6 @@ class Project
|
|
101
87
|
get(:yamlfile).close
|
102
88
|
end
|
103
89
|
|
104
|
-
##
|
105
|
-
# Display and log text
|
106
|
-
def verbose(msg)
|
107
|
-
puts msg if get(:verbose)
|
108
|
-
get(:logfile).write(msg.to_s + "\n") if get(:logfile)
|
109
|
-
raise "verbose"
|
110
|
-
end
|
111
|
-
|
112
|
-
##
|
113
|
-
# Display and log text line
|
114
|
-
def verboseln(msg)
|
115
|
-
verbose(msg + "\n")
|
116
|
-
end
|
117
|
-
|
118
90
|
def method_missing(method, *_args, &_block)
|
119
91
|
get(method)
|
120
92
|
end
|
@@ -140,6 +112,7 @@ class Project
|
|
140
112
|
|
141
113
|
# Create or reset output file
|
142
114
|
def create_output_file
|
115
|
+
config = Application.instance.config
|
143
116
|
@param[:outputfile] = File.open(get(:outputpath), 'w')
|
144
117
|
f = get(:outputfile)
|
145
118
|
f.write('// ' + ('=' * 50) + "\n")
|
@@ -149,7 +122,8 @@ class Project
|
|
149
122
|
f.write("// Time : #{Time.new}\n")
|
150
123
|
f.write("// Author : David Vargas Ruiz\n")
|
151
124
|
f.write('// ' + ('=' * 50) + "\n\n")
|
152
|
-
|
125
|
+
category = config['questions']['category']
|
126
|
+
f.write("$CATEGORY: $course$/#{category}\n") unless category.nil?
|
153
127
|
end
|
154
128
|
|
155
129
|
# Create or reset lesson file
|
data/lib/asker/skeleton.rb
CHANGED
@@ -12,27 +12,36 @@ require 'rainbow'
|
|
12
12
|
module Skeleton
|
13
13
|
##
|
14
14
|
# Create skeleton for asker input files
|
15
|
-
# @param
|
16
|
-
|
17
|
-
|
15
|
+
# @param inputpath (String)
|
16
|
+
# rubocop:disable Metrics/MethodLength
|
17
|
+
def self.create_input(inputpath)
|
18
|
+
puts "\n[INFO] Creating example input #{Rainbow(inputpath).bright}"
|
19
|
+
if File.extname(inputpath) == '.haml'
|
20
|
+
dirpath = File.dirname(inputpath)
|
21
|
+
filename = File.basename(inputpath)
|
22
|
+
else
|
23
|
+
dirpath = inputpath
|
24
|
+
filename = 'example-concept.haml'
|
25
|
+
end
|
18
26
|
create_dir dirpath
|
19
|
-
|
27
|
+
source = File.join(File.dirname(__FILE__), 'files/example-concept.haml')
|
28
|
+
copyfile(source, File.join(dirpath, filename))
|
20
29
|
end
|
30
|
+
# rubocop:enable Metrics/MethodLength
|
21
31
|
|
22
32
|
##
|
23
|
-
#
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
copyfile(source, target)
|
33
|
+
# Create default configuration files
|
34
|
+
def self.create_configuration
|
35
|
+
puts "\n[INFO] Creating configuration files"
|
36
|
+
src = File.join(File.dirname(__FILE__), 'files', 'config.ini')
|
37
|
+
dst = File.join('config.ini')
|
38
|
+
copyfile(src, dst)
|
30
39
|
end
|
31
40
|
|
32
41
|
##
|
33
42
|
# Create folder
|
34
43
|
# @param dirpath (String)
|
35
|
-
def self.create_dir(dirpath)
|
44
|
+
private_class_method def self.create_dir(dirpath)
|
36
45
|
if Dir.exist? dirpath
|
37
46
|
puts "* Exists dir! => #{Rainbow(dirpath).yellow}"
|
38
47
|
else
|
@@ -49,7 +58,7 @@ module Skeleton
|
|
49
58
|
# Copy target file to dest
|
50
59
|
# @param target (String)
|
51
60
|
# @param dest (String)
|
52
|
-
def self.copyfile(target, dest)
|
61
|
+
private_class_method def self.copyfile(target, dest)
|
53
62
|
if File.exist? dest
|
54
63
|
puts "* Exists file! => #{Rainbow(dest).yellow}"
|
55
64
|
return true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asker-tool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Vargas Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|
@@ -130,14 +130,21 @@ executables:
|
|
130
130
|
extensions: []
|
131
131
|
extra_rdoc_files:
|
132
132
|
- README.md
|
133
|
-
- LICENSE
|
133
|
+
- LICENSE.txt
|
134
134
|
files:
|
135
|
-
- LICENSE
|
135
|
+
- LICENSE.txt
|
136
136
|
- README.md
|
137
137
|
- bin/asker
|
138
138
|
- lib/asker.rb
|
139
139
|
- lib/asker/ai/ai.rb
|
140
140
|
- lib/asker/ai/ai_calculate.rb
|
141
|
+
- lib/asker/ai/code/base_code_ai.rb
|
142
|
+
- lib/asker/ai/code/code_ai_factory.rb
|
143
|
+
- lib/asker/ai/code/javascript_code_ai.rb
|
144
|
+
- lib/asker/ai/code/problem_code_ai.rb
|
145
|
+
- lib/asker/ai/code/python_code_ai.rb
|
146
|
+
- lib/asker/ai/code/ruby_code_ai.rb
|
147
|
+
- lib/asker/ai/code/sql_code_ai.rb
|
141
148
|
- lib/asker/ai/concept_ai.rb
|
142
149
|
- lib/asker/ai/question.rb
|
143
150
|
- lib/asker/ai/stages/base_stage.rb
|
@@ -151,13 +158,7 @@ files:
|
|
151
158
|
- lib/asker/application.rb
|
152
159
|
- lib/asker/checker.rb
|
153
160
|
- lib/asker/cli.rb
|
154
|
-
- lib/asker/code
|
155
|
-
- lib/asker/code/ai/code_ai_factory.rb
|
156
|
-
- lib/asker/code/ai/javascript_code_ai.rb
|
157
|
-
- lib/asker/code/ai/python_code_ai.rb
|
158
|
-
- lib/asker/code/ai/ruby_code_ai.rb
|
159
|
-
- lib/asker/code/ai/sql_code_ai.rb
|
160
|
-
- lib/asker/code/code.rb
|
161
|
+
- lib/asker/data/code.rb
|
161
162
|
- lib/asker/data/column.rb
|
162
163
|
- lib/asker/data/concept.rb
|
163
164
|
- lib/asker/data/data_field.rb
|
@@ -177,6 +178,31 @@ files:
|
|
177
178
|
- lib/asker/files/config.ini
|
178
179
|
- lib/asker/files/example-code.haml
|
179
180
|
- lib/asker/files/example-concept.haml
|
181
|
+
- lib/asker/files/language/du/templates.yaml
|
182
|
+
- lib/asker/files/language/en/connectors.yaml
|
183
|
+
- lib/asker/files/language/en/mistakes.yaml
|
184
|
+
- lib/asker/files/language/en/templates.yaml
|
185
|
+
- lib/asker/files/language/es/connectors.yaml
|
186
|
+
- lib/asker/files/language/es/mistakes.yaml
|
187
|
+
- lib/asker/files/language/es/templates.yaml
|
188
|
+
- lib/asker/files/language/fr/connectors.yaml
|
189
|
+
- lib/asker/files/language/fr/mistakes.yaml
|
190
|
+
- lib/asker/files/language/fr/templates.yaml
|
191
|
+
- lib/asker/files/language/javascript/connectors.yaml
|
192
|
+
- lib/asker/files/language/javascript/mistakes.yaml
|
193
|
+
- lib/asker/files/language/javascript/templates.yaml
|
194
|
+
- lib/asker/files/language/math/connectors.yaml
|
195
|
+
- lib/asker/files/language/math/mistakes.yaml
|
196
|
+
- lib/asker/files/language/math/templates.yaml
|
197
|
+
- lib/asker/files/language/python/connectors.yaml
|
198
|
+
- lib/asker/files/language/python/mistakes.yaml
|
199
|
+
- lib/asker/files/language/python/templates.yaml
|
200
|
+
- lib/asker/files/language/ruby/connectors.yaml
|
201
|
+
- lib/asker/files/language/ruby/mistakes.yaml
|
202
|
+
- lib/asker/files/language/ruby/templates.yaml
|
203
|
+
- lib/asker/files/language/sql/connectors.yaml
|
204
|
+
- lib/asker/files/language/sql/mistakes.yaml
|
205
|
+
- lib/asker/files/language/sql/templates.yaml
|
180
206
|
- lib/asker/formatter/code_string_formatter.rb
|
181
207
|
- lib/asker/formatter/concept_doc_formatter.rb
|
182
208
|
- lib/asker/formatter/concept_string_formatter.rb
|
@@ -186,36 +212,12 @@ files:
|
|
186
212
|
- lib/asker/formatter/rb2haml_formatter.rb
|
187
213
|
- lib/asker/lang/lang.rb
|
188
214
|
- lib/asker/lang/lang_factory.rb
|
189
|
-
- lib/asker/lang/locales/du/templates.yaml
|
190
|
-
- lib/asker/lang/locales/en/connectors.yaml
|
191
|
-
- lib/asker/lang/locales/en/mistakes.yaml
|
192
|
-
- lib/asker/lang/locales/en/templates.yaml
|
193
|
-
- lib/asker/lang/locales/es/connectors.yaml
|
194
|
-
- lib/asker/lang/locales/es/mistakes.yaml
|
195
|
-
- lib/asker/lang/locales/es/templates.yaml
|
196
|
-
- lib/asker/lang/locales/fr/connectors.yaml
|
197
|
-
- lib/asker/lang/locales/fr/mistakes.yaml
|
198
|
-
- lib/asker/lang/locales/fr/templates.yaml
|
199
|
-
- lib/asker/lang/locales/javascript/connectors.yaml
|
200
|
-
- lib/asker/lang/locales/javascript/mistakes.yaml
|
201
|
-
- lib/asker/lang/locales/javascript/templates.yaml
|
202
|
-
- lib/asker/lang/locales/math/connectors.yaml
|
203
|
-
- lib/asker/lang/locales/math/mistakes.yaml
|
204
|
-
- lib/asker/lang/locales/math/templates.yaml
|
205
|
-
- lib/asker/lang/locales/python/connectors.yaml
|
206
|
-
- lib/asker/lang/locales/python/mistakes.yaml
|
207
|
-
- lib/asker/lang/locales/python/templates.yaml
|
208
|
-
- lib/asker/lang/locales/ruby/connectors.yaml
|
209
|
-
- lib/asker/lang/locales/ruby/mistakes.yaml
|
210
|
-
- lib/asker/lang/locales/ruby/templates.yaml
|
211
|
-
- lib/asker/lang/locales/sql/connectors.yaml
|
212
|
-
- lib/asker/lang/locales/sql/mistakes.yaml
|
213
|
-
- lib/asker/lang/locales/sql/templates.yaml
|
214
215
|
- lib/asker/lang/text_actions.rb
|
215
216
|
- lib/asker/loader/code_loader.rb
|
216
217
|
- lib/asker/loader/content_loader.rb
|
217
218
|
- lib/asker/loader/directory_loader.rb
|
218
219
|
- lib/asker/loader/file_loader.rb
|
220
|
+
- lib/asker/loader/haml_loader.rb
|
219
221
|
- lib/asker/loader/image_url_loader.rb
|
220
222
|
- lib/asker/loader/input_loader.rb
|
221
223
|
- lib/asker/loader/project_loader.rb
|
@@ -234,7 +236,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
234
236
|
requirements:
|
235
237
|
- - ">="
|
236
238
|
- !ruby/object:Gem::Version
|
237
|
-
version: 2.
|
239
|
+
version: 2.5.0
|
238
240
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
239
241
|
requirements:
|
240
242
|
- - ">="
|