totter 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/totter/client/choices.rb +18 -1
- data/lib/totter/version.rb +1 -1
- data/test/totter/client/choices_test.rb +5 -0
- metadata +16 -7
- checksums.yaml +0 -7
@@ -76,10 +76,27 @@ module Totter
|
|
76
76
|
# @param choice_id [Numeric] The choice's id
|
77
77
|
# @return [Boolean] True if follow was successful, false otherwise.
|
78
78
|
# @example
|
79
|
-
# Totter.destroy_choice(1, 1)
|
79
|
+
# Totter.destroy_choice(1, 1, 1)
|
80
80
|
def destroy_choice(user_id, decision_id, choice_id)
|
81
81
|
boolean_from_response(:delete, "users/#{user_id}/decisions/#{decision_id}/choices/#{choice_id}")
|
82
82
|
end
|
83
|
+
|
84
|
+
# Crop a choice
|
85
|
+
#
|
86
|
+
# @param user_id [Numeric] The choice's decision's user id
|
87
|
+
# @param decision_id [Numeric] The choice's decision's id
|
88
|
+
# @param choice_id [Numeric] The choice's id
|
89
|
+
# @param x [Numeric] The x position of the start point
|
90
|
+
# @param y [Numeric] the y position of the start point
|
91
|
+
# @param width [Numeric] The crop width
|
92
|
+
# @param height [Numeric] The crop height
|
93
|
+
# @return [Boolean] True if follow was successful, false otherwise.
|
94
|
+
# @example
|
95
|
+
# Totter.crop_choice(1, 1, 1, 0, 0, 300, 300)
|
96
|
+
def crop_choice(user_id, decision_id, choice_id, x, y, width, height)
|
97
|
+
data = { x: x, y: y, height: height, width: width }
|
98
|
+
boolean_from_response(:post, "users/#{user_id}/decisions/#{decision_id}/choices/#{choice_id}/crop", data)
|
99
|
+
end
|
83
100
|
end
|
84
101
|
end
|
85
102
|
end
|
data/lib/totter/version.rb
CHANGED
@@ -50,4 +50,9 @@ class ChoicesTest < Totter::TestCase
|
|
50
50
|
assert client.destroy_choice(decision.user_id, decision.id, choice.id)
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
def test_choice_crop
|
55
|
+
stub_request(:post, 'http://localhost:5000/v1/users/1/decisions/1/choices/1/crop').with(body: hash_including({x: 1, y: 0, width: 400, height: 500})).to_return(:status => 200)
|
56
|
+
assert local_client.crop_choice(1, 1, 1, 1, 0, 400, 500)
|
57
|
+
end
|
53
58
|
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: totter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Sam Soffes
|
@@ -10,11 +11,12 @@ authors:
|
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
|
-
date: 2013-
|
14
|
+
date: 2013-06-03 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: multi_json
|
17
18
|
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
18
20
|
requirements:
|
19
21
|
- - ~>
|
20
22
|
- !ruby/object:Gem::Version
|
@@ -22,6 +24,7 @@ dependencies:
|
|
22
24
|
type: :runtime
|
23
25
|
prerelease: false
|
24
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
25
28
|
requirements:
|
26
29
|
- - ~>
|
27
30
|
- !ruby/object:Gem::Version
|
@@ -29,6 +32,7 @@ dependencies:
|
|
29
32
|
- !ruby/object:Gem::Dependency
|
30
33
|
name: hashie
|
31
34
|
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
32
36
|
requirements:
|
33
37
|
- - ~>
|
34
38
|
- !ruby/object:Gem::Version
|
@@ -36,6 +40,7 @@ dependencies:
|
|
36
40
|
type: :runtime
|
37
41
|
prerelease: false
|
38
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
39
44
|
requirements:
|
40
45
|
- - ~>
|
41
46
|
- !ruby/object:Gem::Version
|
@@ -139,26 +144,30 @@ files:
|
|
139
144
|
homepage: https://github.com/seesawco/totter-rb
|
140
145
|
licenses:
|
141
146
|
- MIT
|
142
|
-
metadata: {}
|
143
147
|
post_install_message:
|
144
148
|
rdoc_options: []
|
145
149
|
require_paths:
|
146
150
|
- lib
|
147
151
|
required_ruby_version: !ruby/object:Gem::Requirement
|
152
|
+
none: false
|
148
153
|
requirements:
|
149
|
-
- - '>='
|
154
|
+
- - ! '>='
|
150
155
|
- !ruby/object:Gem::Version
|
151
156
|
version: 1.8.7
|
152
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
|
+
none: false
|
153
159
|
requirements:
|
154
|
-
- - '>='
|
160
|
+
- - ! '>='
|
155
161
|
- !ruby/object:Gem::Version
|
156
162
|
version: '0'
|
163
|
+
segments:
|
164
|
+
- 0
|
165
|
+
hash: -3197998665984250808
|
157
166
|
requirements: []
|
158
167
|
rubyforge_project:
|
159
|
-
rubygems_version:
|
168
|
+
rubygems_version: 1.8.23
|
160
169
|
signing_key:
|
161
|
-
specification_version:
|
170
|
+
specification_version: 3
|
162
171
|
summary: Ruby gem for working with the Seesaw API.
|
163
172
|
test_files:
|
164
173
|
- test/cassettes/avatars/create.yml
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 077243f17198f8987481a35be493c0b93e47fff2
|
4
|
-
data.tar.gz: 28854a996e1bb0a3e79996d1129c95e4ab11f74c
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: b2f803da2c2134963f18c01eb107208c778caf38050c43a267ca5243e56aee67d9d2657c4f15d4766e8c901efb43f16666b6246a9a64c27f38a0f03f4499209e
|
7
|
-
data.tar.gz: cf113ff4eb35c5c8ee690b9da8c96a21108f51c410d7a4a3b4b6668dbcc94b302c33b96e8f24a39701a479c66cd194bbb7d1e372f3f7d15a732de6956791d129
|