mc_gem2 1.1.4 → 1.1.5
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/lib/mc_gem2/version.rb +1 -1
- data/lib/mc_gem2.rb +4 -1
- data/lib/source/student_input_form.rb +71 -0
- data/lib/source/student_list_controller.rb +2 -1
- data/lib/source/{database/students_db.rb → students_db.rb} +3 -6
- data/mc_gem2-1.1.4.gem +0 -0
- metadata +7 -5
- /data/lib/source/{database/scripts/create_table.sql → create_table.sql} +0 -0
- /data/lib/source/{database/scripts/insert_data.sql → insert_data.sql} +0 -0
- /data/lib/source/{database/student_list_db.rb → student_list_db.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e75f47bcad95e968d7708841cfb3850e30db97ebd5150c0a235b2bbac5082b4b
|
4
|
+
data.tar.gz: e12bf481d5c645ccceb462bfc11abb8d6174487ae54dbb92eb8fc92f3d74c7b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8630a04ffe2a80ffd100d3d2f46707976d8aeb9deb9d614cae7563b9eb931fb59b5f8958ccf254ced541bbbd0f9a073877e62f53a7062a833b34031c2d56643
|
7
|
+
data.tar.gz: 578e34d8c52fba5ddd45c942fb70cdb87eab844434007b1fde63876a5aaa349623cbeff807bab66457c34493d90d106b7c59b2cd3625aecfac0b8fc79e4aa0d6
|
data/lib/mc_gem2/version.rb
CHANGED
data/lib/mc_gem2.rb
CHANGED
@@ -3,8 +3,11 @@
|
|
3
3
|
require_relative "mc_gem2/version"
|
4
4
|
|
5
5
|
module McGem2
|
6
|
-
Dir[File.dirname(__FILE__) + '
|
6
|
+
Dir[File.dirname(__FILE__) + 'source/*.rb'].each { |file|
|
7
7
|
puts file
|
8
8
|
require file
|
9
9
|
}
|
10
|
+
Dir[File.dirname(__FILE__) + 'source/**/*.rb'].each { |file|
|
11
|
+
require file
|
12
|
+
}
|
10
13
|
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'glimmer-dsl-libui'
|
4
|
+
require_relative '../Gem_fuss/lib/source/roller'
|
5
|
+
require_relative '../Gem_fuss/lib/source/StudentBase'
|
6
|
+
require 'win32api'
|
7
|
+
|
8
|
+
class StudentInputForm
|
9
|
+
include Glimmer
|
10
|
+
|
11
|
+
def initialize(controller,existing_student = nil)
|
12
|
+
@existing_student = existing_student.to_hash unless existing_student.nil?
|
13
|
+
@controller = controller
|
14
|
+
@entries = {}
|
15
|
+
end
|
16
|
+
|
17
|
+
def on_create
|
18
|
+
@controller.on_view_created
|
19
|
+
end
|
20
|
+
|
21
|
+
def create
|
22
|
+
@root_container = window('Универ', 300, 150) {
|
23
|
+
resizable false
|
24
|
+
|
25
|
+
vertical_box {
|
26
|
+
@student_form = form {
|
27
|
+
stretchy false
|
28
|
+
|
29
|
+
fields = [[:last_name, 'Фамилия', false], [:first_name, 'Имя', false], [:parental_name, 'Отчество', false], [:git, 'Гит', true], [:telegram, 'Телеграм', true], [:email, 'Почта', true], [:phone, 'Телефон', true]]
|
30
|
+
|
31
|
+
fields.each do |field|
|
32
|
+
@entries[field[0]] = entry {
|
33
|
+
label field[1]
|
34
|
+
text @existing_student[field[0]] unless @existing_student.nil?
|
35
|
+
|
36
|
+
read_only field[2] unless @existing_student.nil?
|
37
|
+
}
|
38
|
+
end
|
39
|
+
}
|
40
|
+
|
41
|
+
button('Сохранить') {
|
42
|
+
stretchy false
|
43
|
+
|
44
|
+
on_clicked {
|
45
|
+
values = @entries.transform_values { |v| v.text.force_encoding("utf-8").strip }
|
46
|
+
values.transform_values! { |v| v.empty? ? nil : v}
|
47
|
+
@controller.process_fields(values)
|
48
|
+
@controller.refresh
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
on_create
|
54
|
+
@root_container
|
55
|
+
end
|
56
|
+
|
57
|
+
def set_value(field, value)
|
58
|
+
return unless @entries.include?(field)
|
59
|
+
@entries[field].text = value
|
60
|
+
end
|
61
|
+
|
62
|
+
def make_readonly(*fields)
|
63
|
+
fields.each do |field|
|
64
|
+
@entries[field].read_only = true
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def close
|
69
|
+
@root_container.destroy
|
70
|
+
end
|
71
|
+
end
|
@@ -3,13 +3,14 @@
|
|
3
3
|
# frozen_string_literal: true
|
4
4
|
require_relative 'student_list_adv'
|
5
5
|
require_relative 'student_list_adapter'
|
6
|
-
require_relative '
|
6
|
+
require_relative 'student_list_db'
|
7
7
|
require_relative 'Converter_json'
|
8
8
|
require_relative 'Converter'
|
9
9
|
require_relative 'Student_list'
|
10
10
|
require_relative 'student_edit_form_controller'
|
11
11
|
require 'win32api'
|
12
12
|
require 'mysql2'
|
13
|
+
require 'mc_gem2'
|
13
14
|
require_relative 'logger_holder'
|
14
15
|
class StudentListController
|
15
16
|
def initialize(view)
|
@@ -1,10 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# #encoding: UTF-8
|
3
3
|
require 'mysql2'
|
4
|
-
|
5
|
-
require_relative '../Data_list'
|
6
|
-
require_relative '../Student'
|
7
|
-
require_relative '../Student_short'
|
4
|
+
require 'mc_gem2'
|
8
5
|
class StudentDB
|
9
6
|
|
10
7
|
attr_accessor :db_connection
|
@@ -14,12 +11,12 @@ class StudentDB
|
|
14
11
|
self.db_connection.query('CREATE DATABASE IF NOT EXISTS stud_db')
|
15
12
|
self.db_connection.query('USE stud_db')
|
16
13
|
self.db_connection.query('DROP TABLE IF EXISTS student')
|
17
|
-
self.db_connection.query(File.read('F:/Other/RLabs/dataset/RubyLabsReserved/Gem_fuss/lib/source/
|
14
|
+
self.db_connection.query(File.read('F:/Other/RLabs/dataset/RubyLabsReserved/Gem_fuss/lib/source/create_table.sql'))
|
18
15
|
self.insert_data
|
19
16
|
end
|
20
17
|
|
21
18
|
def insert_data
|
22
|
-
db_connection.query(File.read('F:/Other/RLabs/dataset/RubyLabsReserved/Gem_fuss/lib/source/
|
19
|
+
db_connection.query(File.read('F:/Other/RLabs/dataset/RubyLabsReserved/Gem_fuss/lib/source/insert_data.sql'))
|
23
20
|
end
|
24
21
|
|
25
22
|
def select_by_id(id)
|
data/mc_gem2-1.1.4.gem
ADDED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mc_gem2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- papaSquid
|
@@ -50,16 +50,18 @@ files:
|
|
50
50
|
- lib/source/StudentBase.rb
|
51
51
|
- lib/source/Student_list.rb
|
52
52
|
- lib/source/Student_short.rb
|
53
|
-
- lib/source/
|
54
|
-
- lib/source/
|
55
|
-
- lib/source/database/student_list_db.rb
|
56
|
-
- lib/source/database/students_db.rb
|
53
|
+
- lib/source/create_table.sql
|
54
|
+
- lib/source/insert_data.sql
|
57
55
|
- lib/source/logger_holder.rb
|
58
56
|
- lib/source/student_edit_form_controller.rb
|
57
|
+
- lib/source/student_input_form.rb
|
59
58
|
- lib/source/student_input_form_controller.rb
|
60
59
|
- lib/source/student_list_adapter.rb
|
61
60
|
- lib/source/student_list_adv.rb
|
62
61
|
- lib/source/student_list_controller.rb
|
62
|
+
- lib/source/student_list_db.rb
|
63
|
+
- lib/source/students_db.rb
|
64
|
+
- mc_gem2-1.1.4.gem
|
63
65
|
- mc_gem2.gemspec
|
64
66
|
- sig/mc_gem2.rbs
|
65
67
|
homepage: https://github.com/KiTTeNqz/RubyLabs
|
File without changes
|
File without changes
|
File without changes
|