DreamTeam 1.1.1 → 1.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70d3529f28bfd1526d0462464e1d226fbe5918ae2bc085c05f0f30a6877d4a8c
4
- data.tar.gz: ddad9e23656a427c4fa244753e56c72bfcc186ffc78ac4f5cff22fd5b3d05127
3
+ metadata.gz: 64bafae4f5a1fa985a11383aefd23db487ace737778c80eddca2f793f8b8e4e4
4
+ data.tar.gz: 96275674eddc2d07f578e2a1edb238d37ef14d59e449774e877f741ab58a6737
5
5
  SHA512:
6
- metadata.gz: ee6e7f134ecd9e80d7e653481df35e49c4dd8a91021ec70c45a47a2682cd2f5ab6cb19332330d1253ba55c53c90f9e0c516c9b3e7eb09eb422dc097c0f69c239
7
- data.tar.gz: d4483357b8f976cf5f4b6c9d5477d9b7e10f5d96fb93e38f16f3cd82b2417af918f9519719232b7b404fea11513d15125aa3889dff9414ad726f6fdc5b9e5132
6
+ metadata.gz: 9daffef2ff236184c7291b06c1e60788c3ff42783b5cd08a731990feb5fb4e27e52a44217823e743e11058196d76c23f651c6f4a0d08d612b99f0100f627dd0f
7
+ data.tar.gz: 53f74db1e74519e9c693306892cdb2a48b336e8a68eb9063581ebd39ae552bdf644de45a56c3152e19ae98876b370bc378b59b2dfe407b6195a687804fd33c36
@@ -0,0 +1,82 @@
1
+ <html>
2
+ <head>
3
+ <title>Films</title>
4
+ </head>
5
+ <style type='text/css'>
6
+ .table {
7
+ font-family:Sans-Serif;
8
+ font-size: 16px;
9
+ width: 100%;
10
+ text-align: center;
11
+ border: none;
12
+ background: #f1f0f0;
13
+ margin: 10px;
14
+ }
15
+
16
+ .table thead th {
17
+ color: #035749;
18
+ border-bottom: 2px solid #207968;
19
+ border-right: none;
20
+ padding: 7px 17px;
21
+ }
22
+
23
+ .table tbody th {
24
+ color: #207968;
25
+ border-bottom: 2px solid #d7ded9;
26
+ border-right: 2px solid #d7ded9;
27
+ padding: 7px 17px;
28
+ }
29
+
30
+ .table tbody tr td:hover td {
31
+ text-decoration: underline;
32
+ }
33
+ </style>
34
+
35
+ <table class='table'>
36
+ <thead>
37
+ <tr>
38
+ <th>Rang</th>
39
+ <th>Film name</th>
40
+ <th>Full name</th>
41
+ <th>Year</th>
42
+ <th>Image</th>
43
+ <th>The actors</th>
44
+ <th>Rating</th>
45
+ <th>Rating Count</th>
46
+ </tr>
47
+ </thead>
48
+ <tbody>
49
+ <% @films_information.each do |film| %>
50
+ <tr>
51
+ <th>
52
+ <%= film.rank%>
53
+ </th>
54
+ <th>
55
+ <%= film.title%>
56
+ </th>
57
+ <th>
58
+ <%= film.title_full%>
59
+ </th>
60
+ <th>
61
+ <%= film.year%>
62
+ </th>
63
+ <th>
64
+ <img src='<%= film.image %>'
65
+ width = '102'
66
+ height = '160'
67
+ alt = 'Picture of the film'>
68
+ </th>
69
+ <th>
70
+ <%= film.crew%>
71
+ </th>
72
+ <th>
73
+ <%= film.imDbRating%>
74
+ </th>
75
+ <th>
76
+ <%= film.imDbRatingCount%>
77
+ </th>
78
+ </tr>
79
+ <% end %>
80
+ </tbody>
81
+ </table>
82
+ </html>
@@ -1,78 +1,12 @@
1
1
  require_relative 'parsing_films'
2
-
2
+ require 'erb'
3
3
  def create_table_with_film(path)
4
- fileHtml = File.new(path + "/table_film.html", "w+")
5
-
6
- fileHtml.puts "<style>
7
- .table_dark {
8
- font-family: 'Lucida Sans Unicode', 'Lucida Grande', Sans-Serif;
9
- font-size: 14px;
10
- width: 100%;
11
- text-align: left;
12
- border-collapse: collapse;
13
- background: #252F48;
14
- margin: 10px;
15
- }
16
- .table_dark th {
17
- color: #EDB749;
18
- border-bottom: 1px solid #37B5A5;
19
- padding: 12px 17px;
20
- }
21
- .table_dark td {
22
- color: #CAD4D6;
23
- border-bottom: 1px solid #37B5A5;
24
- border-right: 1px solid #37B5A5;
25
- padding: 7px 17px;
26
- }
27
- .table_dark tr:last-child td {
28
- border-bottom: none;
29
- }
30
- .table_dark td:last-child {
31
- border-right: none;
32
- }
33
- .table_dark tr:hover td {
34
- text-decoration: underline;
35
- } </style>
36
-
37
- <table class='table_dark'>
38
- <tr>
39
- <th>Rang</th>
40
- <th>Film name</th>
41
- <th>Full name</th>
42
- <th>Year</th>
43
- <th>Image</th>
44
- <th>The actors</th>
45
- <th>Rating</th>
46
- <th>Rating Count</th>
47
-
48
- </tr>"
49
-
4
+ erd_str = File.read('lib/DreamTeam/Films/films_page.html.erb')
50
5
  filmsInformation = get_all_films(get_films_id())
