mmangino-facebooker 1.0.15 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +27 -16
- data/Rakefile +1 -1
- data/generators/facebook/templates/public/javascripts/facebooker.js +1 -8
- data/init.rb +3 -1
- data/lib/facebooker.rb +2 -1
- data/lib/facebooker/adapters/facebook_adapter.rb +4 -0
- data/lib/facebooker/mock/service.rb +50 -0
- data/lib/facebooker/mock/session.rb +18 -0
- data/lib/facebooker/model.rb +2 -2
- data/lib/facebooker/models/applicationrestrictions.rb +10 -0
- data/lib/facebooker/models/user.rb +33 -1
- data/lib/facebooker/models/video.rb +9 -0
- data/lib/facebooker/parser.rb +8 -1
- data/lib/facebooker/rails/controller.rb +15 -3
- data/lib/facebooker/rails/cucumber.rb +30 -0
- data/lib/facebooker/rails/cucumber/world.rb +46 -0
- data/lib/facebooker/rails/helpers.rb +203 -122
- data/lib/facebooker/rails/helpers/fb_connect.rb +25 -3
- data/lib/facebooker/rails/integration_session.rb +40 -0
- data/lib/facebooker/rails/publisher.rb +15 -2
- data/lib/facebooker/rails/test_helpers.rb +11 -26
- data/lib/facebooker/service.rb +6 -3
- data/lib/facebooker/session.rb +19 -1
- data/lib/tasks/tunnel.rake +2 -2
- data/test/{adapters_test.rb → facebooker/adapters_test.rb} +2 -4
- data/test/{facebook_admin_test.rb → facebooker/admin_test.rb} +2 -2
- data/test/{batch_request_test.rb → facebooker/batch_request_test.rb} +3 -2
- data/test/{facebook_data_test.rb → facebooker/data_test.rb} +2 -2
- data/test/{logging_test.rb → facebooker/logging_test.rb} +3 -3
- data/test/{model_test.rb → facebooker/model_test.rb} +2 -4
- data/test/{event_test.rb → facebooker/models/event_test.rb} +2 -2
- data/test/{user_test.rb → facebooker/models/user_test.rb} +10 -5
- data/test/{publisher_test.rb → facebooker/rails/publisher_test.rb} +12 -18
- data/test/{rails_integration_test.rb → facebooker/rails_integration_test.rb} +126 -115
- data/test/{facebook_cache_test.rb → facebooker/server_cache_test.rb} +1 -1
- data/test/{session_test.rb → facebooker/session_test.rb} +3 -2
- data/test/facebooker_test.rb +19 -1
- data/test/{http_multipart_post_test.rb → net/http_multipart_post_test.rb} +2 -4
- data/test/rails_test_helper.rb +11 -0
- data/test/test_helper.rb +2 -2
- metadata +28 -17
- data/lib/facebooker/rails/facebook_asset_path.rb +0 -18
data/Manifest.txt
CHANGED
@@ -41,7 +41,6 @@ generators/xd_receiver/xd_receiver_generator.rb
|
|
41
41
|
generators/xd_receiver/templates/xd_receiver.html
|
42
42
|
init.rb
|
43
43
|
install.rb
|
44
|
-
lib/facebooker.rb
|
45
44
|
lib/facebooker/adapters/adapter_base.rb
|
46
45
|
lib/facebooker/adapters/bebo_adapter.rb
|
47
46
|
lib/facebooker/adapters/facebook_adapter.rb
|
@@ -50,10 +49,13 @@ lib/facebooker/batch_request.rb
|
|
50
49
|
lib/facebooker/data.rb
|
51
50
|
lib/facebooker/feed.rb
|
52
51
|
lib/facebooker/logging.rb
|
52
|
+
lib/facebooker/mock/service.rb
|
53
|
+
lib/facebooker/mock/session.rb
|
53
54
|
lib/facebooker/model.rb
|
54
55
|
lib/facebooker/models/affiliation.rb
|
55
56
|
lib/facebooker/models/album.rb
|
56
57
|
lib/facebooker/models/applicationproperties.rb
|
58
|
+
lib/facebooker/models/applicationrestrictions.rb
|
57
59
|
lib/facebooker/models/cookie.rb
|
58
60
|
lib/facebooker/models/education_info.rb
|
59
61
|
lib/facebooker/models/event.rb
|
@@ -67,18 +69,23 @@ lib/facebooker/models/page.rb
|
|
67
69
|
lib/facebooker/models/photo.rb
|
68
70
|
lib/facebooker/models/tag.rb
|
69
71
|
lib/facebooker/models/user.rb
|
72
|
+
lib/facebooker/models/user.rb.orig
|
73
|
+
lib/facebooker/models/user.rb.rej
|
74
|
+
lib/facebooker/models/video.rb
|
70
75
|
lib/facebooker/models/work_info.rb
|
71
76
|
lib/facebooker/parser.rb
|
72
77
|
lib/facebooker/rails/controller.rb
|
73
|
-
lib/facebooker/rails/
|
78
|
+
lib/facebooker/rails/cucumber/world.rb
|
79
|
+
lib/facebooker/rails/cucumber.rb
|
74
80
|
lib/facebooker/rails/facebook_form_builder.rb
|
75
81
|
lib/facebooker/rails/facebook_pretty_errors.rb
|
76
82
|
lib/facebooker/rails/facebook_request_fix.rb
|
77
83
|
lib/facebooker/rails/facebook_session_handling.rb
|
78
84
|
lib/facebooker/rails/facebook_url_helper.rb
|
79
85
|
lib/facebooker/rails/facebook_url_rewriting.rb
|
80
|
-
lib/facebooker/rails/helpers.rb
|
81
86
|
lib/facebooker/rails/helpers/fb_connect.rb
|
87
|
+
lib/facebooker/rails/helpers.rb
|
88
|
+
lib/facebooker/rails/integration_session.rb
|
82
89
|
lib/facebooker/rails/profile_publisher_extensions.rb
|
83
90
|
lib/facebooker/rails/publisher.rb
|
84
91
|
lib/facebooker/rails/routing.rb
|
@@ -87,28 +94,32 @@ lib/facebooker/rails/utilities.rb
|
|
87
94
|
lib/facebooker/server_cache.rb
|
88
95
|
lib/facebooker/service.rb
|
89
96
|
lib/facebooker/session.rb
|
97
|
+
lib/facebooker/session.rb.orig
|
98
|
+
lib/facebooker/session.rb.rej
|
90
99
|
lib/facebooker/version.rb
|
100
|
+
lib/facebooker.rb
|
91
101
|
lib/net/http_multipart_post.rb
|
92
102
|
lib/tasks/facebooker.rake
|
93
103
|
lib/tasks/tunnel.rake
|
94
104
|
rails/init.rb
|
95
105
|
setup.rb
|
96
106
|
templates/layout.erb
|
97
|
-
test/adapters_test.rb
|
98
|
-
test/
|
99
|
-
test/
|
100
|
-
test/
|
101
|
-
test/
|
102
|
-
test/
|
107
|
+
test/facebooker/adapters_test.rb
|
108
|
+
test/facebooker/admin_test.rb
|
109
|
+
test/facebooker/batch_request_test.rb
|
110
|
+
test/facebooker/data_test.rb
|
111
|
+
test/facebooker/logging_test.rb
|
112
|
+
test/facebooker/model_test.rb
|
113
|
+
test/facebooker/models/event_test.rb
|
114
|
+
test/facebooker/models/user_test.rb
|
115
|
+
test/facebooker/rails/publisher_test.rb
|
116
|
+
test/facebooker/rails_integration_test.rb
|
117
|
+
test/facebooker/server_cache_test.rb
|
118
|
+
test/facebooker/session_test.rb
|
103
119
|
test/facebooker_test.rb
|
104
120
|
test/fixtures/multipart_post_body_with_only_parameters.txt
|
105
121
|
test/fixtures/multipart_post_body_with_single_file.txt
|
106
122
|
test/fixtures/multipart_post_body_with_single_file_that_has_nil_key.txt
|
107
|
-
test/http_multipart_post_test.rb
|
108
|
-
test/
|
109
|
-
test/model_test.rb
|
110
|
-
test/publisher_test.rb
|
111
|
-
test/rails_integration_test.rb
|
112
|
-
test/session_test.rb
|
123
|
+
test/net/http_multipart_post_test.rb
|
124
|
+
test/rails_test_helper.rb
|
113
125
|
test/test_helper.rb
|
114
|
-
test/user_test.rb
|
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ Hoe.new('facebooker', Facebooker::VERSION::STRING) do |p|
|
|
15
15
|
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
16
16
|
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
17
17
|
p.remote_rdoc_dir = '' # Release to root
|
18
|
-
p.test_globs = 'test
|
18
|
+
p.test_globs = 'test/**/*_test.rb'
|
19
19
|
p.extra_deps << ['json', '>= 1.0.0']
|
20
20
|
end
|
21
21
|
|
@@ -48,14 +48,7 @@ function encodeURIComponent(str) {
|
|
48
48
|
|
49
49
|
var Form = {};
|
50
50
|
Form.serialize = function(form_element) {
|
51
|
-
|
52
|
-
param_string="";
|
53
|
-
for (var name in elements) {
|
54
|
-
if (param_string)
|
55
|
-
param_string += "&";
|
56
|
-
param_string += encodeURIComponent(name)+"="+encodeURIComponent(elements[name]);
|
57
|
-
}
|
58
|
-
return param_string;
|
51
|
+
return $(form_element).serialize();
|
59
52
|
};
|
60
53
|
|
61
54
|
Ajax.Updater = function (container,url,options) {
|
data/init.rb
CHANGED
@@ -12,7 +12,6 @@ require 'net/http_multipart_post'
|
|
12
12
|
require 'facebooker/rails/controller'
|
13
13
|
require 'facebooker/rails/facebook_url_rewriting'
|
14
14
|
require 'facebooker/rails/facebook_session_handling'
|
15
|
-
require 'facebooker/rails/facebook_asset_path'
|
16
15
|
require 'facebooker/rails/facebook_request_fix'
|
17
16
|
require 'facebooker/rails/routing'
|
18
17
|
require 'facebooker/rails/facebook_pretty_errors' rescue nil
|
@@ -68,3 +67,6 @@ end
|
|
68
67
|
# pull :canvas=> into env in routing to allow for conditions
|
69
68
|
ActionController::Routing::RouteSet.send :include, Facebooker::Rails::Routing::RouteSetExtensions
|
70
69
|
ActionController::Routing::RouteSet::Mapper.send :include, Facebooker::Rails::Routing::MapperExtensions
|
70
|
+
|
71
|
+
Mime::Type.register_alias "text/html", :fbml
|
72
|
+
Mime::Type.register_alias "text/javascript", :fbjs
|
data/lib/facebooker.rb
CHANGED
@@ -100,7 +100,7 @@ module Facebooker
|
|
100
100
|
@timeout
|
101
101
|
end
|
102
102
|
|
103
|
-
[:api_key,:secret_key, :www_server_base_url,:login_url_base,:install_url_base,:api_rest_path,:api_server_base,:api_server_base_url,:canvas_server_base].each do |delegated_method|
|
103
|
+
[:api_key,:secret_key, :www_server_base_url,:login_url_base,:install_url_base,:api_rest_path,:api_server_base,:api_server_base_url,:canvas_server_base, :video_server_base].each do |delegated_method|
|
104
104
|
define_method(delegated_method){ return current_adapter.send(delegated_method)}
|
105
105
|
end
|
106
106
|
|
@@ -170,3 +170,4 @@ require 'facebooker/adapters/adapter_base'
|
|
170
170
|
require 'facebooker/adapters/facebook_adapter'
|
171
171
|
require 'facebooker/adapters/bebo_adapter'
|
172
172
|
require 'facebooker/models/friend_list'
|
173
|
+
require 'facebooker/models/video'
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'digest/md5'
|
2
|
+
require 'facebooker/service'
|
3
|
+
|
4
|
+
module Facebooker
|
5
|
+
# A mock service that reads the Facebook response from fixtures
|
6
|
+
# Adapted from http://gist.github.com/44344
|
7
|
+
#
|
8
|
+
# Facebooker::MockService.fixture_path = 'path/to/dir'
|
9
|
+
# Facebooker::Session.current = Facebooker::MockSession.create
|
10
|
+
#
|
11
|
+
class MockService < Service
|
12
|
+
class << self
|
13
|
+
attr_accessor :fixture_path
|
14
|
+
end
|
15
|
+
|
16
|
+
def read_fixture(method, filename, original = nil)
|
17
|
+
path = fixture_path(method, filename)
|
18
|
+
File.read path
|
19
|
+
rescue Errno::ENAMETOOLONG
|
20
|
+
read_fixture(method, hash_fixture_name(filename), filename)
|
21
|
+
rescue Errno::ENOENT => e
|
22
|
+
if File.exists?(fixture_path(method, 'default'))
|
23
|
+
File.read fixture_path(method, 'default')
|
24
|
+
else
|
25
|
+
e.message << "\n(Non-hashed path is #{original})" if original
|
26
|
+
e.message << "\nFacebook API Reference: http://wiki.developers.facebook.com/index.php/#{method.sub(/^facebook\./, '')}#Example_Return_XML"
|
27
|
+
raise e
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def post(params)
|
32
|
+
method = params.delete(:method)
|
33
|
+
params.delete_if {|k,_| [:v, :api_key, :call_id, :sig].include?(k) }
|
34
|
+
Parser.parse(method, read_fixture(method, fixture_name(params)))
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
def fixture_path(method, filename)
|
39
|
+
File.join(self.class.fixture_path, method, "#{filename}.xml")
|
40
|
+
end
|
41
|
+
|
42
|
+
def hash_fixture_name(filename)
|
43
|
+
Digest::MD5.hexdigest(filename)
|
44
|
+
end
|
45
|
+
|
46
|
+
def fixture_name(params)
|
47
|
+
params.map {|*args| args.join('=') }.sort.join('&')
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'facebooker/session'
|
2
|
+
|
3
|
+
module Facebooker
|
4
|
+
class MockSession < Session
|
5
|
+
def secured?
|
6
|
+
true
|
7
|
+
end
|
8
|
+
|
9
|
+
def secure!
|
10
|
+
@uid = 1
|
11
|
+
true
|
12
|
+
end
|
13
|
+
|
14
|
+
def service
|
15
|
+
@service ||= MockService.new(Facebooker.api_server_base, Facebooker.api_rest_path, @api_key)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/facebooker/model.rb
CHANGED
@@ -122,7 +122,7 @@ module Facebooker
|
|
122
122
|
unless hash.nil? || hash.empty?
|
123
123
|
hash.each do |key, value|
|
124
124
|
set_attr_method = "#{key}="
|
125
|
-
if !value.nil?
|
125
|
+
if !value.nil? && respond_to?(set_attr_method)
|
126
126
|
self.__send__(set_attr_method, value)
|
127
127
|
else
|
128
128
|
Facebooker::Logging.log_info("**Warning**, Attempt to set non-attribute: #{key}",hash)
|
@@ -132,4 +132,4 @@ module Facebooker
|
|
132
132
|
end
|
133
133
|
end
|
134
134
|
end
|
135
|
-
end
|
135
|
+
end
|
@@ -204,6 +204,38 @@ module Facebooker
|
|
204
204
|
options.merge(nil => multipart_post_file)))
|
205
205
|
end
|
206
206
|
|
207
|
+
# Upload a video to the user's profile.
|
208
|
+
#
|
209
|
+
# In your view, create a multipart form that posts directly to your application (not through canvas):
|
210
|
+
#
|
211
|
+
# <% form_tag videos_url(:canvas => false), :html => {:multipart => true, :promptpermission => 'video_upload'} do %>
|
212
|
+
# Video: <%= file_field_tag 'video' %>
|
213
|
+
# Title: <%= text_area_tag 'title' %>
|
214
|
+
# Description: <%= text_area_tag 'description' %>
|
215
|
+
# <%= submit_tag 'Upload Video', :class => 'inputsubmit' %>
|
216
|
+
# <% end %>
|
217
|
+
#
|
218
|
+
# And in your controller:
|
219
|
+
#
|
220
|
+
# class VideosController < ApplicationController
|
221
|
+
# def create
|
222
|
+
# file = Net::HTTP::MultipartPostFile.new(
|
223
|
+
# params[:photo].original_filename,
|
224
|
+
# params[:photo].content_type,
|
225
|
+
# params[:photo].read
|
226
|
+
# )
|
227
|
+
#
|
228
|
+
# @video = facebook_session.user.upload_video(file, :description => params[:description])
|
229
|
+
# redirect_to videos_url(:canvas => true)
|
230
|
+
# end
|
231
|
+
# end
|
232
|
+
#
|
233
|
+
# Options correspond to http://wiki.developers.facebook.com/index.php/Video.upload
|
234
|
+
def upload_video(multipart_post_file, options = {})
|
235
|
+
Video.from_hash(session.post_file('facebook.video.upload',
|
236
|
+
options.merge(nil => multipart_post_file, :base => Facebooker.video_server_base)))
|
237
|
+
end
|
238
|
+
|
207
239
|
def profile_fbml
|
208
240
|
session.post('facebook.profile.getFBML', :uid => id)
|
209
241
|
end
|
@@ -314,7 +346,7 @@ module Facebooker
|
|
314
346
|
##
|
315
347
|
# Two Facebooker::User objects should be considered equal if their Facebook ids are equal
|
316
348
|
def ==(other_user)
|
317
|
-
id == other_user.id
|
349
|
+
other_user.is_a?(User) && id == other_user.id
|
318
350
|
end
|
319
351
|
|
320
352
|
|
data/lib/facebooker/parser.rb
CHANGED
@@ -305,6 +305,12 @@ module Facebooker
|
|
305
305
|
hashinate(element('photos_upload_response', data))
|
306
306
|
end
|
307
307
|
end
|
308
|
+
|
309
|
+
class UploadVideo < Parser#:nodoc:
|
310
|
+
def self.process(data)
|
311
|
+
hashinate(element('video_upload_response', data))
|
312
|
+
end
|
313
|
+
end
|
308
314
|
|
309
315
|
class SendRequest < Parser#:nodoc:
|
310
316
|
def self.process(data)
|
@@ -562,7 +568,8 @@ module Facebooker
|
|
562
568
|
'facebook.groups.getMembers' => GroupGetMembers,
|
563
569
|
'facebook.notifications.sendEmail' => NotificationsSendEmail,
|
564
570
|
'facebook.data.getUserPreference' => GetPreference,
|
565
|
-
'facebook.data.setUserPreference' => SetPreference
|
571
|
+
'facebook.data.setUserPreference' => SetPreference,
|
572
|
+
'facebook.video.upload' => UploadVideo
|
566
573
|
}
|
567
574
|
end
|
568
575
|
end
|
@@ -7,7 +7,7 @@ module Facebooker
|
|
7
7
|
def self.included(controller)
|
8
8
|
controller.extend(ClassMethods)
|
9
9
|
#controller.before_filter :set_adapter <-- security hole noted by vchu
|
10
|
-
controller.before_filter :
|
10
|
+
controller.before_filter :set_facebook_request_format
|
11
11
|
controller.helper_attr :facebook_session_parameters
|
12
12
|
controller.helper_method :request_comes_from_facebook?
|
13
13
|
end
|
@@ -238,6 +238,9 @@ module Facebooker
|
|
238
238
|
def ensure_has_photo_upload
|
239
239
|
has_extended_permission?("photo_upload") || application_needs_permission("photo_upload")
|
240
240
|
end
|
241
|
+
def ensure_has_video_upload
|
242
|
+
has_extended_permission?("video_upload") || application_needs_permission("video_upload")
|
243
|
+
end
|
241
244
|
def ensure_has_create_listing
|
242
245
|
has_extended_permission?("create_listing") || application_needs_permission("create_listing")
|
243
246
|
end
|
@@ -266,9 +269,14 @@ module Facebooker
|
|
266
269
|
redirect_to session[:facebook_session].install_url(url_params)
|
267
270
|
end
|
268
271
|
|
269
|
-
def
|
270
|
-
|
272
|
+
def set_facebook_request_format
|
273
|
+
if request_is_facebook_ajax?
|
274
|
+
params[:format] = 'fbjs'
|
275
|
+
elsif request_comes_from_facebook?
|
276
|
+
params[:format] = 'fbml'
|
277
|
+
end
|
271
278
|
end
|
279
|
+
|
272
280
|
def set_adapter
|
273
281
|
Facebooker.load_adapter(params) if(params[:fb_sig_api_key])
|
274
282
|
end
|
@@ -286,6 +294,10 @@ module Facebooker
|
|
286
294
|
def ensure_application_is_installed_by_facebook_user(options = {})
|
287
295
|
before_filter :ensure_application_is_installed_by_facebook_user, options
|
288
296
|
end
|
297
|
+
|
298
|
+
def request_comes_from_facebook?
|
299
|
+
request_is_for_a_facebook_canvas? || request_is_facebook_ajax?
|
300
|
+
end
|
289
301
|
end
|
290
302
|
end
|
291
303
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'facebooker/rails/cucumber/world'
|
2
|
+
require 'facebooker/mock/session'
|
3
|
+
require 'facebooker/mock/service'
|
4
|
+
|
5
|
+
Facebooker::MockService.fixture_path = File.join(RAILS_ROOT, 'features', 'support', 'facebook')
|
6
|
+
|
7
|
+
Facebooker::Session.current = Facebooker::MockSession.create
|
8
|
+
class ApplicationController
|
9
|
+
def facebook_session
|
10
|
+
Facebooker::Session.current
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
module Facebooker
|
15
|
+
class << self
|
16
|
+
# prevent Facebooker from adding canvas name as prefix to URLs
|
17
|
+
def request_for_canvas(arg)
|
18
|
+
yield
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
module Rails
|
23
|
+
module Controller
|
24
|
+
# prevent Facebooker from rendering fb:redirect
|
25
|
+
def redirect_to(*args)
|
26
|
+
super
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'cucumber/rails/world'
|
2
|
+
require 'facebooker/rails/integration_session'
|
3
|
+
|
4
|
+
module Facebooker
|
5
|
+
module Rails
|
6
|
+
module Cucumber
|
7
|
+
class World < ::Cucumber::Rails::World
|
8
|
+
def open_session
|
9
|
+
session = Facebooker::Rails::IntegrationSession.new
|
10
|
+
|
11
|
+
# delegate the fixture accessors back to the test instance
|
12
|
+
extras = Module.new { attr_accessor :delegate, :test_result }
|
13
|
+
if self.class.respond_to?(:fixture_table_names)
|
14
|
+
self.class.fixture_table_names.each do |table_name|
|
15
|
+
name = table_name.tr(".", "_")
|
16
|
+
next unless respond_to?(name)
|
17
|
+
extras.__send__(:define_method, name) { |*args| delegate.send(name, *args) }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# delegate add_assertion to the test case
|
22
|
+
extras.__send__(:define_method, :add_assertion) { test_result.add_assertion }
|
23
|
+
session.extend(extras)
|
24
|
+
session.delegate = self
|
25
|
+
session.test_result = @_result
|
26
|
+
|
27
|
+
yield session if block_given?
|
28
|
+
session
|
29
|
+
end
|
30
|
+
|
31
|
+
def without_canvas
|
32
|
+
in_canvas = @integration_session.canvas
|
33
|
+
@integration_session.canvas = false
|
34
|
+
yield
|
35
|
+
@integration_session.canvas = in_canvas
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
World do
|
43
|
+
w = Facebooker::Rails::Cucumber::World.new
|
44
|
+
w.reset!
|
45
|
+
w
|
46
|
+
end
|