babascript 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/History.txt +4 -0
- data/README.md +8 -1
- data/lib/babascript/baba.rb +2 -1
- data/lib/babascript/version.rb +1 -1
- data/lib/babascript.rb +7 -2
- data/samples/sample_arduino.rb +15 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a83953a4edabb85bf97e0c8a2f0e476877b3e52
|
4
|
+
data.tar.gz: 699893a2337fbf20bfcc1b0042144393e5814bd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90c09ccd9311bbc2a744cbd969c1b8307082b8c636c63b7085303318bc53d21cc73b62800ffccda6cdbad5e7f038e3231b58e6f118f60ee808df5315e69f6ba8
|
7
|
+
data.tar.gz: 8324f423bb312b6a7ea6f94600b41e5c6c2e7987d317c5f67bcea154a147b3dc4f061a0e3151b9aa60c89d5cfce85df9d8e72f85fba3818d766d811a72097a12
|
data/Gemfile.lock
CHANGED
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -20,7 +20,6 @@ oneline
|
|
20
20
|
|
21
21
|
% babascript -e "月曜にかず助に行くので、出欠をとってください"
|
22
22
|
|
23
|
-
interpreter
|
24
23
|
|
25
24
|
sample.bb
|
26
25
|
```ruby
|
@@ -51,6 +50,14 @@ BabaScript.baba do
|
|
51
50
|
end
|
52
51
|
```
|
53
52
|
|
53
|
+
### switch BABA
|
54
|
+
BabaScriptはジョブ通知に[Linda](https://gihtub.com/shokai/linda-base)を使っています。
|
55
|
+
環境変数BABAのデフォルト値は"takumibaba"で、彼のジョブは http://linda.masuilab.org/takumibaba/notifications で確認できます。
|
56
|
+
|
57
|
+
% export BABA=shokai
|
58
|
+
|
59
|
+
環境変数BABAを"shokai"に切り替えると、ジョブの通知先が http://linda.masuilab.org/shokai/notifications になります。
|
60
|
+
|
54
61
|
|
55
62
|
Contributing
|
56
63
|
------------
|
data/lib/babascript/baba.rb
CHANGED
@@ -14,7 +14,8 @@ module BabaScript
|
|
14
14
|
query = {
|
15
15
|
:body => {:tuple => tuple.to_json}
|
16
16
|
}
|
17
|
-
|
17
|
+
puts "#{BabaScript.LINDA_BASE}/#{BabaScript.LINDA_SPACE}.write"
|
18
|
+
HTTParty.post("#{BabaScript.LINDA_BASE}/#{BabaScript.LINDA_SPACE}.write", query)
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
data/lib/babascript/version.rb
CHANGED
data/lib/babascript.rb
CHANGED
@@ -4,6 +4,11 @@ require "httparty"
|
|
4
4
|
require "json"
|
5
5
|
|
6
6
|
module BabaScript
|
7
|
-
|
8
|
-
|
7
|
+
def self.LINDA_BASE
|
8
|
+
ENV["LINDA_BASE"] || "http://linda.masuilab.org"
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.LINDA_SPACE
|
12
|
+
ENV["BABA"] || "takumibaba"
|
13
|
+
end
|
9
14
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
require 'rubygems'
|
4
|
+
$:.unshift File.expand_path '../lib', File.dirname(__FILE__)
|
5
|
+
require 'babascript'
|
6
|
+
require 'arduino_firmata'
|
7
|
+
|
8
|
+
arduino = ArduinoFirmata.connect
|
9
|
+
|
10
|
+
if arduino.analog_read(0) > 80
|
11
|
+
BabaScript.baba do
|
12
|
+
明るくなったから起こしてくださいby橋本
|
13
|
+
それと朝食におにぎり買ってきてください("#{rand(5)}個", "しゃけ味")
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: babascript
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- lib/babascript/version.rb
|
103
103
|
- samples/sample.bb
|
104
104
|
- samples/sample.rb
|
105
|
+
- samples/sample_arduino.rb
|
105
106
|
homepage: https://github.com/masuilab/babascript
|
106
107
|
licenses:
|
107
108
|
- MIT
|