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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d23ea2d0a1fcb54388eb2e68f56ea38507a0ff30
4
- data.tar.gz: 45fc336f63a8316986309d26e86876f3587c30c6
3
+ metadata.gz: 4a83953a4edabb85bf97e0c8a2f0e476877b3e52
4
+ data.tar.gz: 699893a2337fbf20bfcc1b0042144393e5814bd3
5
5
  SHA512:
6
- metadata.gz: e09584c9eb549e14eb62278802483eb6ffdeb2ce6bafabff934f38fe4a88a807014ae84e39de5514846f38f02ab05a50d75053c1b4301120c310d76bc8fc9680
7
- data.tar.gz: e030d3124b4590c0cd9105a36018f7ed8e35b84b25f6ec59ebfd29be7dfe9d80754cd894333401b465379f32cc5240418c72dbbe4e75ea8a225b0549fd71ddcf
6
+ metadata.gz: 90c09ccd9311bbc2a744cbd969c1b8307082b8c636c63b7085303318bc53d21cc73b62800ffccda6cdbad5e7f038e3231b58e6f118f60ee808df5315e69f6ba8
7
+ data.tar.gz: 8324f423bb312b6a7ea6f94600b41e5c6c2e7987d317c5f67bcea154a147b3dc4f061a0e3151b9aa60c89d5cfce85df9d8e72f85fba3818d766d811a72097a12
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- babascript (0.0.2)
4
+ babascript (0.0.3)
5
5
  args_parser
6
6
  httparty
7
7
  json
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.0.3 2013-06-20
2
+
3
+ * switch BABA by ENV var BABA
4
+
1
5
  === 0.0.2 2013-06-20
2
6
 
3
7
  * BabaScript interpreter
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
  ------------
@@ -14,7 +14,8 @@ module BabaScript
14
14
  query = {
15
15
  :body => {:tuple => tuple.to_json}
16
16
  }
17
- HTTParty.post("#{LINDA_BASE}/#{LINDA_SPACE}.write", query)
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
@@ -1,3 +1,3 @@
1
1
  module BabaScript
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/babascript.rb CHANGED
@@ -4,6 +4,11 @@ require "httparty"
4
4
  require "json"
5
5
 
6
6
  module BabaScript
7
- LINDA_BASE = "http://linda.masuilab.org"
8
- LINDA_SPACE = "takumibaba"
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.2
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