tigre-client 0.3.0 → 0.3.1
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/sample.rb +69 -3
- data/lib/tigre-client/url.rb +31 -0
- data/lib/tigre-client/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/lib/tigre-client/sample.rb
CHANGED
@@ -85,6 +85,8 @@ module Tigre
|
|
85
85
|
# tags => Array => ['foo', 'bar', 'baz']
|
86
86
|
# optional params
|
87
87
|
# options => Hash
|
88
|
+
# :after => Ruby DateTime object OR Integer (epoch time)
|
89
|
+
# :before => Ruby DateTime object OR Integer (epoch time)
|
88
90
|
# :page => Integer, :default => 0
|
89
91
|
# :per => Integer, :default => 50
|
90
92
|
def self.tagged_with(tags, options={})
|
@@ -94,7 +96,38 @@ module Tigre
|
|
94
96
|
|
95
97
|
common_params(options)
|
96
98
|
tags = package_array_list(tags)
|
97
|
-
Tigre.get_connection("/samples/tagged_with?tags=#{tags}&page=#{@page}&per=#{@per}")
|
99
|
+
Tigre.get_connection("/samples/tagged_with?tags=#{tags}&after=#{@after}&before=#{@before}&page=#{@page}&per=#{@per}")
|
100
|
+
end
|
101
|
+
|
102
|
+
# required params
|
103
|
+
# tags => String => I.E 'foo'
|
104
|
+
# tags => String (comma seperated) => I.E 'foo,bar,baz'
|
105
|
+
# tags => Array => ['foo', 'bar', 'baz']
|
106
|
+
# optional params
|
107
|
+
# options => Hash
|
108
|
+
# :after => Ruby DateTime object OR Integer (epoch time)
|
109
|
+
# :before => Ruby DateTime object OR Integer (epoch time)
|
110
|
+
# :page => Integer, :default => 0
|
111
|
+
# :per => Integer, :default => 50
|
112
|
+
def self.not_tagged_with(tags, options={})
|
113
|
+
if tags == ''
|
114
|
+
raise "Missing tags parameter"
|
115
|
+
end
|
116
|
+
|
117
|
+
tags = package_array_list(tags)
|
118
|
+
common_params(options)
|
119
|
+
Tigre.get_connection("/samples/not_tagged_with?tags=#{tags}&after=#{@after}&before=#{@before}&page=#{@page}&per=#{@per}")
|
120
|
+
end
|
121
|
+
|
122
|
+
# optional params
|
123
|
+
# options => Hash
|
124
|
+
# :after => Ruby DateTime object OR Integer (epoch time)
|
125
|
+
# :before => Ruby DateTime object OR Integer (epoch time)
|
126
|
+
# :page => Integer, :default => 0
|
127
|
+
# :per => Integer, :default => 50
|
128
|
+
def self.not_tagged(options={})
|
129
|
+
common_params(options)
|
130
|
+
Tigre.get_connection("/samples/not_tagged?after=#{@after}&before=#{@before}&page=#{@page}&per=#{@per}")
|
98
131
|
end
|
99
132
|
|
100
133
|
# required
|
@@ -132,6 +165,8 @@ module Tigre
|
|
132
165
|
# tags => Array => ['foo', 'bar', 'baz']
|
133
166
|
# optional params
|
134
167
|
# options => Hash
|
168
|
+
# :after => Ruby DateTime object OR Integer (epoch time)
|
169
|
+
# :before => Ruby DateTime object OR Integer (epoch time)
|
135
170
|
# :page => Integer, :default => 0
|
136
171
|
# :per => Integer, :default => 50
|
137
172
|
def self.has_mime_type(mime_types, options={})
|
@@ -141,7 +176,38 @@ module Tigre
|
|
141
176
|
|
142
177
|
common_params(options)
|
143
178
|
mime_types = package_array_list(mime_types)
|
144
|
-
Tigre.get_connection("/samples/has_mime_type?mime_types=#{mime_types}&page=#{@page}&per=#{@per}")
|
179
|
+
Tigre.get_connection("/samples/has_mime_type?mime_types=#{mime_types}&after=#{@after}&before=#{@before}&page=#{@page}&per=#{@per}")
|
180
|
+
end
|
181
|
+
|
182
|
+
# required params
|
183
|
+
# tags => String => I.E 'foo'
|
184
|
+
# tags => String (comma seperated) => I.E 'foo,bar,baz'
|
185
|
+
# tags => Array => ['foo', 'bar', 'baz']
|
186
|
+
# optional params
|
187
|
+
# options => Hash
|
188
|
+
# :after => Ruby DateTime object OR Integer (epoch time)
|
189
|
+
# :before => Ruby DateTime object OR Integer (epoch time)
|
190
|
+
# :page => Integer, :default => 0
|
191
|
+
# :per => Integer, :default => 50
|
192
|
+
def self.without_mime_type(mime_types, options={})
|
193
|
+
if mime_types == ''
|
194
|
+
raise "Missing tags parameter"
|
195
|
+
end
|
196
|
+
|
197
|
+
common_params(options)
|
198
|
+
mime_types = package_array_list(mime_types)
|
199
|
+
Tigre.get_connection("/samples/without_mime_type?mime_types=#{mime_types}&after=#{@after}&before=#{@before}&page=#{@page}&per=#{@per}")
|
200
|
+
end
|
201
|
+
|
202
|
+
# optional params
|
203
|
+
# options => Hash
|
204
|
+
# :after => Ruby DateTime object OR Integer (epoch time)
|
205
|
+
# :before => Ruby DateTime object OR Integer (epoch time)
|
206
|
+
# :page => Integer, :default => 0
|
207
|
+
# :per => Integer, :default => 50
|
208
|
+
def self.no_mime_type(options={})
|
209
|
+
common_params(options)
|
210
|
+
Tigre.get_connection("/samples/no_mime_type?after=#{@after}&before=#{@before}&page=#{@page}&per=#{@per}")
|
145
211
|
end
|
146
212
|
|
147
213
|
# required params
|
@@ -149,7 +215,7 @@ module Tigre
|
|
149
215
|
# :digest => String, The digest type
|
150
216
|
# :value => String, The digest value
|
151
217
|
# :mime_type_list => String (comma seperated) => I.E 'foo,bar,baz'
|
152
|
-
# :mime_type_list => Array => ['foo', 'bar', 'baz']
|
218
|
+
# :mime_type_list => Array => ['foo', 'bar', 'baz']
|
153
219
|
def self.add_mime_type(hash)
|
154
220
|
unless hash[:digest] && hash[:value] && hash[:mime_type_list]
|
155
221
|
raise 'Missing parameter :digest or :value or :mime_type_list'
|
data/lib/tigre-client/url.rb
CHANGED
@@ -173,6 +173,37 @@ module Tigre
|
|
173
173
|
Tigre.put_connection("/urls/#{hash[:digest]}/value/#{hash[:value]}/remove_tags", update_data)
|
174
174
|
end
|
175
175
|
|
176
|
+
# required params
|
177
|
+
# tags => String => I.E 'foo'
|
178
|
+
# tags => String (comma seperated) => I.E 'foo,bar,baz'
|
179
|
+
# tags => Array => ['foo', 'bar', 'baz']
|
180
|
+
# optional params
|
181
|
+
# options => Hash
|
182
|
+
# :after => Ruby DateTime object OR Integer (epoch time)
|
183
|
+
# :before => Ruby DateTime object OR Integer (epoch time)
|
184
|
+
# :page => Integer, :default => 0
|
185
|
+
# :per => Integer, :default => 50
|
186
|
+
def self.not_tagged_with(tags, options={})
|
187
|
+
if tags == ''
|
188
|
+
raise "Missing tags parameter"
|
189
|
+
end
|
190
|
+
|
191
|
+
tags = package_array_list(tags)
|
192
|
+
common_params(options)
|
193
|
+
Tigre.get_connection("/urls/not_tagged_with?tags=#{tags}&after=#{@after}&before=#{@before}&page=#{@page}&per=#{@per}")
|
194
|
+
end
|
195
|
+
|
196
|
+
# optional params
|
197
|
+
# options => Hash
|
198
|
+
# :after => Ruby DateTime object OR Integer (epoch time)
|
199
|
+
# :before => Ruby DateTime object OR Integer (epoch time)
|
200
|
+
# :page => Integer, :default => 0
|
201
|
+
# :per => Integer, :default => 50
|
202
|
+
def self.not_tagged(options={})
|
203
|
+
common_params(options)
|
204
|
+
Tigre.get_connection("/urls/not_tagged?after=#{@after}&before=#{@before}&page=#{@page}&per=#{@per}")
|
205
|
+
end
|
206
|
+
|
176
207
|
end
|
177
208
|
|
178
209
|
end
|
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.3.
|
5
|
+
version: 0.3.1
|
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-27 00:00:00 -04:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|