bellite 0.0.8 → 1.4.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE.txt +21 -0
- data/bellite.gemspec +5 -4
- data/lib/bellite.rb +84 -93
- data/lib/bellite/version.rb +1 -1
- data/test/_doBelliteTest.rb +4 -5
- data/test/testClientJSONRPC.js +4 -4
- metadata +17 -27
- data/LICENSE +0 -22
- data/test/testClientJSONRPC.py +0 -21
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ffcbbd4905c36a0a471e6217c512b0a9e3d7e877
|
4
|
+
data.tar.gz: a6dc6bc4a07fcc3e3d5f8d15b41e4d26b3ec7ade
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f5c636d0bd931f0697bd252ae687eaf9539e70bbe7a75ae97756d4f942487bb1746d731c592dbe6c0198969deabf2a1a24654f0111f544b017c62ad88b547f14
|
7
|
+
data.tar.gz: 7b7eb5553913bfcc15046c53ccd8b544bcca702dc99d485fb559d7588643cedcdde827d49512350fcd03ed2d2d57e03b8176fb0e4cb6bfa9e85a7f846a1bb202
|
data/MIT-LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2013, Bellite.io.
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
12
|
+
all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
THE SOFTWARE.
|
21
|
+
|
data/bellite.gemspec
CHANGED
@@ -3,10 +3,10 @@ require File.expand_path('../lib/bellite/version', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["Shane Holloway"]
|
6
|
-
gem.email = ["shane@
|
7
|
-
gem.description = "Bellite JSON-RPC
|
8
|
-
gem.summary = "
|
9
|
-
gem.homepage = ""
|
6
|
+
gem.email = ["shane@bellite.io"]
|
7
|
+
gem.description = "Bellite JSON-RPC client library"
|
8
|
+
gem.summary = "Create desktop applications for Mac OSX (10.7 & 10.8) and Windows XP, 7 & 8 using modern web technology and Ruby (Python or Node.js or PHP or Java)."
|
9
|
+
gem.homepage = "https://github.com/bellite/bellite-ruby"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
@@ -14,6 +14,7 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.name = "bellite"
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Bellite::VERSION
|
17
|
+
gem.license = 'MIT'
|
17
18
|
|
18
19
|
|
19
20
|
gem.add_development_dependency "redcarpet", "~> 1.17"
|
data/lib/bellite.rb
CHANGED
@@ -5,23 +5,6 @@ require 'socket'
|
|
5
5
|
include Socket::Constants
|
6
6
|
|
7
7
|
|
8
|
-
# Clone of {http://docs.python.org/2/library/functools.html#functools.partial Python functools.partial}
|
9
|
-
# Creates a lambda with passed func and applies to it args. Args can be overriden when this lambda called.
|
10
|
-
#
|
11
|
-
#@param [Proc] func - func to be called with partial parameters
|
12
|
-
#@param [Array] *args - default parameters which should be passed to func
|
13
|
-
#@return [Proc] wrapper around func which passes *args or new args, passed to wrapper to func
|
14
|
-
def partial(func, *args)
|
15
|
-
return Proc.new do |*new_args|
|
16
|
-
merged_params = args.clone()
|
17
|
-
new_args.each_with_index {|v,k|
|
18
|
-
merged_params[k] = new_args[k]
|
19
|
-
}
|
20
|
-
func.call(*merged_params)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
|
25
8
|
# Simple implementation of {http://docs.python.org/2/library/asyncore.html Python Asyncore}
|
26
9
|
class Async
|
27
10
|
#!attribute @@map
|
@@ -87,38 +70,19 @@ class Async
|
|
87
70
|
#Running check while at least one socket in objects map is connected
|
88
71
|
#@param [Float] timeout - timeout, passed to {.check}
|
89
72
|
#@param [Hash] map, passed to {.check}
|
90
|
-
def Async.loop(timeout,map=false)
|
91
|
-
|
92
|
-
end
|
73
|
+
def Async.loop(timeout, map=false)
|
74
|
+
return Async.check(timeout, map) != false
|
93
75
|
end
|
94
76
|
end
|
95
77
|
|
96
78
|
|
97
79
|
|
98
|
-
# Implements new pythonic {http://docs.python.org/2/library/stdtypes.html#dict.setdefault setdefault} method in ruby class Hash
|
99
|
-
class Hash
|
100
|
-
#(see {Hash})
|
101
|
-
#@param key key of hash
|
102
|
-
#@param value value of key in hash
|
103
|
-
#@return [Value] if key in hash - hash value, attached to key; otherwise value, passed to setdefault
|
104
|
-
def setdefault(key, value)
|
105
|
-
if self[key] == nil
|
106
|
-
self[key] = value
|
107
|
-
end
|
108
|
-
return self[key]
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
|
113
80
|
# @abstract This is common interface of Bellite json-rpc API
|
114
81
|
class BelliteJsonRpcApi
|
115
82
|
#Constructor. Connects to server with cred credentials
|
116
83
|
#@param [String] cred Credentials in format: 'host:port/token';
|
117
|
-
def initialize(cred)
|
118
|
-
|
119
|
-
if cred
|
120
|
-
_connect(cred)
|
121
|
-
end
|
84
|
+
def initialize(cred=nil)
|
85
|
+
connect(cred)
|
122
86
|
end
|
123
87
|
|
124
88
|
#Authenticates with server using token
|
@@ -223,10 +187,28 @@ class BelliteJsonRpcApi
|
|
223
187
|
end
|
224
188
|
end
|
225
189
|
|
226
|
-
|
190
|
+
# Return promise for ready event
|
191
|
+
def ready()
|
192
|
+
return @ready
|
193
|
+
end
|
194
|
+
|
195
|
+
# Connecting to JSON-RPC server
|
227
196
|
#@param [String] host Host
|
228
197
|
#@param [Fixnum] port Port
|
229
|
-
def
|
198
|
+
def connect(cred=nil)
|
199
|
+
cred = findCredentials(cred)
|
200
|
+
if cred
|
201
|
+
f_ready = deferred()
|
202
|
+
@ready = f_ready.promise
|
203
|
+
_connect(cred, f_ready)
|
204
|
+
return @ready
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
#@abstract Connecting to JSON-RPC server
|
209
|
+
#@param [String] cred Credentials in format: 'host:port/token';
|
210
|
+
#@param [Future] f_ready Ready future instance
|
211
|
+
def _connect(cred, f_ready)
|
230
212
|
raise NotImplementedError, "Subclass Responsibility"
|
231
213
|
end
|
232
214
|
|
@@ -272,7 +254,9 @@ class BelliteJsonRpc < BelliteJsonRpcApi
|
|
272
254
|
msgId = @_nextMsgId
|
273
255
|
@_nextMsgId += 1
|
274
256
|
res = _newResult(msgId)
|
275
|
-
_sendJsonRpc(method, params, msgId)
|
257
|
+
if not _sendJsonRpc(method, params, msgId)
|
258
|
+
res.reject('Bellite client not connected')
|
259
|
+
end
|
276
260
|
return res.promise
|
277
261
|
end
|
278
262
|
|
@@ -312,13 +296,17 @@ class BelliteJsonRpc < BelliteJsonRpcApi
|
|
312
296
|
#Puts send packets to STDOUT
|
313
297
|
#@param [String] msg Same as for _sendMessage
|
314
298
|
def logSend(msg)
|
315
|
-
|
299
|
+
if @logging
|
300
|
+
puts "send ==> " + JSON.fast_generate(msg)
|
301
|
+
end
|
316
302
|
end
|
317
303
|
|
318
304
|
#Puts received packets to STDOUT
|
319
305
|
#@param [String] msg Same as for _sendMessage
|
320
306
|
def logRecv(msg)
|
321
|
-
|
307
|
+
if @logging
|
308
|
+
puts "recv ==> " + JSON.fast_generate(msg)
|
309
|
+
end
|
322
310
|
end
|
323
311
|
|
324
312
|
#Receives JSON-RPC response or call from JSON-RPC Server
|
@@ -360,16 +348,21 @@ class BelliteJsonRpc < BelliteJsonRpcApi
|
|
360
348
|
end
|
361
349
|
|
362
350
|
if msg.has_key?('error')
|
363
|
-
tgt.reject
|
351
|
+
tgt.reject(msg['error'])
|
352
|
+
elsif msg['result'][0]
|
353
|
+
tgt.reject(msg['result'])
|
364
354
|
else
|
365
|
-
tgt.resolve
|
355
|
+
tgt.resolve(msg['result'])
|
366
356
|
end
|
367
357
|
end
|
368
358
|
|
369
359
|
#Called on connect to remote JSON-RPC server.
|
370
360
|
#@param [Hash] cred Server credentials: port, host, token and original `credentials` string
|
371
|
-
|
372
|
-
|
361
|
+
#@param [Future] f_ready Ready future instance
|
362
|
+
def on_connect(cred, f_ready)
|
363
|
+
auth(cred['token']) \
|
364
|
+
.then(f_ready.method(:resolve), f_ready.method(:reject)) \
|
365
|
+
.then(method(:on_auth_succeeded), method(:on_auth_failed))
|
373
366
|
end
|
374
367
|
|
375
368
|
#Called when auth is successfully ended
|
@@ -391,20 +384,13 @@ class BelliteJsonRpc < BelliteJsonRpcApi
|
|
391
384
|
#~ micro event implementation ~~~~~~~~~~~~~~~~~~~~~~~
|
392
385
|
#
|
393
386
|
|
394
|
-
#Adds ready event handler
|
395
|
-
#@param [Proc] fnReady Event hanlder lambda
|
396
|
-
#@return [Proc] Your event handler
|
397
|
-
def ready(fnReady)
|
398
|
-
return on('ready', fnReady)
|
399
|
-
end
|
400
|
-
|
401
387
|
#Adds any event handler
|
402
388
|
#@param [String] key Event name like `ready`
|
403
389
|
#@param [Proc] fn Function to bind on event
|
404
390
|
#@return [Proc] Your event handler or bindEvent method to bind your handler later if you skip fn
|
405
391
|
def on(key, fn=false)
|
406
392
|
bindEvent = lambda do |fn|
|
407
|
-
@_evtTypeMap
|
393
|
+
(@_evtTypeMap[key]||=[]) << fn
|
408
394
|
return fn
|
409
395
|
end
|
410
396
|
if not fn
|
@@ -439,21 +425,22 @@ end
|
|
439
425
|
class Bellite < BelliteJsonRpc
|
440
426
|
|
441
427
|
|
442
|
-
#!attribute [rw] timeout
|
443
|
-
# Timeout of IO.select socket wait
|
444
|
-
#@return [Float] Timeout value in seconds
|
428
|
+
#!attribute [rw] timeout
|
429
|
+
# Timeout of IO.select socket wait
|
430
|
+
#@return [Float] Timeout value in seconds
|
445
431
|
attr_accessor :timeout
|
446
432
|
|
447
433
|
#Connecting to JSON-RPC server
|
448
434
|
# Calls on_connect if connection successfull
|
449
|
-
#@param [
|
450
|
-
|
435
|
+
#@param [String] cred Credentials in format: 'host:port/token';
|
436
|
+
#@param [Future] f_ready Ready future instance
|
437
|
+
def _connect(cred, f_ready)
|
451
438
|
@timeout = 0.5
|
452
439
|
@conn = TCPSocket.new cred['host'], cred['port']
|
453
440
|
@buf = ""
|
454
441
|
|
455
442
|
if @conn
|
456
|
-
on_connect(cred)
|
443
|
+
on_connect(cred, f_ready)
|
457
444
|
end
|
458
445
|
end
|
459
446
|
|
@@ -578,22 +565,32 @@ class PromiseApi
|
|
578
565
|
#Runs then-function call with same function for success and failure
|
579
566
|
#@param [Proc] fn Function to handle success or failure
|
580
567
|
#@return Result of then-function call
|
581
|
-
def always(fn)
|
582
|
-
return
|
568
|
+
def always(fn=nil, &blk)
|
569
|
+
return then_(fn||blk, fn||blk)
|
583
570
|
end
|
584
571
|
|
585
572
|
#Runs then-function in case of failure
|
586
573
|
#@param [Proc] failure Failure handler
|
587
574
|
#@return Result of then-function call
|
588
|
-
def fail(failure)
|
589
|
-
return
|
575
|
+
def fail(failure, &blk)
|
576
|
+
return then_(false, failure||blk)
|
590
577
|
end
|
591
578
|
|
592
579
|
#Runs then-function in case of success
|
593
580
|
#@param [Proc] success Success handler
|
594
581
|
#@return Result of then-function call
|
595
|
-
def done(success)
|
596
|
-
return
|
582
|
+
def done(success, &blk)
|
583
|
+
return then_(success||blk,false)
|
584
|
+
end
|
585
|
+
|
586
|
+
def then(success=false, failure=false, &blk)
|
587
|
+
return then_(success, failure, &blk)
|
588
|
+
end
|
589
|
+
def then_(success=false, failure=false, &blk)
|
590
|
+
if (blk && (success || failure))
|
591
|
+
raise ArgumentError, "Ambiguous block argument"
|
592
|
+
end
|
593
|
+
return @_then.call(success,failure)
|
597
594
|
end
|
598
595
|
end
|
599
596
|
|
@@ -612,13 +609,6 @@ class Promise < PromiseApi
|
|
612
609
|
def promise
|
613
610
|
return self
|
614
611
|
end
|
615
|
-
|
616
|
-
#@!attribute [r] _then
|
617
|
-
# Then-function
|
618
|
-
#@return [Proc,lambda]
|
619
|
-
def _then
|
620
|
-
@_then
|
621
|
-
end
|
622
612
|
end
|
623
613
|
|
624
614
|
#Implements Future
|
@@ -641,15 +631,15 @@ class Future < PromiseApi
|
|
641
631
|
#@!attribute [r] resolve
|
642
632
|
# Success-function
|
643
633
|
#@return [Proc,lambda]
|
644
|
-
def resolve
|
645
|
-
@resolve
|
634
|
+
def resolve(res=true)
|
635
|
+
@resolve.call(res)
|
646
636
|
end
|
647
637
|
|
648
638
|
#@!attribute [r] reject
|
649
639
|
# Failure-function
|
650
640
|
#@return [Proc,lambda]
|
651
|
-
def reject
|
652
|
-
@reject
|
641
|
+
def reject(err)
|
642
|
+
@reject.call(err)
|
653
643
|
end
|
654
644
|
|
655
645
|
#@!attribute [r] promise
|
@@ -658,6 +648,10 @@ class Future < PromiseApi
|
|
658
648
|
def promise
|
659
649
|
@promise
|
660
650
|
end
|
651
|
+
|
652
|
+
def then_(success=false, failure=false)
|
653
|
+
return @promise.then_(success, failure)
|
654
|
+
end
|
661
655
|
end
|
662
656
|
|
663
657
|
#Creates Future object for JSON-RPC Server response
|
@@ -681,11 +675,11 @@ def deferred()
|
|
681
675
|
|
682
676
|
resolve = lambda do |result|
|
683
677
|
while cb.size > 0
|
684
|
-
success, failure = cb.
|
678
|
+
success, failure = cb.shift()
|
685
679
|
begin
|
686
680
|
if success != false
|
687
|
-
res = success.call(result)
|
688
|
-
if
|
681
|
+
change, res = success.call(result)
|
682
|
+
if change and res===nil
|
689
683
|
result = res
|
690
684
|
end
|
691
685
|
end
|
@@ -695,23 +689,19 @@ def deferred()
|
|
695
689
|
elsif cb.size = 0
|
696
690
|
#excepthook
|
697
691
|
end
|
698
|
-
|
699
|
-
return reject.call(err)
|
700
|
-
else
|
701
|
-
return reject.call(res)
|
702
|
-
end
|
692
|
+
return reject.call(res==nil ? err : res)
|
703
693
|
end
|
704
694
|
end
|
705
|
-
answer =
|
695
|
+
answer = lambda { resolve.call(result) }
|
706
696
|
end
|
707
697
|
|
708
698
|
reject = lambda do |error|
|
709
699
|
while cb.size > 0
|
710
|
-
failure = cb.
|
700
|
+
failure = cb.shift()[1]
|
711
701
|
begin
|
712
702
|
if failure != false
|
713
|
-
res = failure.call(error)
|
714
|
-
if
|
703
|
+
change, res = failure.call(error)
|
704
|
+
if change and res===nil
|
715
705
|
error = res
|
716
706
|
end
|
717
707
|
end
|
@@ -722,9 +712,10 @@ def deferred()
|
|
722
712
|
end
|
723
713
|
end
|
724
714
|
end
|
725
|
-
answer =
|
715
|
+
answer = lambda { reject.call(error) }
|
726
716
|
end
|
727
717
|
|
728
718
|
future = Future.new _then, resolve, reject
|
729
719
|
return future
|
730
720
|
end
|
721
|
+
|
data/lib/bellite/version.rb
CHANGED
data/test/_doBelliteTest.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
require '../lib/bellite.rb'
|
4
4
|
app = Bellite.new
|
5
|
-
|
6
|
-
|
5
|
+
|
6
|
+
app.ready.done lambda {
|
7
7
|
app.ping
|
8
8
|
app.version
|
9
9
|
app.perform(142, "echo", {"name" => [nil, true, 42, "value"]})
|
@@ -12,8 +12,6 @@ app.ready Proc.new {
|
|
12
12
|
app.unbindEvent(118, "*")
|
13
13
|
|
14
14
|
app.on("testEvent", lambda { |app, eobj|
|
15
|
-
puts "TEST EVENT"
|
16
|
-
puts eobj
|
17
15
|
if eobj['evt']
|
18
16
|
app.perform(0, eobj['evt'])
|
19
17
|
else
|
@@ -26,4 +24,5 @@ app.ready Proc.new {
|
|
26
24
|
}
|
27
25
|
|
28
26
|
app.timeout = false
|
29
|
-
app.loop
|
27
|
+
while app.loop()
|
28
|
+
end
|
data/test/testClientJSONRPC.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*-*- coding: utf-8 -*- vim: set ts=4 sw=4 expandtab
|
2
2
|
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##
|
3
|
-
##~ Copyright (C) 2002-
|
3
|
+
##~ Copyright (C) 2002-2013 Bellite.io ##
|
4
4
|
##~ ##
|
5
5
|
##~ This library is free software; you can redistribute it ##
|
6
6
|
##~ and/or modify it under the terms of the MIT style License as ##
|
@@ -176,9 +176,9 @@ function testBelliteJSONRPC(opt, doneCallback) {
|
|
176
176
|
return Object.create(rpc).connect(api) }
|
177
177
|
})
|
178
178
|
|
179
|
-
function spawnClient(exec, args) {
|
179
|
+
function spawnClient(exec, args, cwd) {
|
180
180
|
var cp = require('child_process')
|
181
|
-
test.proc = cp.spawn(exec, args, {stdio:'inherit',cwd:__dirname})
|
181
|
+
test.proc = cp.spawn(exec, args, {stdio:'inherit',cwd:cwd||__dirname})
|
182
182
|
test.proc.on('exit', function(code, signal) {
|
183
183
|
log('process_exit', code, signal)
|
184
184
|
test.proc = false;
|
@@ -251,7 +251,7 @@ exports.assetTestResults = assetTestResults;
|
|
251
251
|
if (!module.parent) {
|
252
252
|
// test the bellist JSON-RPC interactions
|
253
253
|
testBelliteJSONRPC({
|
254
|
-
debugLog: console.log,
|
254
|
+
//debugLog: console.log,
|
255
255
|
timeout: 2000,
|
256
256
|
//timeout: false,
|
257
257
|
//port: 3099,
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bellite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: 1.4.22
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Shane Holloway
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-04-19 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: redcarpet
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: yard
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,22 +41,20 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: json
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
|
-
description: Bellite JSON-RPC
|
55
|
+
description: Bellite JSON-RPC client library
|
63
56
|
email:
|
64
|
-
- shane@
|
57
|
+
- shane@bellite.io
|
65
58
|
executables: []
|
66
59
|
extensions: []
|
67
60
|
extra_rdoc_files: []
|
@@ -69,7 +62,7 @@ files:
|
|
69
62
|
- .gitignore
|
70
63
|
- .yardopts
|
71
64
|
- Gemfile
|
72
|
-
- LICENSE
|
65
|
+
- MIT-LICENSE.txt
|
73
66
|
- README.md
|
74
67
|
- Rakefile
|
75
68
|
- bellite.gemspec
|
@@ -77,34 +70,31 @@ files:
|
|
77
70
|
- lib/bellite/version.rb
|
78
71
|
- test/_doBelliteTest.rb
|
79
72
|
- test/testClientJSONRPC.js
|
80
|
-
|
81
|
-
|
82
|
-
|
73
|
+
homepage: https://github.com/bellite/bellite-ruby
|
74
|
+
licenses:
|
75
|
+
- MIT
|
76
|
+
metadata: {}
|
83
77
|
post_install_message:
|
84
78
|
rdoc_options: []
|
85
79
|
require_paths:
|
86
80
|
- lib
|
87
81
|
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
-
none: false
|
89
82
|
requirements:
|
90
|
-
- -
|
83
|
+
- - '>='
|
91
84
|
- !ruby/object:Gem::Version
|
92
85
|
version: '0'
|
93
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
-
none: false
|
95
87
|
requirements:
|
96
|
-
- -
|
88
|
+
- - '>='
|
97
89
|
- !ruby/object:Gem::Version
|
98
90
|
version: '0'
|
99
91
|
requirements: []
|
100
92
|
rubyforge_project:
|
101
|
-
rubygems_version:
|
93
|
+
rubygems_version: 2.0.0
|
102
94
|
signing_key:
|
103
|
-
specification_version:
|
104
|
-
summary:
|
105
|
-
|
95
|
+
specification_version: 4
|
96
|
+
summary: Create desktop applications for Mac OSX (10.7 & 10.8) and Windows XP, 7 &
|
97
|
+
8 using modern web technology and Ruby (Python or Node.js or PHP or Java).
|
106
98
|
test_files:
|
107
99
|
- test/_doBelliteTest.rb
|
108
100
|
- test/testClientJSONRPC.js
|
109
|
-
- test/testClientJSONRPC.py
|
110
|
-
has_rdoc:
|
data/LICENSE
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2012, Bellite.io.
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/test/testClientJSONRPC.py
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*- vim: set ts=4 sw=4 expandtab
|
3
|
-
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##
|
4
|
-
##~ Copyright (C) 2002-2012 Bellite.io ##
|
5
|
-
##~ ##
|
6
|
-
##~ This library is free software; you can redistribute it ##
|
7
|
-
##~ and/or modify it under the terms of the MIT style License as ##
|
8
|
-
##~ found in the LICENSE file included with this distribution. ##
|
9
|
-
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##
|
10
|
-
|
11
|
-
import unittest, os, sys
|
12
|
-
|
13
|
-
class TestJSONRPC(unittest.TestCase):
|
14
|
-
def testBelliteClient(self):
|
15
|
-
src = os.path.splitext(__file__)[0]+'.js'
|
16
|
-
assert 0==os.system('node '+src)
|
17
|
-
|
18
|
-
|
19
|
-
if __name__=='__main__':
|
20
|
-
unittest.main()
|
21
|
-
|