tigre-client 0.2.3 → 0.2.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.
- data/Gemfile.lock +1 -1
- data/lib/tigre-client/url.rb +25 -1
- data/lib/tigre-client/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/lib/tigre-client/url.rb
CHANGED
|
@@ -38,6 +38,26 @@ module Tigre
|
|
|
38
38
|
Tigre.put_connection("/urls/#{sha256}", update_data )
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
# required
|
|
42
|
+
# sha256 => String
|
|
43
|
+
# tags => String => I.E 'foo'
|
|
44
|
+
# tags => String (comma seperated) => I.E 'foo,bar,baz'
|
|
45
|
+
# tags => Array => ['foo', 'bar', 'baz']
|
|
46
|
+
def self.add_tags(sha256, tags)
|
|
47
|
+
if sha256 == '' || tags == ''
|
|
48
|
+
raise ArguementError, "Missing tags parameter"
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
if tags.is_a?(Array)
|
|
52
|
+
tags = tags.map {|t| t.strip}.join(',')
|
|
53
|
+
else
|
|
54
|
+
tags = tags.split(',').map {|t| t.strip}.join(',')
|
|
55
|
+
end
|
|
56
|
+
update_data = {"tag_list" => tags}
|
|
57
|
+
|
|
58
|
+
Tigre.put_connection("/urls/#{sha256}/add_tags", update_data)
|
|
59
|
+
end
|
|
60
|
+
|
|
41
61
|
# required params
|
|
42
62
|
# sha256 => String
|
|
43
63
|
def self.get(sha256)
|
|
@@ -125,7 +145,11 @@ module Tigre
|
|
|
125
145
|
raise ArguementError, "Missing tags parameter"
|
|
126
146
|
end
|
|
127
147
|
|
|
128
|
-
|
|
148
|
+
if tags.is_a?(Array)
|
|
149
|
+
tags = tags.map {|t| t.strip}.join(',')
|
|
150
|
+
else
|
|
151
|
+
tags = tags.split(',').map {|t| t.strip}.join(',')
|
|
152
|
+
end
|
|
129
153
|
|
|
130
154
|
options[:page] ||= 0
|
|
131
155
|
options[:per] ||= 50
|
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.4
|
|
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-11 00:00:00 -04:00
|
|
15
15
|
default_executable:
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|