ruby_qb101 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/data/ruby_qb101.txt +22 -0
- data/lib/ruby_qb101.rb +18 -24
- data.tar.gz.sig +0 -0
- metadata +22 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c606fe457d92b06eee6014a642500016f4a2d95f981b5f2cec5ff0b2205df1e
|
4
|
+
data.tar.gz: a8cd2544671cdf4663a38f214295d0ce122e5c40a1ea36e13a8ed700b12c4f96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 225a7f5988f5b3976f5db04f36d93cfb1f79c6bef45c76cfbf9e9d34ebecd276d650112cb7eefe5a443bf29478ced234df8713fcaed10e0085cdeb80819c2653
|
7
|
+
data.tar.gz: b8f582f0a6681394669c934482dc65352ec40a54a2ee51d4eec4edb579a87b24f4b98f8f7bddc1bf7a9cfcc5c18e5728ce6dc52f9e96642d535e8ebe7938bf9e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/data/ruby_qb101.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
<?ph schema="book[title,tags]/section[x]"?>
|
2
|
+
|
3
|
+
title: Questions to ask when learning the programming language Ruby
|
4
|
+
tags: ruby learning book questions answers
|
5
|
+
|
6
|
+
# Questions to ask when learning the programming language Ruby
|
7
|
+
|
8
|
+
## Introduction to Programming
|
9
|
+
|
10
|
+
Write a table of contents for a programming language
|
11
|
+
|
12
|
+
What is an expression in a programming language?
|
13
|
+
|
14
|
+
What is a statement in a programming language?
|
15
|
+
|
16
|
+
|
17
|
+
## Data types
|
18
|
+
|
19
|
+
Give me an example of using an integer in the programming language Ruby.
|
20
|
+
|
21
|
+
Give me an example of using a boolean in the programming language Ruby.
|
22
|
+
|
data/lib/ruby_qb101.rb
CHANGED
@@ -4,36 +4,19 @@
|
|
4
4
|
|
5
5
|
# Description: Ruby related questions to ask Chat GPT. #experimental
|
6
6
|
|
7
|
+
require 'yatoc'
|
7
8
|
require 'polyrex-headings'
|
8
9
|
|
9
|
-
QUESTIONS = <<-MARKDOWN
|
10
|
-
|
11
|
-
title: Questions to ask when learning the programming language Ruby
|
12
|
-
tags: ruby learning book questions answers
|
13
|
-
|
14
|
-
# Questions to ask when learning the programming language Ruby
|
15
|
-
|
16
|
-
## Introduction to Programming
|
17
|
-
|
18
|
-
Write a table of contents for a programming language
|
19
|
-
What is an expression in a programming language?
|
20
|
-
What is a statement in a programming language?
|
21
|
-
|
22
|
-
|
23
|
-
## Data types
|
24
|
-
|
25
|
-
Give me an example of using an integer in the programming language Ruby.
|
26
|
-
Give me an example of using a boolean in the programming language Ruby.
|
27
|
-
|
28
|
-
|
29
|
-
MARKDOWN
|
30
10
|
|
31
11
|
class Ruby_Qb101
|
32
12
|
|
33
|
-
def initialize(
|
13
|
+
def initialize(questions_file=nil)
|
14
|
+
|
15
|
+
questions_file ||= File.join(File.dirname(__FILE__), '..',
|
16
|
+
'data', 'ruby_qb101.txt')
|
34
17
|
|
35
|
-
|
36
|
-
|
18
|
+
s = File.read(questions_file)
|
19
|
+
@questions = s[/#.*/m]
|
37
20
|
@px = PolyrexHeadings.new(s, debug: false).to_polyrex
|
38
21
|
|
39
22
|
end
|
@@ -51,9 +34,20 @@ class Ruby_Qb101
|
|
51
34
|
@questions
|
52
35
|
end
|
53
36
|
|
37
|
+
def to_html()
|
38
|
+
Kramdown::Document.new(@questions).to_html
|
39
|
+
end
|
40
|
+
|
41
|
+
def to_toc()
|
42
|
+
Yatoc.new(self.to_html(), min_sections: 1)
|
43
|
+
end
|
44
|
+
|
54
45
|
def to_xml()
|
55
46
|
@px.to_xml(pretty: true)
|
56
47
|
end
|
57
48
|
|
58
49
|
end
|
59
50
|
|
51
|
+
#qb = Ruby_Qb101.new()
|
52
|
+
#qb.to_md
|
53
|
+
#qb.question('7')
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_qb101
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -38,6 +38,26 @@ cert_chain:
|
|
38
38
|
-----END CERTIFICATE-----
|
39
39
|
date: 2023-02-06 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: yatoc
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.3'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 0.3.5
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0.3'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 0.3.5
|
41
61
|
- !ruby/object:Gem::Dependency
|
42
62
|
name: polyrex-headings
|
43
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,6 +84,7 @@ executables: []
|
|
64
84
|
extensions: []
|
65
85
|
extra_rdoc_files: []
|
66
86
|
files:
|
87
|
+
- data/ruby_qb101.txt
|
67
88
|
- lib/ruby_qb101.rb
|
68
89
|
homepage: https://github.com/jrobertson/ruby_qb101
|
69
90
|
licenses:
|
metadata.gz.sig
CHANGED
Binary file
|