opal-bootbox 0.1.0 → 0.1.1

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: e94c8a226c35e6fc5399538d5ca5eb973462a1d9
4
- data.tar.gz: 2589cc1d0833023a5444f3814a84f1d3f2018a28
3
+ metadata.gz: 49a5f706d7b1498f3f402603b2fc28cc38640032
4
+ data.tar.gz: 5ec45755993176d6e3429991400309aca9003c4a
5
5
  SHA512:
6
- metadata.gz: af6abe7bd3a80cff78427098059b049f4397bd891433f1d77ed307e16966214f32a8bfb8093e3073305e4ea35be2286d3efc330374e29ebd3c7fbf57639217fc
7
- data.tar.gz: e7b07b2e6eb60c913f982885ea7441aa35b5c1867190c8b51bd5e4b6f6934c08ae2376838521662a7256200b1c56bf98d97a0d23483f2e729e28e77d3259df82
6
+ metadata.gz: fa05abc60e1ca252f3332af4ec573c684ea9e55c3d0eeb0463e7dd1eec91450b585f08f973fe0355d61c96f7251c79089a821a23e8c4b24ce7d3a72a8ee86e1e
7
+ data.tar.gz: 607575582805561cd6e3f7d15e4e3c642ad28eb7bc32cdf52ea228acb41921ac36b0ba0a90a02d50aa350d79f0a5b28af48760138fe9b635272de678c98e1dfa
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The goal of this project is to wrap the Bootbox Javascript library with Opal, providing a simple Ruby interface to Bootbox functionality.
4
4
 
5
- Bootbox.js is a small JavaScript library which implements dialog (alert, prompt, confirm) boxes using Bootstrap modals.
5
+ Bootbox.js is a small open source (MIT) JavaScript library which implements dialog (alert, prompt, confirm) boxes using Bootstrap modals.
6
6
 
7
7
  To find out more about Bootbox, go to http://bootboxjs.com.
8
8
 
@@ -47,7 +47,7 @@ require 'opal-bootbox'
47
47
  >> http://getbootstrap.com/getting-started/#download
48
48
  > and put the files in `app/` or whichever directory you are compiling assets from.
49
49
 
50
- ### Usage
50
+ ### Examples
51
51
 
52
52
  ```
53
53
  $bootbox.alert('Hello world!') do
data/lib/opal/bootbox.rb CHANGED
@@ -1,3 +1,12 @@
1
+ module Opal
2
+ module Bootbox
3
+ end
4
+ end
5
+
6
+ if RUBY_ENGINE == 'opal'
7
+
8
+ require 'native'
9
+
1
10
  module Opal
2
11
  module Bootbox
3
12
  module_function
@@ -8,18 +17,21 @@ module Opal
8
17
 
9
18
  # Creates an alert window.
10
19
  # The given block is optional.
20
+ # Method executes asynchronously.
11
21
  # No result is passed to the given block.
12
22
  def alert(*args, &block)
13
23
  bootbox_call(__method__, *args, &block)
14
24
  end
15
25
 
16
26
  # Creates a confirm window.
27
+ # Method executes asynchronously.
17
28
  # The result passed to given block is true or false.
18
29
  def confirm(*args, &block)
19
30
  bootbox_call(__method__, *args, &block)
20
31
  end
21
32
 
22
33
  # Creates a prompt window.
34
+ # Method executes asynchronously.
23
35
  # The result passed to given block is a String or nil.
24
36
  def prompt(*args, &block)
25
37
  bootbox_call(__method__, *args, &block)
@@ -27,12 +39,14 @@ module Opal
27
39
 
28
40
  end
29
41
  end
30
- $bootbox = Opal::Bootbox
31
42
 
32
- if RUBY_ENGINE == 'opal'
33
- else
43
+ else # RUBY_ENGINE
44
+
34
45
  require 'opal'
35
46
  require 'opal/bootbox/version'
36
47
  Opal.append_path File.expand_path('../..', __FILE__).untaint
37
- end
48
+
49
+ end # RUBY_ENGINE
50
+
51
+ $bootbox = Opal::Bootbox
38
52
 
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module Bootbox
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-bootbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin Gunn