opal-promise-patch 0.0.1 → 0.0.2.pre1

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: 6615cc8cba834f8252e906e72d8f85ab0b40fece
4
- data.tar.gz: 07c9d4412f5a475cd297323fe4a0e8830b15e99b
3
+ metadata.gz: 853e9cc09e0b393c34797011498fcd5dbb1aeae6
4
+ data.tar.gz: 124e1a42f193afad9dcdfda89fbc1a27e80b00b2
5
5
  SHA512:
6
- metadata.gz: 2741f156e01d0c47c402b94315145290ddcb221a8ad4469421a04ed235831d68adb5aadd3ed752b75d2670935ae06b39c6090c8c32dea427b7259e04476cd4ef
7
- data.tar.gz: a060833e4020ffdb987efadef2ed8856774d9533c27dbf4c4d6663b00bfc9d7fc099b7573b0b470a0e32e0a610f43dd795ae154b2decc54c34f7bfa3f07acdd2
6
+ metadata.gz: 0e892f33d904e74bb53050d6759d207854fc5360c3b28ca3f20c9ceb09d8732848f4d7f99fbf4d4cf8fd8c2a257ca2f2d42ff4b99a9802fca2cf76a4d7345634
7
+ data.tar.gz: b7f095a4dff58b3b16ffbc34150b878245a87b2461642bee3d43ca91a8d5866b27535537c0b73092a00be22662392af59b3129ba7982d42c366036b37d162b92
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Change Log
2
+
3
+ ## 0.0.2
4
+ - to_promise on Object to wrap any object in a promise
5
+
6
+ ## 0.0.1
7
+ - Able to chain methods on a promise instead of writing boiler code chaining then. e.g. Promise.new.resolve([1, 2, 3]).length <= returns a promise that resolves into the length of the array
data/README.md CHANGED
@@ -6,5 +6,6 @@ This project rocks and uses MIT-LICENSE.
6
6
 
7
7
  Add `gem opal-promise-patch` to your Gemfile
8
8
  Run `bundle install`
9
+ Include `require 'utils/promise/promise_patch'` at the start of your main controller
9
10
  Done!
10
11
 
data/TODOS ADDED
@@ -0,0 +1,21 @@
1
+ * Fixing arguments passed in as Promises
2
+ Example:
3
+ ```
4
+ begin
5
+ a = store._items.fetch_first
6
+ a._first_name + " " + a._last_name
7
+ rescue => e
8
+ ..
9
+ end
10
+ ```
11
+
12
+ Example:
13
+ ```
14
+ begin
15
+ a = store._items.fetch_first
16
+ " " + a._last_name
17
+ rescue => e
18
+ ..
19
+ end
20
+ ```
21
+ * Exceptions are swallowed
@@ -0,0 +1 @@
1
+ require 'opals/promise_patch/promise_patch'
@@ -1,4 +1,3 @@
1
- require 'opal'
2
1
  if RUBY_PLATFORM == 'opal'
3
2
  require 'promise'
4
3
  else
@@ -19,3 +18,9 @@ class Promise
19
18
  end
20
19
  end
21
20
  end
21
+
22
+ class Object
23
+ def to_promise
24
+ Promise.new.resolve(self)
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ class Promise
2
+ VERSION = "0.0.2.pre1"
3
+ end
@@ -1,7 +1,5 @@
1
- $:.push File.expand_path("../lib", __FILE__)
2
-
3
- # Maintain your gem's version:
4
- require "utils/promise/version"
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/opals/promise_patch/version', __FILE__)
5
3
 
6
4
  # Describe your gem and declare its dependencies:
7
5
  Gem::Specification.new do |s|
@@ -18,5 +16,5 @@ Gem::Specification.new do |s|
18
16
  s.test_files = Dir["test/**/*"]
19
17
  s.require_paths = ['lib']
20
18
 
21
- s.add_runtime_dependency 'opal', '~> 0.7'
19
+ s.add_runtime_dependency 'opal', '>= 0.7.0', '< 0.9.0'
22
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-promise-patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Penn Su
@@ -14,16 +14,22 @@ dependencies:
14
14
  name: opal
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.7'
19
+ version: 0.7.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 0.9.0
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.7.0
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '0.7'
32
+ version: 0.9.0
27
33
  description: ''
28
34
  email:
29
35
  - pennsu@gmail.com
@@ -32,13 +38,16 @@ extensions: []
32
38
  extra_rdoc_files: []
33
39
  files:
34
40
  - ".gitignore"
41
+ - CHANGELOG.md
35
42
  - Gemfile
36
43
  - Gemfile.lock
37
44
  - MIT-LICENSE
38
45
  - README.md
39
46
  - Rakefile
40
- - lib/utils/promise/promise_patch.rb
41
- - lib/utils/promise/version.rb
47
+ - TODOS
48
+ - lib/opal-promise-patch.rb
49
+ - lib/opals/promise_patch/promise_patch.rb
50
+ - lib/opals/promise_patch/version.rb
42
51
  - opal-promise-patch.gemspec
43
52
  homepage: https://github.com/pencilcheck/opal-promise-patch
44
53
  licenses:
@@ -55,9 +64,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
55
64
  version: '0'
56
65
  required_rubygems_version: !ruby/object:Gem::Requirement
57
66
  requirements:
58
- - - ">="
67
+ - - ">"
59
68
  - !ruby/object:Gem::Version
60
- version: '0'
69
+ version: 1.3.1
61
70
  requirements: []
62
71
  rubyforge_project:
63
72
  rubygems_version: 2.4.5
@@ -1,3 +0,0 @@
1
- class Promise
2
- VERSION = "0.0.1"
3
- end