tigre-client 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/tigre-client/occurrence.rb +10 -0
- data/lib/tigre-client/sample.rb +17 -0
- data/lib/tigre-client/url.rb +0 -1
- data/lib/tigre-client/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -18,5 +18,15 @@ module Tigre
|
|
18
18
|
Tigre.get_connection("/urls/#{sha256}/occurrences/#{occurrence_id}")
|
19
19
|
end
|
20
20
|
|
21
|
+
# updated an individual occurrence for a given sha256 URL
|
22
|
+
# required params
|
23
|
+
# sha256 - String
|
24
|
+
# occurrence_id - String
|
25
|
+
def self.update(sha256, occurrence_id, params_hash={})
|
26
|
+
raise ArguementError, "Missing sha256 parameter" if sha256 == ''
|
27
|
+
|
28
|
+
update_data = params_hash.map { |k, v| {"occurrence[#{k.to_s}]" => v.to_s} }
|
29
|
+
Tigre.put_connection("/urls/#{sha256}/occurrences/#{occurrence_id}", update_data)
|
30
|
+
end
|
21
31
|
end
|
22
32
|
end
|
data/lib/tigre-client/sample.rb
CHANGED
@@ -16,6 +16,23 @@ module Tigre
|
|
16
16
|
Tigre.post_file_connection('/samples', post_data.merge(options))
|
17
17
|
end
|
18
18
|
|
19
|
+
# optional params
|
20
|
+
# options - Hash
|
21
|
+
# :page - Integer, :default => 0
|
22
|
+
# :per - Integer, :default => 50
|
23
|
+
def self.index(options={})
|
24
|
+
options[:page] ||= 0
|
25
|
+
options[:per] ||= 50
|
26
|
+
Tigre.get_connection("/samples?page=#{options[:page]}&per=#{options[:per]}")
|
27
|
+
end
|
28
|
+
|
29
|
+
# required params
|
30
|
+
# md5 - String
|
31
|
+
def self.update(md5, params_hash={})
|
32
|
+
update_data = params_hash.map { |k, v| {"sample[#{k.to_s}]" => v.to_s} }
|
33
|
+
Tigre.put_connection("/samples/#{md5}", update_data)
|
34
|
+
end
|
35
|
+
|
19
36
|
# required params
|
20
37
|
# md5 - String
|
21
38
|
def self.md5(md5)
|
data/lib/tigre-client/url.rb
CHANGED
data/lib/tigre-client/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: tigre-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Marcio Castilho
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-04-
|
14
|
+
date: 2011-04-08 00:00:00 -04:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|