student_mvp 0.1.0
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 +7 -0
- data/README.md +35 -0
- data/Rakefile +4 -0
- data/doc/Add_student_presenter.html +238 -0
- data/doc/App_logger.html +386 -0
- data/doc/Base_presenter.html +265 -0
- data/doc/Binary_tree.html +300 -0
- data/doc/Binary_tree_iterator.html +217 -0
- data/doc/Contact_sort_decorator.html +219 -0
- data/doc/DB_client.html +252 -0
- data/doc/Data_list.html +625 -0
- data/doc/Data_list_student_short.html +148 -0
- data/doc/Data_storage_strategy.html +178 -0
- data/doc/Data_table.html +264 -0
- data/doc/Deep_dup.html +152 -0
- data/doc/Edit_contacts_presenter.html +199 -0
- data/doc/Edit_git_presenter.html +192 -0
- data/doc/Edit_student_presenter.html +464 -0
- data/doc/Field_filter_decorator.html +219 -0
- data/doc/Filter.html +148 -0
- data/doc/Filter_decorator.html +209 -0
- data/doc/Full_name_filter_decorator.html +211 -0
- data/doc/Full_name_sort_decorator.html +217 -0
- data/doc/Gemfile.html +98 -0
- data/doc/Git_sort_decorator.html +220 -0
- data/doc/Has_not_field_filter_decorator.html +209 -0
- data/doc/JSON_storage_strategy.html +183 -0
- data/doc/Person.html +511 -0
- data/doc/README_md.html +147 -0
- data/doc/Rakefile.html +94 -0
- data/doc/Replace_student_presenter.html +204 -0
- data/doc/Sort_decorator.html +214 -0
- data/doc/Student.html +755 -0
- data/doc/StudentMvp/Error.html +105 -0
- data/doc/StudentMvp.html +111 -0
- data/doc/Student_list_presenter.html +667 -0
- data/doc/Student_short.html +398 -0
- data/doc/Students_list.html +341 -0
- data/doc/Students_list_DB.html +361 -0
- data/doc/Students_list_file.html +460 -0
- data/doc/Students_list_file_adapter.html +341 -0
- data/doc/Students_list_interface.html +298 -0
- data/doc/YAML_storage_strategy.html +183 -0
- data/doc/bin/setup.html +96 -0
- data/doc/created.rid +44 -0
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +662 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +174 -0
- data/doc/js/darkfish.js +114 -0
- data/doc/js/navigation.js +105 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +110 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +229 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +1047 -0
- data/lib/data_access/DB_client/DB_client.rb +26 -0
- data/lib/deep_dup/deep_dup.rb +14 -0
- data/lib/logger/logger.rb +64 -0
- data/lib/models/binary_tree/binary_tree.rb +163 -0
- data/lib/models/binary_tree/binary_tree_iterator.rb +36 -0
- data/lib/models/data_list/data_list.rb +97 -0
- data/lib/models/data_list/data_list_student_short.rb +16 -0
- data/lib/models/data_storage_strategy/JSON_storage_strategy.rb +20 -0
- data/lib/models/data_storage_strategy/YAML_storage_strategy.rb +20 -0
- data/lib/models/data_storage_strategy/data_storage_strategy.rb +11 -0
- data/lib/models/data_table/data_table.rb +52 -0
- data/lib/models/filter/filter.rb +5 -0
- data/lib/models/filter/filter_decorator.rb +14 -0
- data/lib/models/filter/sort_decorator.rb +15 -0
- data/lib/models/filter/student_filters/contact_sort_decorator.rb +50 -0
- data/lib/models/filter/student_filters/field_filter_decorator.rb +34 -0
- data/lib/models/filter/student_filters/full_name_filter_decorator.rb +26 -0
- data/lib/models/filter/student_filters/full_name_sort_decorator.rb +32 -0
- data/lib/models/filter/student_filters/git_sort_decorator.rb +35 -0
- data/lib/models/filter/student_filters/has_not_field_filter_decorator.rb +24 -0
- data/lib/models/person/person.rb +72 -0
- data/lib/models/student/student.rb +204 -0
- data/lib/models/student_short/student_short.rb +98 -0
- data/lib/models/students_list/students_list.rb +32 -0
- data/lib/models/students_list/students_list_DB.rb +95 -0
- data/lib/models/students_list/students_list_file.rb +134 -0
- data/lib/models/students_list/students_list_file_adapter.rb +45 -0
- data/lib/models/students_list/students_list_interface.rb +25 -0
- data/lib/presenters/base_presenters/base_presenter.rb +26 -0
- data/lib/presenters/base_presenters/student_list_presenter.rb +273 -0
- data/lib/presenters/edit_student/add_student_presenter.rb +46 -0
- data/lib/presenters/edit_student/edit_contacts_presenter.rb +36 -0
- data/lib/presenters/edit_student/edit_git_presenter.rb +28 -0
- data/lib/presenters/edit_student/edit_student_presenter.rb +109 -0
- data/lib/presenters/edit_student/replace_student_presenter.rb +37 -0
- data/lib/student_mvp/version.rb +5 -0
- data/lib/student_mvp.rb +8 -0
- data/sig/student_mvp.rbs +4 -0
- metadata +253 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5e9741f6f58fb03f513de9eb3ba87b345f154faeee4968e72c339edbfdfa3ae3
|
4
|
+
data.tar.gz: d4ff62f9db985bb714f0aa4f283ffac007cc78eb0a24e504aa59a1145d952a66
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 86f25f04e4a20f466e9bebb9251a1b275afc3b5fc8fed250b3ac2e966dd7aeec6a247eda12f99406ddb57341960ff8c2824dfa4d5ddc01e7e50a27f533eb93ef
|
7
|
+
data.tar.gz: 8c8a5fd8e9b52d20bb91de275a9bfc7961548a3417ad1c2a678ba2ef47aea51a9f56ddbae1b66873a9905aaffde2e3e5b0e4dd297f6b11467a80e48140b1852f
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# StudentMvp
|
2
|
+
|
3
|
+
TODO: Delete this and the text below, and describe your gem
|
4
|
+
|
5
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/student_mvp`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
10
|
+
|
11
|
+
Install the gem and add to the application's Gemfile by executing:
|
12
|
+
|
13
|
+
```bash
|
14
|
+
bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
|
15
|
+
```
|
16
|
+
|
17
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
18
|
+
|
19
|
+
```bash
|
20
|
+
gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
|
21
|
+
```
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/student_mvp.
|
data/Rakefile
ADDED
@@ -0,0 +1,238 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
7
|
+
|
8
|
+
<title>class Add_student_presenter - RDoc Documentation</title>
|
9
|
+
|
10
|
+
<meta name="keywords" content="ruby,class,Add_student_presenter">
|
11
|
+
|
12
|
+
<meta name="description" content="class Add_student_presenter: Add_student_presenter Презентер для добавления нового студента.">
|
13
|
+
|
14
|
+
<script type="text/javascript">
|
15
|
+
var rdoc_rel_prefix = "./";
|
16
|
+
var index_rel_prefix = "./";
|
17
|
+
</script>
|
18
|
+
|
19
|
+
<script src="./js/navigation.js" defer></script>
|
20
|
+
<script src="./js/search.js" defer></script>
|
21
|
+
<script src="./js/search_index.js" defer></script>
|
22
|
+
<script src="./js/searcher.js" defer></script>
|
23
|
+
<script src="./js/darkfish.js" defer></script>
|
24
|
+
|
25
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
26
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
27
|
+
|
28
|
+
|
29
|
+
<body id="top" role="document" class="class">
|
30
|
+
<div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
|
31
|
+
<span aria-hidden="true">☰</span>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
|
35
|
+
<nav id="navigation" role="navigation">
|
36
|
+
<div id="project-navigation">
|
37
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
38
|
+
<h2>
|
39
|
+
<a href="./index.html" rel="home">Home</a>
|
40
|
+
</h2>
|
41
|
+
|
42
|
+
<div id="table-of-contents-navigation">
|
43
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
44
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
45
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
50
|
+
<form action="#" method="get" accept-charset="utf-8">
|
51
|
+
<div id="search-field-wrapper">
|
52
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
53
|
+
aria-autocomplete="list" aria-controls="search-results"
|
54
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
55
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
56
|
+
</div>
|
57
|
+
|
58
|
+
<ul id="search-results" aria-label="Search Results"
|
59
|
+
aria-busy="false" aria-expanded="false"
|
60
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
61
|
+
</form>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
</div>
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
<div id="parent-class-section" class="nav-section">
|
69
|
+
<h3>Ancestors</h3>
|
70
|
+
<ul><li><a href="Edit_student_presenter.html">Edit_student_presenter</a><ul><li>Object</li></ul></li></ul>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
<div class="nav-section">
|
79
|
+
<h3>Instance Methods</h3>
|
80
|
+
<ul class="link-list" role="directory">
|
81
|
+
<li ><a href="#method-i-operation">operation</a></li>
|
82
|
+
<li ><a href="#method-i-populate_fields">populate_fields</a></li>
|
83
|
+
<li class="calls-super" ><a href="#method-i-valid_data-3F">valid_data?</a></li>
|
84
|
+
</ul>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<footer id="validator-badges" role="contentinfo">
|
90
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
91
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.8.1.
|
92
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
93
|
+
</footer>
|
94
|
+
|
95
|
+
</nav>
|
96
|
+
|
97
|
+
<main role="main" aria-labelledby="class-Add_student_presenter">
|
98
|
+
<h1 id="class-Add_student_presenter" class="anchor-link class">
|
99
|
+
class Add_student_presenter
|
100
|
+
</h1>
|
101
|
+
|
102
|
+
<section class="description">
|
103
|
+
|
104
|
+
<h2 id="class-Add_student_presenter-label-Add_student_presenter"><a href="Add_student_presenter.html"><code>Add_student_presenter</code></a><span><a href="#class-Add_student_presenter-label-Add_student_presenter">¶</a> <a href="#top">↑</a></span></h2>
|
105
|
+
|
106
|
+
<p>Презентер для добавления нового студента.</p>
|
107
|
+
|
108
|
+
</section>
|
109
|
+
|
110
|
+
<section id="5Buntitled-5D" class="documentation-section anchor-link">
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section anchor-link">
|
117
|
+
<header>
|
118
|
+
<h3>Public Instance Methods</h3>
|
119
|
+
</header>
|
120
|
+
|
121
|
+
<div id="method-i-operation" class="method-detail anchor-link ">
|
122
|
+
<div class="method-header">
|
123
|
+
<div class="method-heading">
|
124
|
+
<a href="#method-i-operation" title="Link to this method">
|
125
|
+
<span class="method-name">operation</span>
|
126
|
+
<span class="method-args">(student_data)</span>
|
127
|
+
</a>
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<div class="method-controls">
|
132
|
+
<details class="method-source-toggle">
|
133
|
+
<summary>Source</summary>
|
134
|
+
</details>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div class="method-description">
|
138
|
+
<div class="method-source-code" id="operation-source">
|
139
|
+
<pre><span class="ruby-comment"># File lib/presenters/edit_student/add_student_presenter.rb, line 12</span>
|
140
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">operation</span>(<span class="ruby-identifier">student_data</span>)
|
141
|
+
<span class="ruby-keyword">begin</span>
|
142
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">"Создание объекта студента: #{student_data.to_s}"</span>
|
143
|
+
<span class="ruby-identifier">new_student</span>(<span class="ruby-identifier">student_data</span>)
|
144
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">parent_presenter</span>.<span class="ruby-identifier">add_student</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">student</span>)
|
145
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">view</span>.<span class="ruby-identifier">close</span>
|
146
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-operator">=></span> <span class="ruby-identifier">e</span>
|
147
|
+
<span class="ruby-identifier">error_msg</span> = <span class="ruby-node">"Ошибка при добавлении студента: #{e.message}"</span>
|
148
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">error</span> <span class="ruby-identifier">error_msg</span>
|
149
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">view</span>.<span class="ruby-identifier">show_error_message</span>(<span class="ruby-identifier">error_msg</span>)
|
150
|
+
<span class="ruby-keyword">end</span>
|
151
|
+
<span class="ruby-keyword">end</span></pre>
|
152
|
+
</div>
|
153
|
+
<p>Операция добавления нового студента.</p>
|
154
|
+
|
155
|
+
<p>@param student_data [Hash] Данные студента.</p>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
|
159
|
+
</div>
|
160
|
+
|
161
|
+
<div id="method-i-populate_fields" class="method-detail anchor-link ">
|
162
|
+
<div class="method-header">
|
163
|
+
<div class="method-heading">
|
164
|
+
<a href="#method-i-populate_fields" title="Link to this method">
|
165
|
+
<span class="method-name">populate_fields</span>
|
166
|
+
<span class="method-args">()</span>
|
167
|
+
</a>
|
168
|
+
</div>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
<div class="method-controls">
|
172
|
+
<details class="method-source-toggle">
|
173
|
+
<summary>Source</summary>
|
174
|
+
</details>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<div class="method-description">
|
178
|
+
<div class="method-source-code" id="populate_fields-source">
|
179
|
+
<pre><span class="ruby-comment"># File lib/presenters/edit_student/add_student_presenter.rb, line 26</span>
|
180
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">populate_fields</span>
|
181
|
+
<span class="ruby-identifier">data</span> = {
|
182
|
+
<span class="ruby-string">"first_name"</span> <span class="ruby-operator">=></span> <span class="ruby-string">""</span>,
|
183
|
+
<span class="ruby-string">"name"</span> <span class="ruby-operator">=></span> <span class="ruby-string">""</span>,
|
184
|
+
<span class="ruby-string">"patronymic"</span> <span class="ruby-operator">=></span> <span class="ruby-string">""</span>,
|
185
|
+
<span class="ruby-string">"birthdate"</span> <span class="ruby-operator">=></span> <span class="ruby-string">""</span>,
|
186
|
+
}
|
187
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">view</span>.<span class="ruby-identifier">update_view</span> <span class="ruby-identifier">data</span>
|
188
|
+
<span class="ruby-keyword">end</span></pre>
|
189
|
+
</div>
|
190
|
+
<p>Заполнение полей интерфейса пустыми данными для нового студента.</p>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
|
194
|
+
</div>
|
195
|
+
|
196
|
+
<div id="method-i-valid_data-3F" class="method-detail anchor-link ">
|
197
|
+
<div class="method-header">
|
198
|
+
<div class="method-heading">
|
199
|
+
<a href="#method-i-valid_data-3F" title="Link to this method">
|
200
|
+
<span class="method-name">valid_data?</span>
|
201
|
+
<span class="method-args">(student_data)</span>
|
202
|
+
</a>
|
203
|
+
</div>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<div class="method-controls">
|
207
|
+
<details class="method-source-toggle">
|
208
|
+
<summary>Source</summary>
|
209
|
+
</details>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
<div class="method-description">
|
213
|
+
<div class="method-source-code" id="valid_data-3F-source">
|
214
|
+
<pre><span class="ruby-comment"># File lib/presenters/edit_student/add_student_presenter.rb, line 40</span>
|
215
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">valid_data?</span>(<span class="ruby-identifier">student_data</span>)
|
216
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">"Проверка валидности данных: #{student_data.to_s}"</span>
|
217
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-keyword">super</span>(<span class="ruby-identifier">student_data</span>)
|
218
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">"Валидность данных: #{res}"</span>
|
219
|
+
<span class="ruby-identifier">res</span>
|
220
|
+
<span class="ruby-keyword">end</span></pre>
|
221
|
+
</div>
|
222
|
+
<p>Проверка валидности данных студента при добавлении.</p>
|
223
|
+
|
224
|
+
<p>@param student_data [Hash] Данные студента. @return [Boolean] Возвращает true, если данные валидны.</p>
|
225
|
+
<div class="method-calls-super">
|
226
|
+
Calls superclass method
|
227
|
+
<a href="Edit_student_presenter.html#method-i-valid_data-3F"><code>Edit_student_presenter#valid_data?</code></a>
|
228
|
+
</div>
|
229
|
+
</div>
|
230
|
+
|
231
|
+
|
232
|
+
</div>
|
233
|
+
|
234
|
+
</section>
|
235
|
+
|
236
|
+
</section>
|
237
|
+
</main>
|
238
|
+
|