wolfram_databin 0.1.5 → 0.1.6

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: d3c591593d5542f99e0161f8fe29e69d61affc0d
4
- data.tar.gz: 4ff955b436ac6d383d30da91ebd1b2e505992732
3
+ metadata.gz: 8c11aa15793a4bd322d15f9567e1a5968d5fb2d8
4
+ data.tar.gz: d22e3329811df6a3770f1dfeee2d2e69c6c37054
5
5
  SHA512:
6
- metadata.gz: 89b2327ab1313eabce769a7c84955217fedd7c5963fbe816ae6992c14cedf7258eea91fb9556036bfd8cefcc9c36723249fa3680296adbcc713e9b32c65182cd
7
- data.tar.gz: 22d17c7ebf03c8ad2f8186d6bd2a257f9ae61422ea455b05200c42559d64daf122966f94a1676b3c1715a138956a206a7c68e5a0d17ec7fe9bc2f7fb1669188c
6
+ metadata.gz: 85a8d682fa86c4fe349f361163cf318d7e8ef4a01cdcb8a5f898d23853d69e45b748df46044e0d1a110ca585ad86c8a7f5a578f20dd2ebd7186ed6fd489bcb43
7
+ data.tar.gz: c9023ddf702dcb57e7004abba9575f072ff27bb79873592b15e944e4ff89f852f0382b2226920c715e90dedc675c302e2a8334610a4004ae7ab2046a78e87133
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wolfram_databin (0.1.4)
4
+ wolfram_databin (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'hurley'
3
3
  module WolframDatabin
4
4
  class Base
5
- attr_accessor :shortid, :uri, :debug_flag
5
+ attr_accessor :shortid, :uri, :debug_flag, :clnt
6
6
 
7
7
  def set_shortid(atid)
8
8
  self.shortid=atid
@@ -20,6 +20,9 @@ module WolframDatabin
20
20
  url="https://datadrop.wolframcloud.com/api/v1.0/Add?"
21
21
  url
22
22
  end
23
+ def get_url2
24
+ "https://datadrop.wolframcloud.com/api/v1.0"
25
+ end
23
26
  def self.submit_data(tshortid,aquery)
24
27
  dbin=WolframDatabin::Base.new
25
28
  dbin.submit_data(tshortid,aquery)
@@ -39,17 +42,29 @@ module WolframDatabin
39
42
  res=self.post_data(aquery)
40
43
  res
41
44
  end
45
+ def build_client
46
+ if @clnt==nil then
47
+ # @clnt=HTTPClient.new
48
+ @clnt=Hurley::Client.new self.get_url2
49
+ end
50
+ @clnt
51
+ end
42
52
  def post_data(query)
43
53
  raise "short id not set" if self.shortid==nil
44
54
  res=''
45
55
  qdata={bin: self.shortid}.merge(self.fix_query(query))
46
56
  begin
47
- Timeout::timeout(40) do
57
+ timeout=40
48
58
  # @uri=URI.parse(self.get_url)
49
- q=self.get_url + Hurley::Query::Flat.new(qdata).to_s
50
- puts "url #{q} query #{qdata}" if self.debug_flag
51
- res=Hurley.get(q)
52
- end
59
+ # c = Hurley::Client.new "https://datadrop.wolframcloud.com/api/v1.0"
60
+ # c.get "Add", :time => Time.now.iso8601, :fred => "hello"
61
+ # q=self.get_url + Hurley::Query::Flat.new(qdata).to_s
62
+ # puts "url #{q} query #{qdata}" if self.debug_flag
63
+ # res=Hurley.get(q)
64
+ @clnt=self.build_client
65
+ @clnt.request_options.timeout = timeout # set to 60
66
+
67
+ res=@clnt.get "Add", qdata
53
68
  rescue Exception => e
54
69
  puts "Exception: #{e.inspect}"
55
70
  ensure
@@ -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-19T09:37:57+08:00">2015-07-19T09:37:57+08:00</abbr></div>
17
+ <div class="timestamp">Generated <abbr class="timeago" title="2015-09-06T09:12:11+08:00">2015-09-06T09:12:11+08:00</abbr></div>
18
18
  <ul class="group_tabs"></ul>
19
19
 
20
20
  <div id="content">
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.5
4
+ version: 0.1.6
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-07-19 00:00:00.000000000 Z
11
+ date: 2015-09-06 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