babascript 0.0.5 → 0.1.0

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: b7ef51a5ad8b8325321bc986b3a40b6a36d3f40c
4
- data.tar.gz: fdc4bfcea2badb0b0da729fcea89d3dedeb2f76e
3
+ metadata.gz: 8e09aa0fa3c28c9962d54f95b27234397d4d71c6
4
+ data.tar.gz: df3ce05b94c6cff1aba435f90439db49b59aadc1
5
5
  SHA512:
6
- metadata.gz: cda7be8e08c938dea3f24445d1298164cc6a7ae95aab332c3d4e8fd04d91e2fe012767f89f4ef4abb8644300b7539295b9009e970c6e7241c0bd372de3181067
7
- data.tar.gz: 6d7c313ca0e55dcb5c6ac6e6308a7cbac167f9b2058f303df74d89a75c741b583f3be1acb921e7828ac644a1dcc7c82362478e17d62df03f4731907b4027c880
6
+ metadata.gz: bfc5a5695e7429523c5b61222559746c56984bf90ea080fa593d62e898934c8ca2c94c73959d201456300740bb7661ee28dcbb0cbe3acd7cdb663ee74477d13f
7
+ data.tar.gz: 766e27b56753d3202323a4f6554b53d47e4c46e4abc454c2a2af79dca7bcd92b7a175c1fbd6ac30a8cde20c3fceec3994add53068fee3f09f90386b13fa8bdf9
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.1.0 2013-06-22
2
+
3
+ * put Callback ID
4
+ * modify Tuple name
5
+
1
6
  === 0.0.5 2013-06-20
2
7
 
3
8
  * little fix
data/babascript.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://github.com/masuilab/babascript"
14
14
  spec.license = "MIT"
15
15
 
16
- spec.files = `git ls-files`.split($/)
16
+ spec.files = `git ls-files`.split($/).reject{|i| i=="Gemfile.lock" }
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
data/bin/baba CHANGED
@@ -17,7 +17,7 @@ end
17
17
 
18
18
  if args.has_param? :e
19
19
  puts args[:e]
20
- print BabaScript::Baba.instance_eval args[:e]
20
+ puts BabaScript::Baba.instance_eval args[:e]
21
21
  else
22
22
  args.argv.each do |fname|
23
23
  File.open(fname) do |f|
@@ -9,12 +9,16 @@ module BabaScript
9
9
  end
10
10
 
11
11
  def self.method_missing(name, *args)
12
- tuple = ["notifications", name]
13
- tuple.push args unless args.empty?
12
+ tuple = [:babascript, :eval, name, args, {:callback => __create_callback_id}]
14
13
  query = {
15
14
  :body => {:tuple => tuple.to_json}
16
15
  }
17
16
  HTTParty.post("#{BabaScript.LINDA_BASE}/#{BabaScript.LINDA_SPACE}.write", query)
18
17
  end
18
+
19
+ private
20
+ def self.__create_callback_id
21
+ Digest::MD5.hexdigest "#{Time.now.to_i}_#{Time.now.usec}_#{rand 100000}"
22
+ end
19
23
  end
20
24
  end
@@ -1,3 +1,3 @@
1
1
  module BabaScript
2
- VERSION = "0.0.5"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/babascript.rb CHANGED
@@ -2,6 +2,7 @@ require "babascript/version"
2
2
  require "babascript/baba"
3
3
  require "httparty"
4
4
  require "json"
5
+ require 'digest/md5'
5
6
 
6
7
  module BabaScript
7
8
  def self.LINDA_BASE
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: babascript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-20 00:00:00.000000000 Z
11
+ date: 2013-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -90,7 +90,6 @@ extra_rdoc_files: []
90
90
  files:
91
91
  - .gitignore
92
92
  - Gemfile
93
- - Gemfile.lock
94
93
  - History.txt
95
94
  - LICENSE.txt
96
95
  - README.md
data/Gemfile.lock DELETED
@@ -1,27 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- babascript (0.0.5)
5
- args_parser
6
- httparty
7
- json
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- args_parser (0.1.6)
13
- httparty (0.11.0)
14
- multi_json (~> 1.0)
15
- multi_xml (>= 0.5.2)
16
- json (1.8.0)
17
- multi_json (1.7.7)
18
- multi_xml (0.5.4)
19
- rake (10.1.0)
20
-
21
- PLATFORMS
22
- ruby
23
-
24
- DEPENDENCIES
25
- babascript!
26
- bundler (~> 1.3)
27
- rake