HackT 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 530dba1ddb1385a5d41664386653242dae82c07e
4
- data.tar.gz: c37833c68392f55cebe9a5dff5a3add36cf55cc0
3
+ metadata.gz: 946b0d3b901974387fdea9b0bc110cdf42ed9ddd
4
+ data.tar.gz: 1124d14361234821c85621ca2be7a00230f678b2
5
5
  SHA512:
6
- metadata.gz: add95dd78b54d584b11f128de37108f6f8c0530ad1c6a00210ae024e6b1f9a9df06134cf412505951ce8f29576c74c4085d1a935c541759de301f2a1a07e807a
7
- data.tar.gz: 50d061415e75b4ac987057b7025ecff82bdbbebbbf1d28944e5d607e32a27e60a1145e36200c5d0d80bbb5ccaeec60240ecb49dfc3793ea7c2354de727140c96
6
+ metadata.gz: 1057697362e95b9d2319e109ec481c23426ededf6fca394cfdf08011de3eb53bd690ac46de9c51870c1c62d7b8b1b96eaa3580370ff12eb8d51abaf70d58c8b7
7
+ data.tar.gz: 04f0fa391519b7bd724ff0217e7fb7088afee9e0a59af7402c926adaa091f32275cc35fd19a19a4aca47467f668e1000cf93cb9517a144bc42e3155da6979998
@@ -30,7 +30,7 @@
30
30
  <entry file="file://$PROJECT_DIR$/lib/HackT.rb">
31
31
  <provider selected="true" editor-type-id="text-editor">
32
32
  <state vertical-scroll-proportion="0.0">
33
- <caret line="9" column="0" selection-start-line="9" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
33
+ <caret line="6" column="18" selection-start-line="6" selection-start-column="18" selection-end-line="6" selection-end-column="18" />
34
34
  <folding />
35
35
  </state>
36
36
  </provider>
@@ -56,11 +56,11 @@
56
56
  </provider>
57
57
  </entry>
58
58
  </file>
59
- <file leaf-file-name="net.rb" pinned="false" current-in-tab="false">
59
+ <file leaf-file-name="net.rb" pinned="false" current-in-tab="true">
60
60
  <entry file="file://$PROJECT_DIR$/lib/hackt/net.rb">
61
61
  <provider selected="true" editor-type-id="text-editor">
62
- <state vertical-scroll-proportion="0.0">
63
- <caret line="2" column="22" selection-start-line="2" selection-start-column="22" selection-end-line="2" selection-end-column="22" />
62
+ <state vertical-scroll-proportion="0.7246377">
63
+ <caret line="28" column="12" selection-start-line="28" selection-start-column="12" selection-end-line="28" selection-end-column="12" />
64
64
  <folding />
65
65
  </state>
66
66
  </provider>
@@ -106,11 +106,11 @@
106
106
  </provider>
107
107
  </entry>
108
108
  </file>
109
- <file leaf-file-name="request.rb" pinned="false" current-in-tab="true">
109
+ <file leaf-file-name="request.rb" pinned="false" current-in-tab="false">
110
110
  <entry file="file://$PROJECT_DIR$/lib/hackt/request.rb">
111
111
  <provider selected="true" editor-type-id="text-editor">
112
- <state vertical-scroll-proportion="0.74019605">
113
- <caret line="158" column="46" selection-start-line="158" selection-start-column="46" selection-end-line="158" selection-end-column="46" />
112
+ <state vertical-scroll-proportion="0.0">
113
+ <caret line="170" column="36" selection-start-line="170" selection-start-column="36" selection-end-line="170" selection-end-column="36" />
114
114
  <folding />
115
115
  </state>
116
116
  </provider>
@@ -137,13 +137,13 @@
137
137
  <option value="$PROJECT_DIR$/Rakefile" />
138
138
  <option value="$PROJECT_DIR$/lib/hackt/error.rb" />
139
139
  <option value="$PROJECT_DIR$/bin/game" />
140
- <option value="$PROJECT_DIR$/lib/hackt/net.rb" />
141
140
  <option value="$PROJECT_DIR$/lib/hackt.rb" />
142
141
  <option value="$PROJECT_DIR$/HackT.gemspec" />
143
142
  <option value="$PROJECT_DIR$/bin/console" />
144
143
  <option value="$PROJECT_DIR$/Gemfile" />
145
144
  <option value="$PROJECT_DIR$/lib/HackT.rb" />
146
145
  <option value="$PROJECT_DIR$/lib/hackt/request.rb" />
146
+ <option value="$PROJECT_DIR$/lib/hackt/net.rb" />
147
147
  </list>
148
148
  </option>
149
149
  </component>
@@ -249,8 +249,8 @@
249
249
  </PATH>
250
250
  </subPane>
251
251
  </pane>
252
- <pane id="Scope" />
253
252
  <pane id="Scratches" />
253
+ <pane id="Scope" />
254
254
  </panes>
255
255
  </component>
256
256
  <component name="PropertiesComponent">
@@ -432,28 +432,28 @@
432
432
  </component>
433
433
  <component name="ToolWindowManager">
434
434
  <frame x="65" y="24" width="1615" height="1026" extended-state="6" />
435
- <editor active="true" />
435
+ <editor active="false" />
436
436
  <layout>
437
- <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3197492" sideWeight="0.734863" order="7" side_tool="false" content_ui="tabs" />
437
+ <window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3197492" sideWeight="0.7272148" order="7" side_tool="false" content_ui="tabs" />
438
438
  <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32938644" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
439
439
  <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
440
- <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2530274" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
440
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2530274" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
441
441
  <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
442
442
  <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
443
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2753346" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
443
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.27852136" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
444
444
  <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
445
- <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3291536" sideWeight="0.3499044" order="7" side_tool="true" content_ui="tabs" />
445
+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3197492" sideWeight="0.27278522" order="7" side_tool="true" content_ui="tabs" />
446
446
  <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
447
447
  <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
448
448
  <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
449
- <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32938644" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
450
449
  <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
450
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32938644" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
451
451
  <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
452
452
  <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32948583" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
453
453
  <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
454
- <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3291536" sideWeight="0.6500956" order="2" side_tool="false" content_ui="tabs" />
455
- <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
456
454
  <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
455
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
456
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3291536" sideWeight="0.6500956" order="2" side_tool="false" content_ui="tabs" />
457
457
  <window_info id="Thumbnails" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32948583" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
458
458
  </layout>
459
459
  </component>
@@ -796,14 +796,6 @@
796
796
  </state>
797
797
  </provider>
798
798
  </entry>
799
- <entry file="file://$PROJECT_DIR$/lib/hackt/error.rb">
800
- <provider selected="true" editor-type-id="text-editor">
801
- <state vertical-scroll-proportion="0.0">
802
- <caret line="2" column="2" selection-start-line="2" selection-start-column="2" selection-end-line="2" selection-end-column="2" />
803
- <folding />
804
- </state>
805
- </provider>
806
- </entry>
807
799
  <entry file="file://$PROJECT_DIR$/bin/setup">
808
800
  <provider selected="true" editor-type-id="text-editor">
809
801
  <state vertical-scroll-proportion="0.0">
@@ -836,18 +828,18 @@
836
828
  </state>
837
829
  </provider>
838
830
  </entry>
839
- <entry file="file://$PROJECT_DIR$/HackT.gemspec">
831
+ <entry file="file://$PROJECT_DIR$/bin/console">
840
832
  <provider selected="true" editor-type-id="text-editor">
841
833
  <state vertical-scroll-proportion="0.0">
842
- <caret line="18" column="62" selection-start-line="18" selection-start-column="62" selection-end-line="18" selection-end-column="62" />
834
+ <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
843
835
  <folding />
844
836
  </state>
845
837
  </provider>
846
838
  </entry>
847
- <entry file="file://$PROJECT_DIR$/lib/hackt/net.rb">
839
+ <entry file="file://$PROJECT_DIR$/HackT.gemspec">
848
840
  <provider selected="true" editor-type-id="text-editor">
849
841
  <state vertical-scroll-proportion="0.0">
850
- <caret line="2" column="22" selection-start-line="2" selection-start-column="22" selection-end-line="2" selection-end-column="22" />
842
+ <caret line="18" column="62" selection-start-line="18" selection-start-column="62" selection-end-line="18" selection-end-column="62" />
851
843
  <folding />
852
844
  </state>
853
845
  </provider>
@@ -855,23 +847,31 @@
855
847
  <entry file="file://$PROJECT_DIR$/lib/HackT.rb">