51
- filmsInformation.each do |elem|
52
- fileHtml.puts "<tr>"
53
- fileHtml.puts "<th>"
54
- fileHtml.puts elem.rank
55
- fileHtml.puts "<th>"
56
- fileHtml.puts elem.title
57
- fileHtml.puts "<th>"
58
- fileHtml.puts elem.title_full
59
- fileHtml.puts "<th>"
60
- fileHtml.puts elem.year
61
- fileHtml.puts "<th>"
62
- fileHtml.puts "<img src = '#{elem.image}'
63
- width = '102'
64
- height = '160'>"
65
- fileHtml.puts "<th>"
66
- fileHtml.puts elem.crew
67
- fileHtml.puts "<th>"
68
- fileHtml.puts elem.imDbRating
69
- fileHtml.puts "<th>"
70
- fileHtml.puts elem.imDbRatingCount
71
- fileHtml.puts "<th>"
72
-
73
- fileHtml.puts "</tr>"
74
- end
75
-
76
- fileHtml.puts "</table>"
77
- fileHtml.close
6
+ @films_information = filmsInformation
7
+ renderer = ERB.new(erd_str)
8
+ result = renderer.result(binding)
9
+ File.open(path + "/table_film.html", 'w') do |f|
10
+ f.write(result)
11
+ end
78
12
  end
@@ -0,0 +1,128 @@
1
+ <html>
2
+ <head>
3
+ <title>Games</title>
4
+ </head>
5
+ <style type='text/css'>
6
+ .table {
7
+ width: 100%;
8
+ border: none;
9
+ margin-bottom: 20px;
10
+ }
11
+
12
+ .table thead th {
13
+ font-weight: bold;
14
+ text-align: left;
15
+ border: none;
16
+ padding: 10px 15px;
17
+ background: #d8d8d8;
18
+ font-size: 14px;
19
+ }
20
+
21
+ .table thead tr th:first-child {
22
+ border-radius: 8px 0 0 8px;
23
+ }
24
+
25
+ .table thead tr th:last-child {
26
+ border-radius: 0 8px 8px 0;
27
+ }
28
+
29
+ .table tbody td {
30
+ text-align: left;
31
+ border: none;
32
+ padding: 10px 15px;
33
+ font-size: 14px;
34
+ vertical-align: top;
35
+ }
36
+
37
+ .table tbody tr:nth-child(even) {
38
+ background: #f3f3f3;
39
+ }
40
+
41
+ .table tbody tr td:first-child {
42
+ border-radius: 8px 0 0 8px;
43
+ }
44
+
45
+ .table tbody tr td:last-child {
46
+ border-radius: 0 8px 8px 0;
47
+ }
48
+ </style>
49
+
50
+ <table class='table'>
51
+ <thead>
52
+ <img src='<%= @avatar %>' alt="User avatar">
53
+ <%= @username %>
54
+ <tr>
55
+ <th>Game</th>
56
+ <th>Image</th>
57
+ <th>Price</th>
58
+ <th>Developers</th>
59
+ <th>Date</th>
60
+ <th>Description</th>
61
+ <th>Recommendation</th>
62
+ <th>Time In The Game</th>
63
+ </tr>
64
+ </thead>
65
+ <tbody>
66
+ <% @games_information.each do |game| %>
67
+ <tr>
68
+ <th>
69
+ <% if game[:name].nil? %>
70
+ <span style = 'font-size:20pt'> - </span>
71
+ <% else %>
72
+ <%= game[:name] %>
73
+ <% end %>
74
+ </th>
75
+ <th>
76
+ <img src='<%= game[:img] %>'
77
+ width = '220'
78
+ height = '102'
79
+ alt = 'Picture of the game'>
80
+ </th>
81
+ <th>
82
+ <% if game[:price].nil? %>
83
+ <span style = 'font-size:20pt'> - </span>
84
+ <% else %>
85
+ <%= game[:price] %>
86
+ <% end %>
87
+ </th>
88
+ <th>
89
+ <% if game[:developers].nil? %>
90
+ <span style = 'font-size:20pt'> - </span>
91
+ <% else %>
92
+ <%= game[:developers] %>
93
+ <% end %>
94
+ </th>
95
+ <th>
96
+ <% if game[:date].nil? %>
97
+ <span style = 'font-size:20pt'> - </span>
98
+ <% else %>
99
+ <%= game[:date] %>
100
+ <% end %>
101
+ </th>
102
+ <th>
103
+ <% if game[:desc].nil? %>
104
+ <span style = 'font-size:20pt'> - </span>
105
+ <% else %>
106
+ <%= game[:desc] %>
107
+ <% end %>
108
+ </th>
109
+ <th>
110
+ <% if game[:recommendations].nil? %>
111
+ <span style = 'font-size:20pt'> - </span>
112
+ <% else %>
113
+ <%= game[:recommendations] %>
114
+ <% end %>
115
+ </th>
116
+ <th>
117
+ <% if game[:time] == 0 %>
118
+ 0
119
+ <% else %>
120
+ <%= game[:time].to_i / 60 %>h
121
+ <%= -(game[:time].to_i / 60 * 60 - game[:time].to_i) %>min
122
+ <% end %>
123
+ </th>
124
+ </tr>
125
+ <% end %>
126
+ </tbody>
127
+ </table>
128
+ </html>
@@ -0,0 +1,19 @@
1
+ require_relative "parsing_games"
2
+ require 'erb'
3
+
4
+ def create_table_with_user_games(path, steam_id)
5
+ erb_str = File.read('lib/DreamTeam/Games/games_page.html.erb')
6
+
7
+ user_info = get_user_information(steam_id)
8
+ games_information = information_of_games(get_user_games(steam_id))
9
+
10
+ @avatar = user_info[:avatar]
11
+ @username = user_info[:username]
12
+ @games_information = games_information
13
+ renderer = ERB.new(erb_str)
14
+ result = renderer.result(binding)
15
+
16
+ File.open(path + "/table_game.html", 'w') do |f|
17
+ f.write(result)
18
+ end
19
+ end
@@ -61,4 +61,4 @@ def information_of_games(games_id)
61
61
  recommendations: recommendations, desc: desc, img: img })
62
62
  end
63
63
  res
64
- end
64
+ end
@@ -0,0 +1,26 @@
1
+ <html>
2
+ <head>
3
+ <title>Main</title>
4
+ <style>
5
+ div {
6
+ width: 100%;
7
+ outline: 0;
8
+ border: 0;
9
+ }
10
+
11
+ div2 {
12
+ border-radius: 30%;
13
+ }
14
+ </style>
15
+ </head>
16
+ <body>
17
+ <div>
18
+ <p border='0'>
19
+ <div2>
20
+ <a href='<%= @path + '/table_game.html'%>'><img src='https://raw.githubusercontent.com/Spoky-Loki/DreamTeam/master/images/logo1.png' width=45% border='0' alt=''></a>
21
+ <a href='<%= @path + '/table_film.html'%>'><img src='https://raw.githubusercontent.com/Spoky-Loki/DreamTeam/master/images/logo2.png' width=45% border='0' alt=''></a>
22
+ </div2>
23
+ </p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DreamTeam
4
- VERSION = "1.1.1"
4
+ VERSION = "1.1.2"
5
5
  end
data/lib/DreamTeam.rb CHANGED
@@ -4,7 +4,9 @@ require_relative "DreamTeam/version"
4
4
 
5
5
  module DreamTeam
6
6
  class Error < StandardError; end
7
- require_relative "DreamTeam/html_main"
7
+ require_relative "DreamTeam/Games/html_games_table"
8
+ require_relative "DreamTeam/Games/parsing_games"
9
+ require_relative "DreamTeam/Films/html_films_table"
10
+ require_relative "DreamTeam/Films/parsing_films"
11
+ require_relative "DreamTeam/html_main"
8
12
  end
9
-
10
- #DreamTeam::Html_main::Html_main_page.create_main("C:/ЮФУ", "76561198271666506")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: DreamTeam
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spooky_Loki
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2022-10-28 00:00:00.000000000 Z
14
+ date: 2022-10-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake
@@ -103,10 +103,14 @@ files:
103
103
  - images/logo1.png
104
104
  - images/logo2.png
105
105
  - lib/DreamTeam.rb
106
+ - lib/DreamTeam/Films/films_page.html.erb
106
107
  - lib/DreamTeam/Films/html_films_table.rb
107
108
  - lib/DreamTeam/Films/parsing_films.rb
109
+ - lib/DreamTeam/Games/games_page.html.erb
110
+ - lib/DreamTeam/Games/html_games_table.rb
108
111
  - lib/DreamTeam/Games/parsing_games.rb
109
112
  - lib/DreamTeam/html_main.rb
113
+ - lib/DreamTeam/main_page.html.erb
110
114
  - lib/DreamTeam/version.rb
111
115
  - sig/DreamTeam.rbs
112
116
  homepage: https://github.com/Spoky-Loki/DreamTeam