wolfram_databin 0.1.3 → 0.1.4
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/README.md +2 -0
- data/lib/wolfram_databin/base.rb +1 -2
- data/test/coverage/index.html +1 -1
- data/test/test_wolfram.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf0667593a674d257fecf2a1a64506155168719a
|
4
|
+
data.tar.gz: 8a4d62636bf5f30b80624abc3c361d127418ef24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b863805d1502fe26a9b82c6f3ca0e1376c1dda906d8e8afb6d6cab5a1017641c2b0d264b0638d8f98cf54bd4277b8711fe96405f5dea954c37628a878c2be591
|
7
|
+
data.tar.gz: 253179ac3eadcf8c466fe47f57cca296c334b0bba96aff1be67ced4736c569d587ef60221e9718585b7f616a8b02117b084f1c410872c35c8165af6c7393e616
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,6 +6,8 @@ Wolfram Databin
|
|
6
6
|
|
7
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
|
+
Note that Mathematica does not like underscores so they are converted to U like mathematica does for Java. This means that your query contents are converted from symbols to string but this has not impact on the data except that the key with an underscore now has a U in it. (eg if you send weekly_revenue it looks like weeklyUrevenue in the datadrop)
|
10
|
+
|
9
11
|
Test URL
|
10
12
|
=======
|
11
13
|
http://wolfr.am/4PZWVcDT
|
data/lib/wolfram_databin/base.rb
CHANGED
@@ -47,8 +47,7 @@ module WolframDatabin
|
|
47
47
|
Timeout::timeout(40) do
|
48
48
|
# @uri=URI.parse(self.get_url)
|
49
49
|
q=self.get_url + Hurley::Query::Flat.new(qdata).to_s
|
50
|
-
puts "url
|
51
|
-
puts "uri #{@uri} query #{qdata}" if self.debug_flag
|
50
|
+
puts "url #{q} query #{qdata}" if self.debug_flag
|
52
51
|
res=Hurley.get(q)
|
53
52
|
end
|
54
53
|
rescue Exception => e
|
data/test/coverage/index.html
CHANGED
@@ -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-07-18T10:
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2015-07-18T10:50:25+08:00">2015-07-18T10:50:25+08:00</abbr></div>
|
18
18
|
<ul class="group_tabs"></ul>
|
19
19
|
|
20
20
|
<div id="content">
|
data/test/test_wolfram.rb
CHANGED
@@ -22,6 +22,15 @@ class WolframDatabinTest < Minitest::Test
|
|
22
22
|
def test_datadrop_url
|
23
23
|
assert @dbin.datadrop_url=="http://wolfr.am/4PZWVcDT", "should have short id #{@dbin.datadrop_url}"
|
24
24
|
end
|
25
|
+
def test_query_fixer
|
26
|
+
time=Time.now
|
27
|
+
query= {time: time, new_time: time }
|
28
|
+
res=@dbin.fix_query(query)
|
29
|
+
assert res[:time]==nil, "symbol to string unchanged"
|
30
|
+
assert res['time']==time, "time unchanged"
|
31
|
+
assert res[:new_time]==nil, "new time nil"
|
32
|
+
assert res['newUtime']==time, "new time has U rather than underscore"
|
33
|
+
end
|
25
34
|
|
26
35
|
def test_postdatabin
|
27
36
|
time=Time.now
|