shnaider_code 1.1.5 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shnaider_code/version.rb +1 -1
- data/lib/source/attr_limited_regex_accessor.rb +43 -0
- data/lib/source/controllers/create_student_controller.rb +8 -0
- data/lib/source/controllers/edit_student_controller.rb +10 -0
- data/lib/source/controllers/view_controller.rb +106 -0
- data/lib/source/data_construct_pattern/data_construct_pattarn.rb +25 -0
- data/lib/source/data_list.rb +59 -0
- data/lib/source/data_list_student_short.rb +28 -0
- data/lib/source/data_table.rb +21 -0
- data/lib/source/database/scripts/create_table.sql +10 -0
- data/lib/source/database/scripts/fill_data.sql +14 -0
- data/lib/source/database/students_db.rb +78 -0
- data/lib/source/database/students_list_db.rb +36 -0
- data/lib/source/student/abstract_student.rb +26 -0
- data/lib/source/student/student.rb +120 -0
- data/lib/source/student/student_short.rb +59 -0
- data/lib/source/student_list_format.rb +50 -0
- data/lib/source/students_list.rb +43 -0
- data/lib/source/students_list_adapter.rb +89 -0
- data/lib/source/students_list_format_strategy.rb +59 -0
- data/lib/source/students_tests.rb +72 -0
- data/shnaider_code.gemspec +4 -6
- metadata +25 -33
- data/CHANGELOG.md +0 -5
- data/CODE_OF_CONDUCT.md +0 -84
- data/Documentation.md +0 -33
- data/Gemfile +0 -13
- data/Gemfile.lock +0 -92
- data/lib/source/controllers/student_input_form/student_input_form_controller_create.rb +0 -68
- data/lib/source/controllers/student_input_form/student_input_form_controller_edit.rb +0 -78
- data/lib/source/controllers/tab_students_controller.rb +0 -104
- data/lib/source/db_config/config.example.yaml +0 -5
- data/lib/source/db_config/migrations/001_create_table_student.sql +0 -12
- data/lib/source/db_config/mock_data/fill_student.sql +0 -6
- data/lib/source/models/student.rb +0 -125
- data/lib/source/models/student_base.rb +0 -128
- data/lib/source/models/student_short.rb +0 -58
- data/lib/source/repositories/adapters/db_source_adapter.rb +0 -54
- data/lib/source/repositories/adapters/file_source_adapter.rb +0 -37
- data/lib/source/repositories/containers/data_list.rb +0 -74
- data/lib/source/repositories/containers/data_list_student_short.rb +0 -18
- data/lib/source/repositories/containers/data_table.rb +0 -35
- data/lib/source/repositories/data_sources/db_data_source.rb +0 -35
- data/lib/source/repositories/data_sources/file_data_source.rb +0 -77
- data/lib/source/repositories/data_sources/transformers/data_transformer_base.rb +0 -15
- data/lib/source/repositories/data_sources/transformers/data_transformer_json.rb +0 -16
- data/lib/source/repositories/data_sources/transformers/data_transformer_yaml.rb +0 -16
- data/lib/source/repositories/student_repository.rb +0 -37
- data/lib/source/util/logger_holder.rb +0 -29
- data/shnaider_code-1.1.4.gem +0 -0
- data/sig/shnaider_code.rbs +0 -4
@@ -0,0 +1,50 @@
|
|
1
|
+
module McDelta
|
2
|
+
class StudentListFormat
|
3
|
+
attr_private_accessor :students
|
4
|
+
attr_accessor :formater
|
5
|
+
|
6
|
+
def initialize(formater)
|
7
|
+
self.formater = formater
|
8
|
+
end
|
9
|
+
|
10
|
+
def read_from(filename)
|
11
|
+
self.students = formater.read_from(filename)
|
12
|
+
end
|
13
|
+
|
14
|
+
def write_to(filename)
|
15
|
+
formater.write_to(filename, self.students)
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_student(id)
|
19
|
+
self.students.detect { |x|
|
20
|
+
x.id == id .to_s
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
def add_student(student)
|
25
|
+
self.students << student
|
26
|
+
end
|
27
|
+
|
28
|
+
def delete_student(id)
|
29
|
+
index = students.index(students.detect { |x| x.id == id.to_s })
|
30
|
+
self.students.delete_at(index)
|
31
|
+
end
|
32
|
+
|
33
|
+
def replace_student(id, student)
|
34
|
+
self.students.map! { |x| x.id == id.to_s ? student : x }
|
35
|
+
end
|
36
|
+
|
37
|
+
def get_students_slice(k, count)
|
38
|
+
from = [k * count, self.students.count].min
|
39
|
+
to = [self.students.count, from + count].min
|
40
|
+
end
|
41
|
+
|
42
|
+
def count()
|
43
|
+
self.students.count
|
44
|
+
end
|
45
|
+
|
46
|
+
def sort()
|
47
|
+
self.students.sort_by(&:fio_info)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require "source/attr_limited_regex_accessor.rb"
|
2
|
+
|
3
|
+
module McDelta
|
4
|
+
class StudentsList
|
5
|
+
attr_private_accessor :students_list_adapter
|
6
|
+
|
7
|
+
def initialize(adapter)
|
8
|
+
self.students_list_adapter = adapter
|
9
|
+
end
|
10
|
+
|
11
|
+
def get_student(id)
|
12
|
+
students_list_adapter.get_student(id)
|
13
|
+
end
|
14
|
+
|
15
|
+
def remove_student(id)
|
16
|
+
students_list_adapter.remove_student(id)
|
17
|
+
end
|
18
|
+
|
19
|
+
def replace_student(id, student)
|
20
|
+
students_list_adapter.replace_student(id, student)
|
21
|
+
end
|
22
|
+
|
23
|
+
def get_students(from, to, data)
|
24
|
+
values = students_list_adapter.get_students(from, to)
|
25
|
+
|
26
|
+
if data == nil
|
27
|
+
data = DataList.new(list: values)
|
28
|
+
else
|
29
|
+
data.list = values
|
30
|
+
end
|
31
|
+
|
32
|
+
data.list
|
33
|
+
end
|
34
|
+
|
35
|
+
def add_student(student)
|
36
|
+
students_list_adapter.add_student(student)
|
37
|
+
end
|
38
|
+
|
39
|
+
def count
|
40
|
+
students_list_adapter.count()
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module McDelta
|
2
|
+
class StudentsListAdapter
|
3
|
+
def get_student(id)
|
4
|
+
end
|
5
|
+
|
6
|
+
def remove_student(id)
|
7
|
+
end
|
8
|
+
|
9
|
+
def replace_student(id, student, data)
|
10
|
+
end
|
11
|
+
|
12
|
+
def get_students(from, to, data)
|
13
|
+
end
|
14
|
+
|
15
|
+
def add_student(student)
|
16
|
+
end
|
17
|
+
|
18
|
+
def count
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class StudentsListDBAdapter < StudentsListAdapter
|
23
|
+
attr_private_accessor :database_list
|
24
|
+
|
25
|
+
def initialize(database_list)
|
26
|
+
self.database_list = database_list
|
27
|
+
end
|
28
|
+
|
29
|
+
def get_student(id)
|
30
|
+
database_list.get_student(id)
|
31
|
+
end
|
32
|
+
|
33
|
+
def remove_student(id)
|
34
|
+
database_list.remove_student(id)
|
35
|
+
end
|
36
|
+
|
37
|
+
def replace_student(id, student)
|
38
|
+
database_list.replace_student(id, student)
|
39
|
+
end
|
40
|
+
|
41
|
+
def get_students(from, to)
|
42
|
+
database_list.get_students_slice(from, to)
|
43
|
+
end
|
44
|
+
|
45
|
+
def add_student(student)
|
46
|
+
database_list.add_student(student)
|
47
|
+
end
|
48
|
+
|
49
|
+
def count
|
50
|
+
database_list.count()
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
class StudentsListFormatterAdapter < StudentsListAdapter
|
55
|
+
attr_private_accessor :formatter
|
56
|
+
|
57
|
+
def initialize(formatter, filename)
|
58
|
+
self.formatter = formatter
|
59
|
+
formatter.read_from(filename)
|
60
|
+
end
|
61
|
+
|
62
|
+
def get_student(id)
|
63
|
+
formatter.get_student(id)
|
64
|
+
end
|
65
|
+
|
66
|
+
def remove_student(id)
|
67
|
+
formatter.delete_student(id)
|
68
|
+
end
|
69
|
+
|
70
|
+
def replace_student(id, student)
|
71
|
+
formatter.replace_student(id, student)
|
72
|
+
end
|
73
|
+
|
74
|
+
def get_students(from, to)
|
75
|
+
count = to - from
|
76
|
+
k = from / count
|
77
|
+
|
78
|
+
formatter.get_students_slice(k, count)
|
79
|
+
end
|
80
|
+
|
81
|
+
def add_student(student)
|
82
|
+
formatter.add_student(student)
|
83
|
+
end
|
84
|
+
|
85
|
+
def count
|
86
|
+
formatter.count()
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
module McDelta
|
5
|
+
class StudentsListFormatStrategy
|
6
|
+
def read_from(filename)
|
7
|
+
require 'method not implemented'
|
8
|
+
end
|
9
|
+
|
10
|
+
def write_to(filename, students)
|
11
|
+
require 'method not implemented'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class TxtStudentsListFormatStrategy < StudentsListFormatStrategy
|
16
|
+
def read_from(filename)
|
17
|
+
File.read(filename)
|
18
|
+
.split("\n")
|
19
|
+
.map { |v| Student.from_string(v) }
|
20
|
+
end
|
21
|
+
|
22
|
+
def write_to(filename, students)
|
23
|
+
File.open(filename, 'w') { |file|
|
24
|
+
file.write(
|
25
|
+
students.map { |student|
|
26
|
+
student.get_info
|
27
|
+
}
|
28
|
+
.join("\n")
|
29
|
+
)
|
30
|
+
}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class JsonStudentsListFormatStrategy < StudentsListFormatStrategy
|
35
|
+
def read_from(filename)
|
36
|
+
file = File.read(filename)
|
37
|
+
json = JSON.parse(file)
|
38
|
+
json.map { |x| Student.from_json(x) }
|
39
|
+
end
|
40
|
+
|
41
|
+
def write_to(filename, students)
|
42
|
+
File.open(filename, 'w') do |f|
|
43
|
+
f.write(JSON.generate(students.map { |x| x.as_json }))
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
class YamlStudentsListFormatStrategy < StudentsListFormatStrategy
|
49
|
+
def read_from(filename)
|
50
|
+
YAML.load_file(filename)
|
51
|
+
end
|
52
|
+
|
53
|
+
def write_to(filename, students)
|
54
|
+
File.open(filename, 'w') do |file|
|
55
|
+
file.write(students.to_yaml)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require "test/unit"
|
2
|
+
require "source/students_list.rb"
|
3
|
+
require "source/attr_limited_regex_accessor.rb"
|
4
|
+
require "source/students_list_adapter.rb"
|
5
|
+
require "source/database/students_list_db.rb"
|
6
|
+
require "source/student/student.rb"
|
7
|
+
require "source/data_list.rb"
|
8
|
+
|
9
|
+
module McDelta
|
10
|
+
class StudentsTests < Test::Unit::TestCase
|
11
|
+
def test_add
|
12
|
+
@students = StudentsList.new(
|
13
|
+
StudentsListDBAdapter.new(
|
14
|
+
StudentsListDB
|
15
|
+
)
|
16
|
+
)
|
17
|
+
|
18
|
+
@start_count = @students.count
|
19
|
+
|
20
|
+
@students.add_student(
|
21
|
+
Student.new(
|
22
|
+
lastname: "AAA",
|
23
|
+
firstname: "BBB",
|
24
|
+
patronymic: "CCC",
|
25
|
+
params: {
|
26
|
+
email: "test@email.com"
|
27
|
+
}
|
28
|
+
)
|
29
|
+
)
|
30
|
+
|
31
|
+
assert_equal(1, @students.count - @start_count)
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_delete
|
35
|
+
@students = StudentsList.new(
|
36
|
+
StudentsListDBAdapter.new(
|
37
|
+
StudentsListDB
|
38
|
+
)
|
39
|
+
)
|
40
|
+
|
41
|
+
@students.add_student(
|
42
|
+
Student.new(
|
43
|
+
lastname: "AAA",
|
44
|
+
firstname: "BBB",
|
45
|
+
patronymic: "CCC",
|
46
|
+
params: {
|
47
|
+
email: "test@email.com"
|
48
|
+
}
|
49
|
+
)
|
50
|
+
)
|
51
|
+
|
52
|
+
@students.add_student(
|
53
|
+
Student.new(
|
54
|
+
lastname: "AAA",
|
55
|
+
firstname: "BBB",
|
56
|
+
patronymic: "CCC",
|
57
|
+
params: {
|
58
|
+
email: "test@email.com"
|
59
|
+
}
|
60
|
+
)
|
61
|
+
)
|
62
|
+
|
63
|
+
@current_count = @students.count
|
64
|
+
|
65
|
+
@students_list = @students.get_students(0, 10, nil)
|
66
|
+
|
67
|
+
@students.remove_student(@students_list[0].id)
|
68
|
+
|
69
|
+
assert_equal(1, @current_count - @students.count)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
data/shnaider_code.gemspec
CHANGED
@@ -1,17 +1,15 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
require_relative "lib/shnaider_code/version"
|
4
2
|
|
5
3
|
Gem::Specification.new do |spec|
|
6
4
|
spec.name = "shnaider_code"
|
7
5
|
spec.version = ShnaiderCode::VERSION
|
8
|
-
spec.authors = ["
|
9
|
-
spec.email = ["
|
6
|
+
spec.authors = ["Iya"]
|
7
|
+
spec.email = ["iya@gmail.com"]
|
10
8
|
spec.summary = "Student App"
|
11
9
|
spec.description = "А gem that allows you to get pass for patterns"
|
12
|
-
spec.homepage = "https://github.com/bushmrz/
|
10
|
+
spec.homepage = "https://github.com/bushmrz/learning-patterns-with-ruby"
|
13
11
|
spec.license = "MIT"
|
14
12
|
spec.required_ruby_version = ">= 3.2.0"
|
15
13
|
spec.add_dependency 'win32api'
|
16
14
|
spec.files = Dir.glob("**/*")
|
17
|
-
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shnaider_code
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Iya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: win32api
|
@@ -26,43 +26,35 @@ dependencies:
|
|
26
26
|
version: '0'
|
27
27
|
description: А gem that allows you to get pass for patterns
|
28
28
|
email:
|
29
|
-
-
|
29
|
+
- iya@gmail.com
|
30
30
|
executables: []
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
-
- CHANGELOG.md
|
35
|
-
- CODE_OF_CONDUCT.md
|
36
|
-
- Documentation.md
|
37
|
-
- Gemfile
|
38
|
-
- Gemfile.lock
|
39
34
|
- lib/shnaider_code.rb
|
40
35
|
- lib/shnaider_code/version.rb
|
41
|
-
- lib/source/
|
42
|
-
- lib/source/controllers/
|
43
|
-
- lib/source/controllers/
|
44
|
-
- lib/source/
|
45
|
-
- lib/source/
|
46
|
-
- lib/source/
|
47
|
-
- lib/source/
|
48
|
-
- lib/source/
|
49
|
-
- lib/source/
|
50
|
-
- lib/source/
|
51
|
-
- lib/source/
|
52
|
-
- lib/source/
|
53
|
-
- lib/source/
|
54
|
-
- lib/source/
|
55
|
-
- lib/source/
|
56
|
-
- lib/source/
|
57
|
-
- lib/source/
|
58
|
-
- lib/source/
|
59
|
-
- lib/source/
|
60
|
-
- lib/source/
|
61
|
-
- lib/source/util/logger_holder.rb
|
62
|
-
- shnaider_code-1.1.4.gem
|
36
|
+
- lib/source/attr_limited_regex_accessor.rb
|
37
|
+
- lib/source/controllers/create_student_controller.rb
|
38
|
+
- lib/source/controllers/edit_student_controller.rb
|
39
|
+
- lib/source/controllers/view_controller.rb
|
40
|
+
- lib/source/data_construct_pattern/data_construct_pattarn.rb
|
41
|
+
- lib/source/data_list.rb
|
42
|
+
- lib/source/data_list_student_short.rb
|
43
|
+
- lib/source/data_table.rb
|
44
|
+
- lib/source/database/scripts/create_table.sql
|
45
|
+
- lib/source/database/scripts/fill_data.sql
|
46
|
+
- lib/source/database/students_db.rb
|
47
|
+
- lib/source/database/students_list_db.rb
|
48
|
+
- lib/source/student/abstract_student.rb
|
49
|
+
- lib/source/student/student.rb
|
50
|
+
- lib/source/student/student_short.rb
|
51
|
+
- lib/source/student_list_format.rb
|
52
|
+
- lib/source/students_list.rb
|
53
|
+
- lib/source/students_list_adapter.rb
|
54
|
+
- lib/source/students_list_format_strategy.rb
|
55
|
+
- lib/source/students_tests.rb
|
63
56
|
- shnaider_code.gemspec
|
64
|
-
|
65
|
-
homepage: https://github.com/bushmrz/learning_patterns_with_ruby
|
57
|
+
homepage: https://github.com/bushmrz/learning-patterns-with-ruby
|
66
58
|
licenses:
|
67
59
|
- MIT
|
68
60
|
metadata: {}
|
data/CHANGELOG.md
DELETED
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
-
|
7
|
-
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
-
|
9
|
-
## Our Standards
|
10
|
-
|
11
|
-
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
-
|
13
|
-
* Demonstrating empathy and kindness toward other people
|
14
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
-
* Giving and gracefully accepting constructive feedback
|
16
|
-
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
-
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
-
|
19
|
-
Examples of unacceptable behavior include:
|
20
|
-
|
21
|
-
* The use of sexualized language or imagery, and sexual attention or
|
22
|
-
advances of any kind
|
23
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
-
* Public or private harassment
|
25
|
-
* Publishing others' private information, such as a physical or email
|
26
|
-
address, without their explicit permission
|
27
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
-
professional setting
|
29
|
-
|
30
|
-
## Enforcement Responsibilities
|
31
|
-
|
32
|
-
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
-
|
34
|
-
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
-
|
36
|
-
## Scope
|
37
|
-
|
38
|
-
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
-
|
40
|
-
## Enforcement
|
41
|
-
|
42
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at delta.null@vk.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
-
|
44
|
-
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
-
|
46
|
-
## Enforcement Guidelines
|
47
|
-
|
48
|
-
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
-
|
50
|
-
### 1. Correction
|
51
|
-
|
52
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
-
|
54
|
-
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
-
|
56
|
-
### 2. Warning
|
57
|
-
|
58
|
-
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
-
|
60
|
-
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
-
|
62
|
-
### 3. Temporary Ban
|
63
|
-
|
64
|
-
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
-
|
66
|
-
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
-
|
68
|
-
### 4. Permanent Ban
|
69
|
-
|
70
|
-
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
-
|
72
|
-
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
-
|
74
|
-
## Attribution
|
75
|
-
|
76
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
-
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
-
|
79
|
-
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
-
|
81
|
-
[homepage]: https://www.contributor-covenant.org
|
82
|
-
|
83
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
-
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Documentation.md
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
The TabStudentsController class is a controller for working with the interface for interacting with objects of the Student type.
|
2
|
-
|
3
|
-
Methods of the class:
|
4
|
-
|
5
|
-
1. initialize(view) - constructor of the class, takes a view object and creates an empty object of the type
|
6
|
-
DataListStudentShort, which is assigned the add_listener method with the view argument, as a result of which the view
|
7
|
-
is set as a listener for data state change events (data_list).
|
8
|
-
2. on_view_created is a method that initializes an object of the StudentRepository type, which is used for interaction
|
9
|
-
with the database, and if an error occurs connecting to the database displays a dialog box with an error message.
|
10
|
-
3. show_view is a method that displays the main application window.
|
11
|
-
4. show_modal_add is a method that displays a modal window for creating a new student record.
|
12
|
-
Creates an instance of the StudentInputFormControllerCreate controller and passes it a reference to the current controller,
|
13
|
-
creates an object of the StudentInputForm type and passes it a reference to the controller. Then it displays the modal window.
|
14
|
-
5. show_modal_edit(current_page, per_page, selected_row) is a method that displays the modal window for
|
15
|
-
editing a student record. Takes the values of the current page (current_page), the number of records on the page
|
16
|
-
(per_page) and the selected row (selected_row). Calculates the number of the selected student and selects his id from
|
17
|
-
the DataListStudentShort object, then passes it to the StudentInputFormControllerEdit controller, creates an object of the type
|
18
|
-
StudentInputForm and passes it a link to the controller. After that, it displays a modal window.
|
19
|
-
6. delete_selected(current_page, per_page, selected_row) is a method that deletes the selected student record.
|
20
|
-
Takes the values of the current page (current_page), the number of records on the page (per_page)
|
21
|
-
and the selected row (selected_row). Calculates the number of the selected student and selects his id from the DataListStudentShort object,
|
22
|
-
then deletes the record using the remove_student method from the StudentRepository object.
|
23
|
-
7. refresh_data(page, per_page) is a method that updates the data in the list of students. Takes the values
|
24
|
-
of the current page (page) and the number of entries on the page (per_page).
|
25
|
-
Calls a method of the StudentRepository paginated_short_students type to get data in the DataListStudentShort object format.
|
26
|
-
Updates information about the number of students using the update_student_count method of the view.
|
27
|
-
|
28
|
-
The Student_Input_Form_Controller_Edit controller and Student_Input_Form_Controller_Create are forms
|
29
|
-
for modifying and creating students into the database, respectively.
|
30
|
-
|
31
|
-
The student, student_base and student_short models are a student model with various fields and methods
|
32
|
-
for setting, receiving and processing information. Student_base - super class,
|
33
|
-
and student_short is the short information about the student.
|
data/Gemfile
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "mysql2"
|
6
|
-
gem "glimmer-dsl-libui",'~> 0.7.4'
|
7
|
-
gem 'win32api'
|
8
|
-
gem "minitest"
|
9
|
-
gem 'rubocop', group: 'development'
|
10
|
-
# gem 'shnaider_code', '~> 0.1.3'
|
11
|
-
gem 'shnaider_code'
|
12
|
-
gem 'sinatra', '~> 3.0', '>= 3.0.6'
|
13
|
-
gem 'thin', '~> 1.8', '>= 1.8.2'
|
data/Gemfile.lock
DELETED
@@ -1,92 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
array_include_methods (1.4.0)
|
5
|
-
ast (2.4.2)
|
6
|
-
chunky_png (1.4.0)
|
7
|
-
color (1.8)
|
8
|
-
daemons (1.4.1)
|
9
|
-
equalizer (0.0.11)
|
10
|
-
eventmachine (1.2.7)
|
11
|
-
facets (3.1.0)
|
12
|
-
glimmer (2.7.3)
|
13
|
-
array_include_methods (~> 1.4.0)
|
14
|
-
facets (>= 3.1.0, < 4.0.0)
|
15
|
-
glimmer-dsl-libui (0.7.7)
|
16
|
-
chunky_png (~> 1.4.0)
|
17
|
-
color (~> 1.8)
|
18
|
-
equalizer (= 0.0.11)
|
19
|
-
glimmer (~> 2.7.3)
|
20
|
-
libui (~> 0.1.2.pre)
|
21
|
-
os (>= 1.0.0, < 2.0.0)
|
22
|
-
perfect-shape (~> 1.0.7)
|
23
|
-
rouge (>= 3.26.0, < 4.0.0)
|
24
|
-
super_module (~> 1.4.1)
|
25
|
-
json (2.6.3)
|
26
|
-
libui (0.1.2.pre-x64-mingw)
|
27
|
-
matrix (0.4.2)
|
28
|
-
method_source (1.0.0)
|
29
|
-
minitest (5.18.0)
|
30
|
-
mustermann (3.0.0)
|
31
|
-
ruby2_keywords (~> 0.0.1)
|
32
|
-
mysql2 (0.5.5)
|
33
|
-
os (1.1.4)
|
34
|
-
parallel (1.23.0)
|
35
|
-
parser (3.2.2.1)
|
36
|
-
ast (~> 2.4.1)
|
37
|
-
perfect-shape (1.0.7)
|
38
|
-
equalizer (>= 0.0.11, < 1.1.0)
|
39
|
-
matrix (>= 0.4.2, < 1.1.0)
|
40
|
-
rack (2.2.7)
|
41
|
-
rack-protection (3.0.6)
|
42
|
-
rack
|
43
|
-
rainbow (3.1.1)
|
44
|
-
regexp_parser (2.8.0)
|
45
|
-
rexml (3.2.5)
|
46
|
-
rouge (3.30.0)
|
47
|
-
rubocop (1.51.0)
|
48
|
-
json (~> 2.3)
|
49
|
-
parallel (~> 1.10)
|
50
|
-
parser (>= 3.2.0.0)
|
51
|
-
rainbow (>= 2.2.2, < 4.0)
|
52
|
-
regexp_parser (>= 1.8, < 3.0)
|
53
|
-
rexml (>= 3.2.5, < 4.0)
|
54
|
-
rubocop-ast (>= 1.28.0, < 2.0)
|
55
|
-
ruby-progressbar (~> 1.7)
|
56
|
-
unicode-display_width (>= 2.4.0, < 3.0)
|
57
|
-
rubocop-ast (1.28.1)
|
58
|
-
parser (>= 3.2.1.0)
|
59
|
-
ruby-progressbar (1.13.0)
|
60
|
-
ruby2_keywords (0.0.5)
|
61
|
-
shnaider_code (1.1.4)
|
62
|
-
win32api
|
63
|
-
sinatra (3.0.6)
|
64
|
-
mustermann (~> 3.0)
|
65
|
-
rack (~> 2.2, >= 2.2.4)
|
66
|
-
rack-protection (= 3.0.6)
|
67
|
-
tilt (~> 2.0)
|
68
|
-
super_module (1.4.1)
|
69
|
-
method_source (>= 0.8.2, < 1.1.0)
|
70
|
-
thin (1.8.2)
|
71
|
-
daemons (~> 1.0, >= 1.0.9)
|
72
|
-
eventmachine (~> 1.0, >= 1.0.4)
|
73
|
-
rack (>= 1, < 3)
|
74
|
-
tilt (2.1.0)
|
75
|
-
unicode-display_width (2.4.2)
|
76
|
-
win32api (0.1.0)
|
77
|
-
|
78
|
-
PLATFORMS
|
79
|
-
x64-mingw-ucrt
|
80
|
-
|
81
|
-
DEPENDENCIES
|
82
|
-
glimmer-dsl-libui (~> 0.7.4)
|
83
|
-
minitest
|
84
|
-
mysql2
|
85
|
-
rubocop
|
86
|
-
shnaider_code
|
87
|
-
sinatra (~> 3.0, >= 3.0.6)
|
88
|
-
thin (~> 1.8, >= 1.8.2)
|
89
|
-
win32api
|
90
|
-
|
91
|
-
BUNDLED WITH
|
92
|
-
2.4.10
|