console_log 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff3ef4992c80f44463062840a622199f0c1db5ea
4
- data.tar.gz: 12511d4f854b2238166da299c25077552d26c7a9
3
+ metadata.gz: 5829ac9c96c95234cc6e9be2bc489bd1c62ecdb1
4
+ data.tar.gz: 6f59458981cbdc1419c5642a6ac578e6b115173a
5
5
  SHA512:
6
- metadata.gz: fd191c1d0646acd8515046cefc9a8f1d9e7a6218f2effc25eb525f813f80bd88d10bc895249797df2bdb69ecc64936a12d86880b3ab7a1afe839ac5535dda5af
7
- data.tar.gz: 829cc19503a46039bbca566285faef96042e695a66a2c4f16484c987b38ccd014de353eff3bd53ca7034eed304efd673cfa581428e6d16adf7d6dd10bdfaa7c9
6
+ metadata.gz: a87602f973245d57e9f0639529cf6f71522e4e4362642725bee2fd837e3fc465f00a08da6a4c910d23c3f66b5892e1bea611fa88c912d23fb1e51d76e23a4366
7
+ data.tar.gz: 45f5ac59cef8241db1f3a8686af47f67c7a2b95054a41d8ea7acc1dec2dd51e4e86bdb35ee67ac4189fe5264b76d434a586dcefb999f6db3823067083512c712
@@ -0,0 +1,15 @@
1
+ module ConsoleLogHelper
2
+ def console_log_javascript_tag(development_only = true)
3
+ render partial: 'console_log/javascript'
4
+ end
5
+
6
+ private
7
+
8
+ def include_js?(development_only)
9
+ if development_only
10
+ Rails.env.development?
11
+ else
12
+ true
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ <%= javascript_tag do -%>
2
+ <% _console_log_flush_queue.each do |message| -%>
3
+ console.log(<%= message.to_json.html_safe %>);
4
+ <% end -%>
5
+ <% end -%>
@@ -1,3 +1,3 @@
1
1
  module ConsoleLog
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -0,0 +1,5 @@
1
+ class TestController < ApplicationController
2
+ def index
3
+ console_log("test message")
4
+ end
5
+ end
@@ -10,5 +10,6 @@
10
10
 
11
11
  <%= yield %>
12
12
 
13
+ <%= console_log_javascript_tag %>
13
14
  </body>
14
15
  </html>
File without changes
@@ -1,4 +1,7 @@
1
1
  Rails.application.routes.draw do
2
+
3
+ root 'test#index'
4
+
2
5
  # The priority is based upon order of creation: first created -> highest priority.
3
6
  # See how all your routes lay out with "rake routes".
4
7