856
848
  <provider selected="true" editor-type-id="text-editor">
857
849
  <state vertical-scroll-proportion="0.0">
858
- <caret line="9" column="0" selection-start-line="9" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
850
+ <caret line="6" column="18" selection-start-line="6" selection-start-column="18" selection-end-line="6" selection-end-column="18" />
859
851
  <folding />
860
852
  </state>
861
853
  </provider>
862
854
  </entry>
863
- <entry file="file://$PROJECT_DIR$/bin/console">
855
+ <entry file="file://$PROJECT_DIR$/lib/hackt/error.rb">
864
856
  <provider selected="true" editor-type-id="text-editor">
865
857
  <state vertical-scroll-proportion="0.0">
866
- <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
858
+ <caret line="2" column="2" selection-start-line="2" selection-start-column="2" selection-end-line="2" selection-end-column="2" />
867
859
  <folding />
868
860
  </state>
869
861
  </provider>
870
862
  </entry>
871
863
  <entry file="file://$PROJECT_DIR$/lib/hackt/request.rb">
872
864
  <provider selected="true" editor-type-id="text-editor">
873
- <state vertical-scroll-proportion="0.74019605">
874
- <caret line="158" column="46" selection-start-line="158" selection-start-column="46" selection-end-line="158" selection-end-column="46" />
865
+ <state vertical-scroll-proportion="0.0">
866
+ <caret line="170" column="36" selection-start-line="170" selection-start-column="36" selection-end-line="170" selection-end-column="36" />
867
+ <folding />
868
+ </state>
869
+ </provider>
870
+ </entry>
871
+ <entry file="file://$PROJECT_DIR$/lib/hackt/net.rb">
872
+ <provider selected="true" editor-type-id="text-editor">
873
+ <state vertical-scroll-proportion="0.7246377">
874
+ <caret line="28" column="12" selection-start-line="28" selection-start-column="12" selection-end-line="28" selection-end-column="12" />
875
875
  <folding />
876
876
  </state>
877
877
  </provider>
@@ -4,6 +4,6 @@ module HackT
4
4
  require 'hackt/request'
5
5
 
6
6
 
7
- VERSION = '0.0.3'
7
+ VERSION = '0.0.4'
8
8
  URL = 'http://melgarn.xyz/'
9
9
  end
@@ -4,7 +4,7 @@ module HackT
4
4
  require 'json'
5
5
  class << self
6
6
 
7
- def Get(uri, params, prevent_errors = false)
7
+ def Get(uri, params, prevent_errors = true)
8
8
  uri = URI(HackT::URL + uri)
9
9
  uri.query = URI.encode_www_form(params)
10
10
  response = Net::HTTP.get_response(uri)
@@ -14,9 +14,11 @@ module HackT
14
14
  else
15
15
  raise HackT::HackTError, "Not OK: #{response.inspect}" unless prevent_errors
16
16
  end
17
+ rescue
18
+ raise HackT::HackTError, "Not OK: #{response.inspect}" unless prevent_errors
17
19
  end
18
20
 
19
- def Post(uri, params, prevent_errors = false)
21
+ def Post(uri, params, prevent_errors = true)
20
22
  uri = URI(HackT::URL + uri)
21
23
  response = Net::HTTP.post_form(uri, params)
22
24
  if response.is_a?(Net::HTTPSuccess)
@@ -24,6 +26,8 @@ module HackT
24
26
  else
25
27
  raise "Not OK: #{response.inspect}" unless prevent_errors
26
28
  end
29
+ rescue
30
+ raise HackT::HackTError, "Not OK: #{response.inspect}" unless prevent_errors
27
31
  end
28
32
 
29
33
  def Do(http)
@@ -164,6 +164,14 @@ module HackT
164
164
  HackTNet::Post '/process/end', auth_token: auth_token, process_id: process_id
165
165
  end
166
166
 
167
+ def IdShortInfo(auth_token, id)
168
+ HackTNet::Get '/player/short_info', auth_token: auth_token, id: id
169
+ end
170
+
171
+ def IpShortInfo(auth_token, ip)
172
+ HackTNet::Get '/player/short_info', auth_token: auth_token, ip: ip
173
+ end
174
+
167
175
  end
168
176
  end
169
177
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HackT
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - grig191
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-10 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler