menilite 0.5.0 → 0.5.1

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: fa0456ba69383e0e59a40b7b7fad44296b9f5576
4
- data.tar.gz: f74ce6a6826bc2b73108a64c98aabba159078507
3
+ metadata.gz: 6a99c228624ca2ec36237affb7fdbf746d9b1724
4
+ data.tar.gz: a4168d8e73a16f0d8b07b3f1df61935744148230
5
5
  SHA512:
6
- metadata.gz: d37414bfd1a1b040ffe0b5f11f3a77b2e75e90762a788f45ccae8a764c204ac63edf893754ef85517b443e0b6f285a09e217da0533621a5795c0c46605e5abf7
7
- data.tar.gz: c9f86a5dbef6f88bb4ff07d080756f443576f16beefc19de56c95681f23e6a566f30f2382fa9bba8ea97aeb4a7972b7097ea2a61e741467a0697dbd88d7b1999
6
+ metadata.gz: c8d5fa224163611d37e81e1de952530c01785f515e83b606c1afa7195c8ce45f9bee910874ae2e61250c930cf759404883a7bb9e6a124a1aeb5c69c252e46591
7
+ data.tar.gz: df53d45fda4f43e983d11b29c6ac75bcb610c533fa54219e0226f10431826d4dd5a43852789794637befe9b8101a1cd3201213fdeabbbbcf6d724e370b5711fd
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 youchan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/youchan/menilite.svg?branch=master)](https://travis-ci.org/youchan/menilite)
4
4
 
5
- An isomophic web programming framework in Ruby.
5
+ An isomorphic web programming framework in Ruby.
6
6
  Ruby codes also run on the client side by using [Opalrb](http://opalrb.org).
7
7
 
8
8
  ## Installation
@@ -9,10 +9,10 @@ module Menilite
9
9
  promise
10
10
  end
11
11
 
12
- def post_json(url, json, &block)
12
+ def post_json(url, data, &block)
13
13
  (callback, promise) = prepare(url, &block)
14
14
 
15
- `fetch(url, {method: 'post', body: JSON.stringify(json)}).then(callback)`
15
+ `fetch(url, {method: 'post', body: #{data.to_json}}).then(callback)`
16
16
 
17
17
  promise
18
18
 
@@ -25,7 +25,7 @@ module Menilite
25
25
  models = is_array ? model : [ model ]
26
26
  model_class = models.first.class
27
27
  table = @tables[model_class]
28
- Menilite::Http.post_json("api/#{model_class.to_s}", models.to_json) do
28
+ Menilite::Http.post_json("api/#{model_class.to_s}", models) do
29
29
  on :success do |json|
30
30
  results = json.map do |value|
31
31
  if table.has_key?(value[:id])
@@ -37,7 +37,7 @@ module Menilite
37
37
  action_url = self.respond_to?(:namespace) ? "api/#{self.namespace}/#{name}" : "api/#{name}"
38
38
  post_data = {}
39
39
  post_data[:args] = args
40
- Menilite::Http.post_json(action_url, post_data.to_json) do
40
+ Menilite::Http.post_json(action_url, post_data) do
41
41
  on :success do |res|
42
42
  callback.call(:success, res) if callback
43
43
  end
@@ -222,7 +222,6 @@ module Menilite
222
222
  end
223
223
 
224
224
  define_method("#{name}=") do |value|
225
- puts "#{name}=#{value}: #{type}"
226
225
  unless type_validator(type).call(value, name)
227
226
  raise TypeError.new("type error: field name: #{name}, value: #{value}")
228
227
  end
@@ -263,7 +262,7 @@ module Menilite
263
262
  post_data[:model] = model.to_h
264
263
  end
265
264
 
266
- Menilite::Http.post_json(action_url, post_data.to_json) do
265
+ Menilite::Http.post_json(action_url, post_data) do
267
266
  on :success do |res|
268
267
  callback.call(:success, res) if callback
269
268
  end
@@ -1,3 +1,3 @@
1
1
  module Menilite
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: menilite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - youchan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-22 00:00:00.000000000 Z
11
+ date: 2017-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -106,6 +106,7 @@ files:
106
106
  - ".rspec"
107
107
  - ".travis.yml"
108
108
  - Gemfile
109
+ - LICENSE.txt
109
110
  - README.md
110
111
  - Rakefile
111
112
  - bin/console
@@ -145,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
146
  version: '0'
146
147
  requirements: []
147
148
  rubyforge_project:
148
- rubygems_version: 2.6.11
149
+ rubygems_version: 2.6.13
149
150
  signing_key:
150
151
  specification_version: 4
151
152
  summary: Isomorphic models between client side opal and server side ruby.