wolfram_databin 0.1.1 → 0.1.2

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: 6a53fddbfa8fd43701c31f12b8153b7b4581c70f
4
- data.tar.gz: 9798b61595879cfb9a19591438aa86099109596c
3
+ metadata.gz: 4e733cc3c55e931304a1933fb5e1367924dcb037
4
+ data.tar.gz: f7ac9124f8c675a612b873765e1960f2ce5bf6be
5
5
  SHA512:
6
- metadata.gz: 3d6a761cfe39399d28f68f601775f7f7ec62d12ee700bde305f15e1d9a10809177c9e93beca9df4b7fa9a2c67bbd53cd5c56488f0026c1b3186df55be2227b7b
7
- data.tar.gz: bdf1624ad32b7eabc01ae22f3f8d5913d8d1ee901de69dfc79b50a3c3e09a9098ba7626378062cab1ef0b3ea829a7d1749e0e542e5baa0fe48020f2af1215939
6
+ metadata.gz: 94e42934a7daf6e05df5c9d1e44e91e9f4eb3dd4c1905f4932da12f7e71d55c98adc1ee71e731baf76d589f4ba57eb92b78fc327f86706d598c0cfd01ed2c31a
7
+ data.tar.gz: e60257184000f2d006c56dd554278508689884b4f9e90896ae652ea6324dc3662737eb9615481d698f0869d4bdcd2223b08a3b0820b8846e36d076416477c58d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wolfram_databin (0.1.1)
4
+ wolfram_databin (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  Wolfram Databin
5
5
  ============
6
6
 
7
- post data to a wolfram databin
7
+ Post data to a wolfram databin. You can post just about any kind of string data to the databin. Just add more stuff to the query hash and send it. The bin id is merged with the query hash so no need to add the bin id to the query.
8
8
 
9
9
  Test URL
10
10
  =======
@@ -15,6 +15,9 @@ Usage
15
15
 
16
16
  @dbin=WolframDatabin::Base.new
17
17
  @dbin.set_shortid("4PZWVcDT")
18
- query= {time: time }
18
+ query= {time: Time.now}
19
19
  res=@dbin.post_data(query)
20
20
 
21
+ One shot usage
22
+ ==============
23
+ WolframDatbin::Base.submit_data("4PZWVcDT",{time: Time.now})
@@ -20,6 +20,15 @@ module WolframDatabin
20
20
  url="https://datadrop.wolframcloud.com/api/v1.0/Add?"
21
21
  url
22
22
  end
23
+ def self.submit_data(tshortid,aquery)
24
+ dbin=WolframDatabin::Base.new
25
+ dbin.submit_data(tshortid,aquery)
26
+ end
27
+ def submit_data(tshortid,aquery)
28
+ self.set_shortid(tshortid)
29
+ res=self.post_data(aquery)
30
+ res
31
+ end
23
32
  def post_data(query)
24
33
  raise "short id not set" if self.shortid==nil
25
34
  res=''
@@ -14,7 +14,7 @@
14
14
  <img src="./assets/0.10.0/loading.gif" alt="loading"/>
15
15
  </div>
16
16
  <div id="wrapper" style="display:none;">
17
- <div class="timestamp">Generated <abbr class="timeago" title="2015-05-15T22:39:06+08:00">2015-05-15T22:39:06+08:00</abbr></div>
17
+ <div class="timestamp">Generated <abbr class="timeago" title="2015-05-16T12:04:41+08:00">2015-05-16T12:04:41+08:00</abbr></div>
18
18
  <ul class="group_tabs"></ul>
19
19
 
20
20
  <div id="content">
data/test/test_wolfram.rb CHANGED
@@ -30,6 +30,16 @@ class WolframDatabinTest < Minitest::Test
30
30
  puts "result is #{res}"
31
31
  assert res[:success], "response should be success #{res}"
32
32
  end
33
+ def test_submit
34
+ res=@dbin.submit_data("4PZWVcDT",{submit_time: Time.now})
35
+ assert res[:success], "response should be success #{res} #{@dbin.datadrop_url}"
36
+
37
+ end
38
+ def test_submit_class
39
+ res = WolframDatabin::Base.submit_data("4PZWVcDT",{clas_submit_time: Time.now})
40
+ assert res[:success], "response should be success #{res} "
41
+
42
+ end
33
43
 
34
44
 
35
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolfram_databin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Sproule
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-15 00:00:00.000000000 Z
11
+ date: 2015-05-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Upload data to wolfram databin mathematica via ruby
14
14
  email: scott.sproule@ficonab.com