sweet_staging 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62d06f95c5469c3d0579eb8d1a586319e1a1279f572f51e576b7a3706b9b29e3
4
- data.tar.gz: 4ea48bf7d4f56e4e242e5388218c3d62402e6658cec1fbdc96b1d6fa922d23e4
3
+ metadata.gz: 9a5ebc3446d768bd738bca85278e501dc78f715962ed96e6dc6777953d89ab65
4
+ data.tar.gz: 5c3a44addf590bee176c8d6dcd2430db2edad156c902a04ab2d1710c2f5fb56a
5
5
  SHA512:
6
- metadata.gz: 9fe5bccb13bcd45235b8d9a103ed2decebb12c75ee4363099a4e196d20529e993f944b697eacfcd01e29f6924f7256720921b20542082e8f4ab96cbf81ef6498
7
- data.tar.gz: 7ee740b107ed82ba7f1fe7c93d88a8217c8b57edb1e3002b28679c865791bc4aeda0202cee52f0e23942a6dc91a4c889c155bf3808235844d92086cc1d4e0f75
6
+ metadata.gz: df541fbd4e24c92167013f905c59478c06e2e42cbeed6b60e666da2fb7875302d0c99d4ddd1a45bcf596f61b5e6f5b3d7337ec5b91c72046a73676e84e6413db
7
+ data.tar.gz: 887a2cf47082a5aec8433ad7b215db80ee159ca281fdb5776ab51f53174cec0a8307ab5296526a280a0d62132c1743eeff899706b7eee5d24f83c4df710700c0
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Sweet Staging
2
2
 
3
+ [![RailsJazz](https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/my_other.svg?raw=true)](https://www.railsjazz.com)
4
+ [![https://www.patreon.com/igorkasyanchuk](https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/patron.svg?raw=true)](https://www.patreon.com/igorkasyanchuk)
5
+
3
6
  We often need access to the staging.logs (or production), sidekiq.log, etc. And often direct access to the server is closed and you cannot get them. The idea of this gem is let developer or QA get access to the logs which you want to share.
4
7
 
5
8
  This gem allows to access files which are ONLY specified in config. Same about shell commands. Same about Rails console.
@@ -90,12 +93,15 @@ $ bundle
90
93
 
91
94
  After the installation start the server and open the `/sweet/staging`. Make sure that before you created an initializer and condifured all needed commands and files.
92
95
 
96
+ You need to have a "tail" and "wc" utils commands on the server to make everything working.
97
+
93
98
  ## TODO
94
99
 
95
100
  - on scroll put on pause, on scroll to the bottom continue scrolling
96
101
  - on selection put on pause
97
102
  - implement link to log line feature
98
103
  - specs
104
+ - support for Ruby <2.5 (open3 gem looks like was extracted into a separate gem)
99
105
 
100
106
  ## Contributing
101
107
 
@@ -108,3 +114,6 @@ You are welcome to contribute.
108
114
  ## License
109
115
 
110
116
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
117
+
118
+ [<img src="https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/more_gems.png?raw=true"
119
+ />](https://www.railsjazz.com/)
@@ -1,7 +1,27 @@
1
- <% @result = ap(@result) %>
1
+ <% @result_ap = ap(@result, html: true, plain: false, color: {
2
+ args: :pale,
3
+ array: :white,
4
+ bigdecimal: :cyan,
5
+ class: :yellow,
6
+ date: :green,
7
+ falseclass: :red,
8
+ integer: :cyan,
9
+ float: :cyan,
10
+ hash: :pale,
11
+ keyword: :cyan,
12
+ method: :purpleish,
13
+ nilclass: :red,
14
+ rational: :cyan,
15
+ string: :yellowish,
16
+ struct: :pale,
17
+ symbol: :cyanish,
18
+ time: :green,
19
+ trueclass: :green,
20
+ variable: :cyanish
21
+ }) %>
2
22
 
3
23
  var result = `
4
- <%= raw @result.gsub("`", '\'') %>
24
+ <%= raw @result_ap.gsub("`", '\'').gsub(/\e\[([;\d]+)?m/, '') %>
5
25
  `;
6
26
 
7
27
  $('.loader-wrapper').hide();
@@ -6,10 +6,20 @@ function getSelectionText(){
6
6
  return selectedText;
7
7
  }
8
8
 
9
- document.addEventListener('mouseup', function(){
9
+ function copyHandler() {
10
10
  var thetext = getSelectionText()
11
11
  if (thetext.length > 0) { // check there's some text selected
12
12
  console.log(thetext);
13
13
  document.execCommand("copy"); // logs whatever textual content the user has selected on the page
14
14
  }
15
- }, false);
15
+ }
16
+
17
+ document.addEventListener("DOMContentLoaded", function() {
18
+ if (!!document.getElementById('console')) {
19
+ document.getElementById('console').addEventListener('mouseup', copyHandler, false);
20
+ }
21
+
22
+ if (!!document.getElementById('logs')) {
23
+ document.getElementById('logs').addEventListener('mouseup', copyHandler, false);
24
+ }
25
+ });
@@ -1,3 +1,3 @@
1
1
  module SweetStaging
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sweet_staging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-11 00:00:00.000000000 Z
11
+ date: 2021-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails