haystack_ruby 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/haystack_ruby/project.rb +16 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6c6b9cdc1447c63ec9e4389027df52d9895c659
4
- data.tar.gz: 5f49ee6b99c204c65b3b8553c1e71b802e61fc32
3
+ metadata.gz: 2d0e2bed842c96f4061b199e1a1fc9e5248c0bb6
4
+ data.tar.gz: 76316b879e553e351cbc2c1dab191b74d730f889
5
5
  SHA512:
6
- metadata.gz: 8b476a3f16801e3b26f1db1f88694edafe3c53d5e4674523500031f621e3235f6b73033db3d6f79888cec58696cc0809d54c4b7701d2c29bf826c97a19784907
7
- data.tar.gz: 43faa8a880a29efc9ef66f526668c58cc9bbff9351a73abbee82e5adfcd2ff0218da6a75853997963faf4eb5ad85af8f4c0d61294d3c293c150a790e99c5d93f
6
+ metadata.gz: 98fed0716b8654e53ecbda1b45cac614b6fa5941ed64366b2a6e2e591384bbcb55e8e112a84fadea8c650b07a914ce7f8315a4c749ce8f67b2ea8c69045627c6
7
+ data.tar.gz: 35a878fddd0ffaf122458c54462fb6cccc2aca9732262186b797e7355b1a6c8cd09e1ad51237805c91f98f57dcd1cf21a4a2839963f264302b69e49cea5701df
@@ -60,9 +60,21 @@ module HaystackRuby
60
60
  JSON.parse! res.body
61
61
  end
62
62
 
63
+ # this function will post expr_str exactly as encoded
64
+ def api_eval(expr_str)
65
+ body = ["ver:\"#{@haystack_version}\""]
66
+ body << "expr"
67
+ body << '"'+expr_str+'"'
68
+ res = self.connection.post('eval') do |req|
69
+ req.headers['Content-Type'] = 'text/plain'
70
+ req.body = body.join("\n")
71
+ end
72
+ JSON.parse! res.body
73
+ end
74
+
63
75
  # return meta data for all equip with related points
64
76
  def equip_point_meta
65
- # begin
77
+ begin
66
78
  equips = read({filter: '"equip"'})['rows']
67
79
  puts equips
68
80
  equips.map! do |eq|
@@ -86,10 +98,10 @@ module HaystackRuby
86
98
  end
87
99
  eq
88
100
  end
89
- # rescue Exception => e
101
+ rescue Exception => e
90
102
  puts "error: #{e}"
91
103
  nil
92
- # end
104
+ end
93
105
  end
94
106
 
95
107
  def ops
@@ -156,4 +168,4 @@ module HaystackRuby
156
168
  # end
157
169
  # end
158
170
  end
159
- end
171
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haystack_ruby
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
  - Anya Petersen