tigre-client 0.2.1 → 0.2.2

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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tigre-client (0.1.2)
4
+ tigre-client (0.2.1)
5
5
  curb (~> 0.7.12)
6
6
  faraday (~> 0.6.0)
7
7
 
@@ -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
@@ -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)
@@ -35,7 +35,6 @@ module Tigre
35
35
  end
36
36
 
37
37
  update_data = params_hash.map { |k, v| {"url[#{k.to_s}]" => v.to_s} }
38
-
39
38
  Tigre.put_connection("/urls/#{sha256}", update_data )
40
39
  end
41
40
 
@@ -1,5 +1,5 @@
1
1
  module Tigre
2
2
  module Client
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
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.1
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-07 00:00:00 -04:00
14
+ date: 2011-04-08 00:00:00 -04:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency