logy 0.4.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5040fc1fecddd7103bc776c680c70bd6c35205c92af3c05d388bec24c37e67f8
4
+ data.tar.gz: '00640871a86385e27bd4462d97f78e307fdee71ec408a25a74e29cbd721bd810'
5
+ SHA512:
6
+ metadata.gz: b37baba50d6d1d44b3737ace696adc8dd51b235a7c5c47f6b7fa2e3ecb40dcbfbb95d53518dd99d918c96adf3ff700abd892480170a8b41c949fbc4ae9bc40b1
7
+ data.tar.gz: 37e2678716d1ac60086a50d39b32c1c70254ecf0e398a1591fc7422b2b4b403602834cfe4992fbec88c2deec9a19662079d19ab06e8b41812d73d4d4744ea627
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2021 Aleksandr Balakiriev
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # Logy
2
+ Mountable Rails Engine for viewing paginated logs from a browser
3
+
4
+ ## Installation
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem 'logy'
9
+ ```
10
+
11
+ And then execute:
12
+ ```bash
13
+ $ bundle
14
+ ```
15
+
16
+ Mount Engine:
17
+
18
+ `config/routes.rb`
19
+ ```ruby
20
+ Rails.application.routes.draw do
21
+ mount Logy::Engine => '/logy'
22
+ end
23
+ ```
24
+
25
+ Look up on `/logy` route.
26
+
27
+ ## License
28
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,29 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Logy'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+ load 'rails/tasks/statistics.rake'
20
+ require 'bundler/gem_tasks'
21
+ require 'rake/testtask'
22
+
23
+ Rake::TestTask.new(:test) do |t|
24
+ t.libs << 'spec'
25
+ t.pattern = 'spec/**/*_spec.rb'
26
+ t.verbose = false
27
+ end
28
+
29
+ task default: :test
@@ -0,0 +1,2 @@
1
+ //= link_directory ../javascripts/logy .js
2
+ //= link_directory ../stylesheets/logy .css
@@ -0,0 +1 @@
1
+ //= require_tree .
@@ -0,0 +1,5 @@
1
+ /*
2
+ *= require wind
3
+ *= require_tree .
4
+ *= require_self
5
+ */
@@ -0,0 +1,25 @@
1
+ body {
2
+ padding: 10px 50px 50px 50px;
3
+ }
4
+
5
+ .nav--inline {
6
+ display: inline-flex;
7
+ }
8
+
9
+ .all-pages {
10
+ margin-top: 17px;
11
+ }
12
+
13
+ @media (max-width: 1024px) {
14
+ .nav-logo p {
15
+ font-size: 30px;
16
+ }
17
+
18
+ .nav h5 {
19
+ font-size: 60px;
20
+ }
21
+
22
+ .nav-pagination {
23
+ font-size: 32px;
24
+ }
25
+ }
@@ -0,0 +1,5 @@
1
+ module Logy
2
+ class ApplicationController < ActionController::Base
3
+ protect_from_forgery with: :exception
4
+ end
5
+ end
@@ -0,0 +1,23 @@
1
+ require 'active_support/concern'
2
+
3
+ module Logy
4
+ module Concerns
5
+ module LogyLoader
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+ before_action :load_logs
10
+ before_action :load_logs_list
11
+
12
+ def load_logs
13
+ file_name = params[:name] || Rails.env
14
+ @logs = Logy::Viewer.call(file_name).read
15
+ end
16
+
17
+ def load_logs_list
18
+ @log_files = Logy::LogFiles.all
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,33 @@
1
+ require 'active_support/concern'
2
+
3
+ module Logy
4
+ module Concerns
5
+ module Pagination
6
+ extend ActiveSupport::Concern
7
+
8
+ PER_PAGE = 50
9
+ PAGE = 1
10
+
11
+ included do
12
+ before_action :rendered_logs
13
+
14
+ def rendered_logs
15
+ @per_page = (params[:per_page] || PER_PAGE).to_i
16
+ @page = (params[:page] || PAGE).to_i
17
+ file_name = params[:name] || Rails.env
18
+
19
+ range = (@page - 1) * @per_page..@per_page * @page - 1
20
+
21
+ @rendered_logs = Logy::Viewer.call(file_name).readlines[range].join
22
+
23
+ @pages = calculate_pages.to_i
24
+ end
25
+
26
+ def calculate_pages
27
+ float_count = @logs.each_line.count.to_f / @per_page.to_f
28
+ float_count != float_count.round ? float_count + 1 : float_count
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,12 @@
1
+ require_dependency 'logy/application_controller'
2
+
3
+ module Logy
4
+ class LogyController < ApplicationController
5
+ include Logy::Concerns::LogyLoader
6
+ include Logy::Concerns::Pagination
7
+
8
+ def index; end
9
+
10
+ def show; end
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ module Logy
2
+ module ApplicationHelper
3
+ def log_file
4
+ (params[:name] || Rails.env) + '.log'
5
+ end
6
+
7
+ def log_file_path(log_name)
8
+ root_path + log_name
9
+ end
10
+
11
+ def lines(file)
12
+ file.each_line.count.to_s
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,21 @@
1
+ module Logy
2
+ module NavPaginationHelper
3
+ def pages_range
4
+ if first_range.include? @page
5
+ @pages.times.map { |i| i + 1 }[first_range]
6
+ elsif last_range.include? @page
7
+ (@pages + 1).times.map { |i| i }[last_range]
8
+ else
9
+ (@pages).times.map { |i| i }[@page - 1..@page + 8]
10
+ end
11
+ end
12
+
13
+ def last_range
14
+ @pages - 9..@pages
15
+ end
16
+
17
+ def first_range
18
+ 0..9
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,8 @@
1
+ module Logy
2
+ class LogFiles
3
+ def self.all
4
+ files = ::FileList.new("#{Logy::Viewer::LOG_PATH}/*")
5
+ files.map { |f| f.split("#{Logy::Viewer::LOG_PATH}/")[1] }
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ module Logy
2
+ class Viewer
3
+ LOG_PATH = "#{Rails.application.config.logs_path}/"
4
+
5
+ def self.call(file_name)
6
+ File.open(LOG_PATH + (file_name + '.log'))
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta/>
5
+ <title>Logy</title>
6
+ <%= stylesheet_link_tag "logy/application", media: "all" %>
7
+ <%= javascript_include_tag "logy/application" %>
8
+ <%= csrf_meta_tags %>
9
+ </head>
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= render 'shared/layout' %>
@@ -0,0 +1 @@
1
+ <%= render 'shared/layout' %>
@@ -0,0 +1,13 @@
1
+ <div class="nav">
2
+ <h5 class="nav-logo">
3
+ <%= I18n.t('logy.log_file') + log_file %>
4
+ </h5>
5
+ <div class="nav-logo">
6
+ <p>
7
+ <%= I18n.t('logy.lines') + lines(@logs) %>
8
+ </p>
9
+ <p>
10
+ <%= I18n.t('logy.pages') + @pages.to_s %>
11
+ </p>
12
+ </div>
13
+ </div>
@@ -0,0 +1,7 @@
1
+ <%= render 'shared/header' %>
2
+ <div class="row nav-pagination">
3
+ <%= render 'shared/navbar' %>
4
+ <%= render 'shared/nav_pagination' %>
5
+ </div>
6
+ <%= render 'shared/logs' %>
7
+ <%= render 'shared/pagination' %>
@@ -0,0 +1,7 @@
1
+ <div>
2
+ <% @rendered_logs.each_line do |log_line| %>
3
+ <div>
4
+ <%= log_line %>
5
+ </div>
6
+ <% end %>
7
+ </div>
@@ -0,0 +1,21 @@
1
+ <div class="nav nav--inline">
2
+ <% if @page >= 10 %>
3
+ <div class="nav-item">
4
+ <%= link_to I18n.t('logy.first'), log_file_path(log_file) %>
5
+ </div>
6
+ <% end %>
7
+ <% pages_range.each do |page| %>
8
+ <div class="nav-item">
9
+ <% if page != @page %>
10
+ <%= link_to page, log_file_path(log_file) + "?page=#{page}" %>
11
+ <% else %>
12
+ <%= page %>
13
+ <% end %>
14
+ </div>
15
+ <% end %>
16
+ <% if last_range != (pages_range[0]..pages_range.last) && @pages > 10 %>
17
+ <div class="nav-item">
18
+ <%= link_to I18n.t('logy.last'), log_file_path(log_file) + "?page=#{@pages}" %>
19
+ </div>
20
+ <% end %>
21
+ </div>
@@ -0,0 +1,5 @@
1
+ <div class="nav">
2
+ <% @log_files.each do |log_file| %>
3
+ <%= link_to log_file, log_file_path(log_file), class: 'nav-item' %>
4
+ <% end %>
5
+ </div>
@@ -0,0 +1,11 @@
1
+ <div class="row all-pages">
2
+ <h6>
3
+ <%= I18n.t('logy.all_pages') %>
4
+ </h6>
5
+ </div>
6
+ <div>
7
+ <% @pages.times do |i| %>
8
+ <% page = i + 1 %>
9
+ <%= link_to page, log_file_path(log_file) + "?page=#{page}" %>
10
+ <% end %>
11
+ </div>
@@ -0,0 +1 @@
1
+ <%= render 'shared/layout' %>
@@ -0,0 +1 @@
1
+ <%= render 'shared/layout' %>
@@ -0,0 +1,8 @@
1
+ en:
2
+ logy:
3
+ log_file: 'Log file: '
4
+ lines: 'Lines: '
5
+ pages: 'Pages: '
6
+ last: 'last »'
7
+ first: '« first'
8
+ all_pages: 'All pages: '
data/config/routes.rb ADDED
@@ -0,0 +1,7 @@
1
+ Logy::Engine.routes.draw do
2
+ root 'logy#index'
3
+
4
+ get ':name', to: 'logy#show'
5
+
6
+ resources :logy, only: %i[index show]
7
+ end
data/lib/logy.rb ADDED
@@ -0,0 +1 @@
1
+ require 'logy/engine'
@@ -0,0 +1,23 @@
1
+ module Logy
2
+ class Engine < ::Rails::Engine
3
+ %w[rake].each { |f| require f }
4
+
5
+ isolate_namespace Logy
6
+
7
+ config.to_prepare do
8
+ folders = ['app/services/logy/*', 'app/*/logy/concerns/*']
9
+ folders.each do |folder|
10
+ Dir.glob(Engine.root + folder).each do |c|
11
+ require_dependency(c)
12
+ end
13
+ end
14
+ end
15
+
16
+ config.generators do |g|
17
+ g.test_framework :rspec
18
+ g.stylesheets false
19
+ g.javascripts false
20
+ g.template_engine :haml
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,3 @@
1
+ module Logy
2
+ VERSION = '0.4.0'
3
+ end
@@ -0,0 +1,531 @@
1
+ /**
2
+ * Wing v1.0.0-beta
3
+ * Copyright 2016-2017 Kabir Shah
4
+ * Released under the MIT License
5
+ * http://usewing.ml
6
+ */
7
+
8
+ /*=============================
9
+ Base Styles
10
+ =============================*/
11
+ * {
12
+ box-sizing: border-box;
13
+ }
14
+ html,
15
+ body {
16
+ margin: 0;
17
+ padding: 0;
18
+ }
19
+ body {
20
+ line-height: 1.6;
21
+ color: #111;
22
+ font-size: 1rem;
23
+ font-weight: 400;
24
+ font-family: -apple-system, BlinkMacSystemFont, Avenir, "Avenir Next", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
25
+ }
26
+ /*=============================
27
+ Grid
28
+ =============================*/
29
+ .container {
30
+ width: 80%;
31
+ max-width: 960px;
32
+ margin: 0 auto;
33
+ }
34
+ .row {
35
+ display: flex;
36
+ flex-flow: row wrap;
37
+ justify-content: space-between;
38
+ width: 100%;
39
+ margin-bottom: 10px;
40
+ }
41
+ .row:last-child {
42
+ margin-bottom: 0;
43
+ }
44
+ .row .col {
45
+ flex: 1 1 0px;
46
+ }
47
+ .row .col,
48
+ .row [class^="col-"],
49
+ .row [class*=" col-"] {
50
+ padding-right: 10px;
51
+ }
52
+ .row .col:last-child,
53
+ .row [class^="col-"]:last-child,
54
+ .row [class*=" col-"]:last-child {
55
+ padding-right: 0;
56
+ }
57
+ .row .col-1 {
58
+ width: 8.333333333333332%;
59
+ }
60
+ .row .col-2 {
61
+ width: 16.666666666666664%;
62
+ }
63
+ .row .col-3 {
64
+ width: 25%;
65
+ }
66
+ .row .col-4 {
67
+ width: 33.33333333333333%;
68
+ }
69
+ .row .col-5 {
70
+ width: 41.66666666666667%;
71
+ }
72
+ .row .col-6 {
73
+ width: 50%;
74
+ }
75
+ .row .col-7 {
76
+ width: 58.333333333333336%;
77
+ }
78
+ .row .col-8 {
79
+ width: 66.66666666666666%;
80
+ }
81
+ .row .col-9 {
82
+ width: 75%;
83
+ }
84
+ .row .col-10 {
85
+ width: 83.33333333333334%;
86
+ }
87
+ .row .col-11 {
88
+ width: 91.66666666666666%;
89
+ }
90
+ .row .col-12 {
91
+ width: 100%;
92
+ }
93
+ @media screen and (max-width: 768px) {
94
+ .row .col,
95
+ .row [class^='col-'],
96
+ .row [class*=" col-"] {
97
+ flex: 0 0 100%;
98
+ margin-bottom: 10px;
99
+ padding: 0;
100
+ }
101
+ .row .col:last-child,
102
+ .row [class^='col-']:last-child,
103
+ .row [class*=" col-"]:last-child {
104
+ margin-bottom: 0;
105
+ }
106
+ }
107
+ /*=============================
108
+ Typography
109
+ =============================*/
110
+ h1,
111
+ h2,
112
+ h3,
113
+ h4,
114
+ h5,
115
+ h6,
116
+ p {
117
+ margin-top: 0;
118
+ margin-bottom: 10px;
119
+ font-family: -apple-system, BlinkMacSystemFont, Avenir, "Avenir Next", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
120
+ }
121
+ h1,
122
+ h2,
123
+ h3,
124
+ h4,
125
+ h5,
126
+ h6 {
127
+ font-weight: 500;
128
+ }
129
+ h1 {
130
+ font-size: 2.986rem;
131
+ line-height: 1.2;
132
+ }
133
+ h2 {
134
+ font-size: 2.488rem;
135
+ line-height: 1.25;
136
+ }
137
+ h3 {
138
+ font-size: 2.074rem;
139
+ line-height: 1.3;
140
+ }
141
+ h4 {
142
+ font-size: 1.728rem;
143
+ line-height: 1.35;
144
+ }
145
+ h5 {
146
+ font-size: 1.44rem;
147
+ line-height: 1.5;
148
+ }
149
+ h6 {
150
+ font-size: 1.2rem;
151
+ line-height: 1.6;
152
+ }
153
+ p {
154
+ font-size: 1rem;
155
+ }
156
+ @media (max-width: 768px) {
157
+ h1 {
158
+ font-size: 2.027rem;
159
+ }
160
+ h2 {
161
+ font-size: 1.802rem;
162
+ }
163
+ h3 {
164
+ font-size: 1.602rem;
165
+ }
166
+ h4 {
167
+ font-size: 1.424rem;
168
+ }
169
+ h5 {
170
+ font-size: 1.266rem;
171
+ }
172
+ h6 {
173
+ font-size: 1.125rem;
174
+ }
175
+ }
176
+ /*=============================
177
+ Form
178
+ =============================*/
179
+ input[type=text],
180
+ input[type=password],
181
+ input[type=email],
182
+ input[type=search],
183
+ input[type=number],
184
+ input[type=file],
185
+ input[type=tel],
186
+ input[type=url],
187
+ select,
188
+ textarea {
189
+ height: 45px;
190
+ width: 100%;
191
+ margin-bottom: 10px;
192
+ padding: 10px;
193
+ font-size: 1rem;
194
+ background: #f5f5f5;
195
+ border: 1px solid #a7a7a7;
196
+ border-radius: 2px;
197
+ transition: all 0.2s ease;
198
+ }
199
+ input[type=text]:hover,
200
+ input[type=password]:hover,
201
+ input[type=email]:hover,
202
+ input[type=search]:hover,
203
+ input[type=number]:hover,
204
+ input[type=file]:hover,
205
+ input[type=tel]:hover,
206
+ input[type=url]:hover,
207
+ select:hover,
208
+ textarea:hover {
209
+ border-color: #111;
210
+ }
211
+ input[type=text]:focus,
212
+ input[type=password]:focus,
213
+ input[type=email]:focus,
214
+ input[type=search]:focus,
215
+ input[type=number]:focus,
216
+ input[type=file]:focus,
217
+ input[type=tel]:focus,
218
+ input[type=url]:focus,
219
+ select:focus,
220
+ textarea:focus {
221
+ outline: none;
222
+ border-color: #0062ff;
223
+ }
224
+ textarea {
225
+ min-height: 70px;
226
+ }
227
+ /*=============================
228
+ Button
229
+ =============================*/
230
+ button,
231
+ .button,
232
+ [type=submit] {
233
+ height: 45px;
234
+ margin-bottom: 10px;
235
+ padding: 10px 30px;
236
+ outline: none;
237
+ text-decoration: none;
238
+ color: #f5f5f5;
239
+ font-size: 1rem;
240
+ background: #111;
241
+ border: 1px solid #111;
242
+ border-radius: 2px;
243
+ transition: all 0.2s ease;
244
+ }
245
+ button:hover,
246
+ .button:hover,
247
+ [type=submit]:hover,
248
+ button:focus,
249
+ .button:focus,
250
+ [type=submit]:focus {
251
+ opacity: 0.9;
252
+ }
253
+ button:active,
254
+ .button:active,
255
+ [type=submit]:active {
256
+ opacity: 0.7;
257
+ }
258
+ button[disabled],
259
+ .button[disabled],
260
+ [type=submit][disabled] {
261
+ opacity: 0.8;
262
+ cursor: not-allowed;
263
+ }
264
+ button.outline,
265
+ .button.outline,
266
+ [type=submit].outline {
267
+ color: #111;
268
+ background: none;
269
+ }
270
+ button.outline:hover,
271
+ .button.outline:hover,
272
+ [type=submit].outline:hover,
273
+ button.outline:focus,
274
+ .button.outline:focus,
275
+ [type=submit].outline:focus {
276
+ color: #f5f5f5;
277
+ background: #111;
278
+ }
279
+ /*=============================
280
+ Link
281
+ =============================*/
282
+ a {
283
+ color: #0062ff;
284
+ transition: all 0.2s ease;
285
+ }
286
+ a:hover {
287
+ cursor: pointer;
288
+ color: #111;
289
+ }
290
+ /*=============================
291
+ List
292
+ =============================*/
293
+ ul,
294
+ ol {
295
+ margin-top: 0;
296
+ margin-bottom: 10px;
297
+ padding-left: 0;
298
+ list-style-position: inside;
299
+ }
300
+ ul li,
301
+ ol li {
302
+ margin-bottom: 10px;
303
+ }
304
+ ul li:last-child,
305
+ ol li:last-child {
306
+ margin-bottom: 0;
307
+ }
308
+ ul ul,
309
+ ol ul,
310
+ ul ol,
311
+ ol ol {
312
+ margin-left: 10px;
313
+ }
314
+ /*=============================
315
+ Image
316
+ =============================*/
317
+ img {
318
+ margin-top: 0;
319
+ margin-bottom: 10px;
320
+ }
321
+ /*=============================
322
+ Box
323
+ =============================*/
324
+ .box {
325
+ margin-bottom: 10px;
326
+ padding-top: 10px;
327
+ padding-right: 10px;
328
+ padding-left: 10px;
329
+ border: 1px solid #a7a7a7;
330
+ border-radius: 2px;
331
+ }
332
+ /*=============================
333
+ Navigation
334
+ =============================*/
335
+ .nav {
336
+ position: relative;
337
+ display: flex;
338
+ flex-wrap: wrap;
339
+ align-items: center;
340
+ justify-content: space-between;
341
+ padding-top: 10px;
342
+ padding-bottom: 10px;
343
+ }
344
+ .nav .nav-item {
345
+ margin-right: 10px;
346
+ }
347
+ .nav .nav-item:last-child {
348
+ margin-right: 0;
349
+ }
350
+ /*=============================
351
+ Card
352
+ =============================*/
353
+ .card {
354
+ display: flex;
355
+ flex-direction: column;
356
+ margin-bottom: 10px;
357
+ border: 1px solid #a7a7a7;
358
+ border-radius: 2px;
359
+ }
360
+ .card .card-content {
361
+ margin: 0;
362
+ padding: 10px;
363
+ }
364
+ .card .card-image {
365
+ display: block;
366
+ height: auto;
367
+ width: 100%;
368
+ }
369
+ /*=============================
370
+ Code
371
+ =============================*/
372
+ pre {
373
+ margin-top: 0;
374
+ margin-bottom: 10px;
375
+ }
376
+ pre code {
377
+ display: block;
378
+ padding: 10px 10px;
379
+ white-space: pre-wrap;
380
+ word-wrap: break-word;
381
+ }
382
+ code {
383
+ padding: 2px;
384
+ white-space: nowrap;
385
+ background: #e7e7e7;
386
+ border: 1px solid #d7d7d7;
387
+ border-radius: 2px;
388
+ font-family: "Consolas", "Monaco", "Menlo", monospace;
389
+ }
390
+ /*=============================
391
+ Divider
392
+ =============================*/
393
+ hr {
394
+ border-width: 0.5px;
395
+ border-color: #a7a7a7;
396
+ }
397
+ /*=============================
398
+ Utilities
399
+ =============================*/
400
+ .position-relative {
401
+ position: relative;
402
+ }
403
+ .position-absolute {
404
+ position: absolute;
405
+ }
406
+ .position-fixed {
407
+ position: fixed;
408
+ }
409
+ .text-left {
410
+ text-align: left;
411
+ }
412
+ .text-center {
413
+ text-align: center;
414
+ }
415
+ .text-right {
416
+ text-align: right;
417
+ }
418
+ .size-full-height {
419
+ min-height: 100vh;
420
+ }
421
+ .size-full-width {
422
+ width: 100%;
423
+ }
424
+ .size-full {
425
+ width: 100%;
426
+ min-height: 100vh;
427
+ }
428
+ .hidden {
429
+ display: none;
430
+ }
431
+ .flex {
432
+ display: flex;
433
+ }
434
+ .justify-start {
435
+ justify-content: flex-start;
436
+ }
437
+ .justify-center {
438
+ justify-content: center;
439
+ }
440
+ .justify-end {
441
+ justify-content: flex-end;
442
+ }
443
+ .align-start {
444
+ align-items: flex-start;
445
+ }
446
+ .align-center {
447
+ align-items: center;
448
+ }
449
+ .align-end {
450
+ align-items: flex-end;
451
+ }
452
+ .direction-vertical {
453
+ flex-direction: column;
454
+ }
455
+ .direction-horizontal {
456
+ flex-direction: row;
457
+ }
458
+ .center {
459
+ flex-direction: column;
460
+ justify-content: center;
461
+ align-items: center;
462
+ }
463
+ .border-black {
464
+ border: 1px solid #111;
465
+ }
466
+ .border-gray {
467
+ border: 1px solid #a7a7a7;
468
+ }
469
+ .border-white {
470
+ border: 1px solid #f5f5f5;
471
+ }
472
+ .border-blue {
473
+ border: 1px solid #0062ff;
474
+ }
475
+ .border-red {
476
+ border: 1px solid #ff1500;
477
+ }
478
+ .border-yellow {
479
+ border: 1px solid #ffbf00;
480
+ }
481
+ .border-green {
482
+ border: 1px solid #00b30f;
483
+ }
484
+ .border-rounded {
485
+ border-radius: 2px;
486
+ }
487
+ .border-circle {
488
+ border-radius: 2px;
489
+ }
490
+ .color-black {
491
+ color: #111;
492
+ }
493
+ .color-gray {
494
+ color: #a7a7a7;
495
+ }
496
+ .color-white {
497
+ color: #f5f5f5;
498
+ }
499
+ .color-blue {
500
+ color: #0062ff;
501
+ }
502
+ .color-red {
503
+ color: #ff1500;
504
+ }
505
+ .color-yellow {
506
+ color: #ffbf00;
507
+ }
508
+ .color-green {
509
+ color: #00b30f;
510
+ }
511
+ .background-black {
512
+ background-color: #111;
513
+ }
514
+ .background-gray {
515
+ background-color: #a7a7a7;
516
+ }
517
+ .background-white {
518
+ background-color: #f5f5f5;
519
+ }
520
+ .background-blue {
521
+ background-color: #0062ff;
522
+ }
523
+ .background-red {
524
+ background-color: #ff1500;
525
+ }
526
+ .background-yellow {
527
+ background-color: #ffbf00;
528
+ }
529
+ .background-green {
530
+ background-color: #00b30f;
531
+ }
metadata ADDED
@@ -0,0 +1,173 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.0
5
+ platform: ruby
6
+ authors:
7
+ - Aleksandr Balakirev
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-02-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sqlite3
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.3.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.3.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry-byebug
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec-rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: capybara
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Mountable Rails 4 Engine for viewing paginated logs from a browser
112
+ email:
113
+ - test@test.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - MIT-LICENSE
119
+ - README.md
120
+ - Rakefile
121
+ - app/assets/config/logy_manifest.js
122
+ - app/assets/javascripts/logy/application.js
123
+ - app/assets/stylesheets/logy/application.css
124
+ - app/assets/stylesheets/logy/logy.css
125
+ - app/controllers/logy/application_controller.rb
126
+ - app/controllers/logy/concerns/logy_loader.rb
127
+ - app/controllers/logy/concerns/pagination.rb
128
+ - app/controllers/logy/logy_controller.rb
129
+ - app/helpers/logy/application_helper.rb
130
+ - app/helpers/logy/nav_pagination_helper.rb
131
+ - app/services/logy/log_files.rb
132
+ - app/services/logy/viewer.rb
133
+ - app/views/layouts/logy/application.html.erb
134
+ - app/views/logy/logy/index.html.erb
135
+ - app/views/logy/logy/show.html.erb
136
+ - app/views/shared/_header.html.erb
137
+ - app/views/shared/_layout.html.erb
138
+ - app/views/shared/_logs.html.erb
139
+ - app/views/shared/_nav_pagination.html.erb
140
+ - app/views/shared/_navbar.html.erb
141
+ - app/views/shared/_pagination.html.erb
142
+ - app/views/shared/index.html.erb
143
+ - app/views/shared/show.html.erb
144
+ - config/locales/en.yml
145
+ - config/routes.rb
146
+ - lib/logy.rb
147
+ - lib/logy/engine.rb
148
+ - lib/logy/version.rb
149
+ - vendor/assets/stylesheets/wind.css
150
+ homepage: https://github.com/balakirevs/logy
151
+ licenses:
152
+ - MIT
153
+ metadata: {}
154
+ post_install_message:
155
+ rdoc_options: []
156
+ require_paths:
157
+ - lib
158
+ required_ruby_version: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ required_rubygems_version: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
168
+ requirements: []
169
+ rubygems_version: 3.2.9
170
+ signing_key:
171
+ specification_version: 4
172
+ summary: Mountable Rails 4 Engine for viewing paginated logs from a browser
173
+ test_files: []