volt-browser_irb 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: f12011d739bd2477c0f5b7e3491f38a886519c4d
4
- data.tar.gz: cad6dbeb3e022aa727425a054575ef664388a295
3
+ metadata.gz: f85282a219df26e75e010563cef3596231726bef
4
+ data.tar.gz: 7a11783de8444fadc7521bc94e318ecc64f17009
5
5
  SHA512:
6
- metadata.gz: 4f3e428d5539b3ccc265a6c9de19c9eb8c9aed6b60e3a9fe1bb08bc063d7eea8008f8086c18253a5f30cc3d130077013315ca8c0a8e74f21ef1bb7899b208554
7
- data.tar.gz: 75fff637f90519e705bb15bbf64e7cead251449a3375eee03745e49f3a415d932f54cdbfc6eec8c3ec2a493aabd998f8afc02060678a3b70b99af9004b9dc681
6
+ metadata.gz: 0d232c29aaf7c1bcad42559a40b9b7289af5b930e9a20d3116987fc230186d1cbe75295fa008936a195f14cdf6a56439eca79b9de76e510f8f43a72624a9d196
7
+ data.tar.gz: 3dc00d0eb9e57668c85c31069344d41ce9af9acc8af24d4609706dc3eb9dc6a35a1863980daff62664e81449791d930a651f2a9c04ba5128f7de09e9c46ad6cc
data/README.md CHANGED
@@ -16,12 +16,18 @@ Then in ```app/main/config/dependencies.rb``` you can require it as a dependency
16
16
 
17
17
  ```ruby
18
18
  if Volt.env.development?
19
- dependency 'browser_irb'
19
+ component 'browser_irb'
20
20
  end
21
21
  ```
22
22
 
23
23
  Restart the server, and press ESCAPE to toggle the irb on the page.
24
24
 
25
+ ## Helpers
26
+
27
+ ### tp
28
+
29
+ volt-browser_irb adds the ```#tp``` helper method to the Promise object (short for then_puts). Calling .tp on the promise will print a ```.inspect``` of the promises resolves value or rejected error when it resolves. Typically in volt in development, this will be right away, so it can act a little similar to how you might use .sync.inspect on the server.
30
+
25
31
  ## TODO
26
32
 
27
33
  Currently browser-irb is pretty simple, here's some things I want to add:
@@ -7,4 +7,5 @@
7
7
  # To include code only on the server, use:
8
8
  # unless RUBY_PLATFORM == 'opal'
9
9
  # ^^ this will not send compile in code in the conditional to the client.
10
- # ^^ this include code required in the conditional.
10
+ # ^^ this include code required in the conditional.
11
+ require 'browser_irb/lib/promise_ext'
@@ -0,0 +1,11 @@
1
+ class Promise
2
+ def then_puts
3
+ self.then do |val|
4
+ puts val.inspect
5
+ end.fail do |err|
6
+ puts "Error: #{err.inspect}"
7
+ end
8
+ end
9
+
10
+ alias_method :tp, :then_puts
11
+ end
@@ -1,5 +1,5 @@
1
1
  module Volt
2
2
  module BrowserIrb
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volt-browser_irb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stout
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-09 00:00:00.000000000 Z
11
+ date: 2015-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: volt
@@ -213,6 +213,7 @@ files:
213
213
  - app/browser_irb/config/initializers/boot.rb
214
214
  - app/browser_irb/config/routes.rb
215
215
  - app/browser_irb/controllers/main_controller.rb
216
+ - app/browser_irb/lib/promise_ext.rb
216
217
  - app/browser_irb/tasks/command_task.rb
217
218
  - app/browser_irb/views/main/index.html
218
219
  - lib/volt/browser_irb.rb