sail 3.2.3 → 3.2.4
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/Rakefile +1 -1
- data/app/assets/stylesheets/sail/application.scss +3 -1
- data/app/assets/stylesheets/sail/settings.scss +17 -17
- data/app/controllers/sail/settings_controller.rb +2 -2
- data/app/models/sail/setting.rb +1 -1
- data/app/views/sail/settings/_setting.html.erb +9 -1
- data/app/views/sail/settings/index.html.erb +0 -3
- data/app/views/sail/settings/update.js.erb +5 -1
- data/lib/generators/sail/install/install_generator.rb +1 -1
- data/lib/generators/sail/update/update_generator.rb +1 -1
- data/lib/sail.rb +2 -3
- data/lib/sail/types.rb +1 -0
- data/lib/sail/types/set.rb +20 -0
- data/lib/sail/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40fb8e4bc4918c09d226baa2e97666dc61cf6734967538bb62f61d12391c5024
|
4
|
+
data.tar.gz: 53903455199dbf9fd1d310c50dd538856880cb2a740e11576c929609312099ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb1365f1162a6b41ef8a57cc54b15f25e37dfa4dde08eb1a556dde193f0bf33600740c72f4e69e652ca4a2c6666bedc564d15af320f010cde018a73cf0d530c4
|
7
|
+
data.tar.gz: 6002b3b8f33133fd9b0181b9cc52b174e3533f9e28aa493a70ab52194415e44877f017a003a3488641cd673b20d06fce4ca7c8bb04db2be9288a4c5f7ececa39
|
data/Rakefile
CHANGED
@@ -21,7 +21,7 @@ RSpec::Core::RakeTask.new(spec: "app:db:test:prepare")
|
|
21
21
|
task default: :spec
|
22
22
|
|
23
23
|
task :all do
|
24
|
-
system("brakeman --no-pager && rake && rubocop --
|
24
|
+
system("brakeman --no-pager && rake && rubocop --auto-correct && rails_best_practices")
|
25
25
|
end
|
26
26
|
|
27
27
|
system("cd ./spec/dummy; RAILS_ENV=test rails db:environment:set; cd ../..") if Rails::VERSION::MAJOR >= 5
|
@@ -19,6 +19,7 @@
|
|
19
19
|
|
20
20
|
* {
|
21
21
|
font-family: 'Open Sans', sans-serif;
|
22
|
+
-webkit-font-smoothing: antialiased;
|
22
23
|
}
|
23
24
|
|
24
25
|
.title {
|
@@ -101,7 +102,7 @@ html, body {
|
|
101
102
|
background-color: white;
|
102
103
|
padding: 20px;
|
103
104
|
@extend .rounded;
|
104
|
-
box-shadow: 0 10px
|
105
|
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
105
106
|
font-weight: bold;
|
106
107
|
|
107
108
|
&.active {
|
@@ -124,6 +125,7 @@ html, body {
|
|
124
125
|
|
125
126
|
#angle-right-link {
|
126
127
|
background: white image-url("sail/angle-right.svg") center no-repeat;
|
128
|
+
margin-left: 6px;
|
127
129
|
padding: 20px 24px 20px 24px;
|
128
130
|
}
|
129
131
|
}
|
@@ -15,7 +15,7 @@
|
|
15
15
|
background-color: white;
|
16
16
|
margin: 1rem .75rem;
|
17
17
|
display: inline-block;
|
18
|
-
box-shadow: 0
|
18
|
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
19
19
|
padding: 10px;
|
20
20
|
z-index: 2;
|
21
21
|
width: 90%;
|
@@ -49,13 +49,14 @@
|
|
49
49
|
}
|
50
50
|
|
51
51
|
.tag {
|
52
|
-
font-weight: bold;
|
53
52
|
@extend .rounded;
|
54
53
|
padding: 10px;
|
55
54
|
color: $main_black;
|
56
55
|
font-size: 14px;
|
57
56
|
margin-left: 5px;
|
58
57
|
text-decoration: none;
|
58
|
+
font-weight: bold;
|
59
|
+
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
59
60
|
|
60
61
|
&.type-label {
|
61
62
|
background-color: $light_yellow;
|
@@ -67,6 +68,11 @@
|
|
67
68
|
|
68
69
|
&.stale-label {
|
69
70
|
background-color: $bright_red;
|
71
|
+
|
72
|
+
@media (max-width: 413px) {
|
73
|
+
position: relative;
|
74
|
+
top: 8px;
|
75
|
+
}
|
70
76
|
}
|
71
77
|
}
|
72
78
|
|
@@ -81,6 +87,7 @@
|
|
81
87
|
text-overflow: ellipsis;
|
82
88
|
white-space: nowrap;
|
83
89
|
overflow: hidden;
|
90
|
+
@extend .fade-in;
|
84
91
|
color: darken($aluminium, 45%);
|
85
92
|
}
|
86
93
|
|
@@ -347,17 +354,14 @@
|
|
347
354
|
}
|
348
355
|
|
349
356
|
.notice {
|
350
|
-
background-color: white;
|
351
|
-
font-size: 24px;
|
352
|
-
position: fixed;
|
353
|
-
left: 50px;
|
354
|
-
top: 85px;
|
355
|
-
padding: 25px;
|
356
|
-
width: 150px;
|
357
|
-
text-align: center;
|
358
|
-
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
|
359
357
|
display: none;
|
360
|
-
|
358
|
+
clear: both;
|
359
|
+
padding: 25px 15px 15px 15px;
|
360
|
+
text-overflow: ellipsis;
|
361
|
+
white-space: nowrap;
|
362
|
+
overflow: hidden;
|
363
|
+
font-weight: bolder;
|
364
|
+
text-align: center;
|
361
365
|
@extend .fade-in;
|
362
366
|
|
363
367
|
&.success {
|
@@ -367,11 +371,6 @@
|
|
367
371
|
&.alert {
|
368
372
|
color: $bright_red;
|
369
373
|
}
|
370
|
-
|
371
|
-
@media (max-width: 767px) {
|
372
|
-
width: 85%;
|
373
|
-
left: 1.5%;
|
374
|
-
}
|
375
374
|
}
|
376
375
|
|
377
376
|
#progress-container {
|
@@ -410,6 +409,7 @@
|
|
410
409
|
-ms-transition: background-color 0.5s;
|
411
410
|
-o-transition: background-color 0.5s;
|
412
411
|
transition: background-color 0.5s;
|
412
|
+
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
413
413
|
|
414
414
|
&:active {
|
415
415
|
color: $main_black;
|
@@ -11,14 +11,14 @@ module Sail
|
|
11
11
|
before_action :set_locale, only: :index
|
12
12
|
after_action :log_update, only: %i[update reset], if: -> { Sail.configuration.enable_logging && @successful_update }
|
13
13
|
|
14
|
-
# rubocop:disable AbcSize
|
14
|
+
# rubocop:disable Metrics/AbcSize
|
15
15
|
def index
|
16
16
|
@settings = Setting.by_query(s_params[:query]).ordered_by(s_params[:order_field])
|
17
17
|
@number_of_pages = (@settings.count.to_f / settings_per_page).ceil
|
18
18
|
@settings = @settings.paginated(s_params[:page], settings_per_page)
|
19
19
|
fresh_when(@settings)
|
20
20
|
end
|
21
|
-
# rubocop:enable AbcSize
|
21
|
+
# rubocop:enable Metrics/AbcSize
|
22
22
|
|
23
23
|
def update
|
24
24
|
respond_to do |format|
|
data/app/models/sail/setting.rb
CHANGED
@@ -21,7 +21,7 @@ module Sail
|
|
21
21
|
validates :name, presence: true, uniqueness: { case_sensitive: false }
|
22
22
|
enum cast_type: %i[integer string boolean range array float
|
23
23
|
ab_test cron obj_model date uri throttle
|
24
|
-
locales].freeze
|
24
|
+
locales set].freeze
|
25
25
|
|
26
26
|
validate :value_is_within_range, if: -> { range? }
|
27
27
|
validate :value_is_true_or_false, if: -> { boolean? || ab_test? }
|
@@ -32,7 +32,15 @@
|
|
32
32
|
</div>
|
33
33
|
<% end %>
|
34
34
|
|
35
|
-
<p
|
35
|
+
<p id="success-<%= setting.name %>" class="notice success">
|
36
|
+
<label><%= I18n.t("sail.updated") %></label>
|
37
|
+
</p>
|
38
|
+
|
39
|
+
<p id="alert-<%= setting.name %>" class="notice alert">
|
40
|
+
<label><%= I18n.t("sail.failed") %></label>
|
41
|
+
</p>
|
42
|
+
|
43
|
+
<p id="description-<%= setting.name %>" class="setting-description" title="<%= setting.description %>">
|
36
44
|
<label for="<%= "input_for_#{setting.name}" %>"><%= setting.description %></label>
|
37
45
|
</p>
|
38
46
|
|
@@ -1,8 +1,5 @@
|
|
1
1
|
<div id="settings-dashboard">
|
2
2
|
<% cache [@settings, params[:monitor_mode]] do %>
|
3
|
-
<span id="notice-success" class="notice success"><%= I18n.t("sail.updated") %></span>
|
4
|
-
<span id="notice-alert" class="notice alert"><%= I18n.t("sail.failed") %></span>
|
5
|
-
|
6
3
|
<% unless params[:monitor_mode] == Sail::ConstantCollection::TRUE %>
|
7
4
|
<%= render(partial: "search") %>
|
8
5
|
<% end %>
|
@@ -1,8 +1,12 @@
|
|
1
|
-
var notice = document.getElementById("<%= @successful_update ? "
|
1
|
+
var notice = document.getElementById("<%= @successful_update ? "success-#{@setting.name}" : "alert-#{@setting.name}" %>");
|
2
|
+
var description = document.getElementById("description-<%= @setting.name %>");
|
3
|
+
|
2
4
|
notice.style.display = "block";
|
5
|
+
description.style.display = "none";
|
3
6
|
|
4
7
|
setTimeout(function () {
|
5
8
|
notice.style.display = "none";
|
9
|
+
description.style.display = "block";
|
6
10
|
}, 1500);
|
7
11
|
|
8
12
|
if ("<%= @successful_update %>" === "true") {
|
data/lib/sail.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "sail/engine"
|
4
|
-
require "sail/constant_collection"
|
5
|
-
require "sail/configuration"
|
6
|
-
require "sail/instrumenter"
|
7
4
|
require "true_class"
|
8
5
|
require "false_class"
|
9
6
|
|
10
7
|
module Sail # :nodoc:
|
8
|
+
autoload :ConstantCollection, "sail/constant_collection"
|
9
|
+
autoload :Configuration, "sail/configuration"
|
11
10
|
autoload :Instrumenter, "sail/instrumenter"
|
12
11
|
autoload :Types, "sail/types"
|
13
12
|
|
data/lib/sail/types.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sail
|
4
|
+
module Types
|
5
|
+
# Set
|
6
|
+
#
|
7
|
+
# This type allows defining a set
|
8
|
+
# using a string and a separator
|
9
|
+
# (defined in the configuration).
|
10
|
+
class Set < Type
|
11
|
+
def to_value
|
12
|
+
::Set[*@setting.value.split(Sail.configuration.array_separator)]
|
13
|
+
end
|
14
|
+
|
15
|
+
def from(value)
|
16
|
+
value.is_a?(::String) ? value : value.join(Sail.configuration.array_separator)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/sail/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vinicius Stock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sassc-rails
|
@@ -388,6 +388,7 @@ files:
|
|
388
388
|
- lib/sail/types/locales.rb
|
389
389
|
- lib/sail/types/obj_model.rb
|
390
390
|
- lib/sail/types/range.rb
|
391
|
+
- lib/sail/types/set.rb
|
391
392
|
- lib/sail/types/string.rb
|
392
393
|
- lib/sail/types/throttle.rb
|
393
394
|
- lib/sail/types/type.rb
|
@@ -401,7 +402,7 @@ licenses:
|
|
401
402
|
metadata: {}
|
402
403
|
post_install_message: |
|
403
404
|
**************************************************************************
|
404
|
-
Sail 3.2.
|
405
|
+
Sail 3.2.4!
|
405
406
|
|
406
407
|
For major version upgrades, check the CHANGELOG and run the updater to
|
407
408
|
create necessary migrations.
|