bubble-wrap 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,15 +1,32 @@
1
+ ## 1.1.2
2
+
3
+ [Commit history](https://github.com/rubymotion/BubbleWrap/compare/v1.1.0...v1.1.1)
4
+
5
+ * Fixed a problem with the load path.
6
+ * Added `format:` to the HTTP wrapper with [5 supported formats supported](https://github.com/rubymotion/BubbleWrap/pull/109) that sets the content type accordingly.
7
+ * Default HTTP Content-Type for `POST` like requests is back to being
8
+ form url encoded.
9
+
1
10
  ## 1.1.1
2
11
 
12
+ [Commit history](https://github.com/rubymotion/BubbleWrap/compare/v1.1.0...v1.1.1)
13
+
14
+ ### Enhancements
15
+
16
+ * Added support for symbols as selectors to the KVO module.
17
+ * Improved the RSSParser by providing a delegate to handle errors.
18
+
19
+ ### Bug Fixes
20
+
3
21
  * Fixed a bug with the way JSON payloads were handled in the HTTP
4
22
  wrapper.
5
- * Improved the RSSParser by providing a delegate to handle errors.
6
- * Added support for symbols as selectors to the KVO module.
7
23
  * Fixed a bug with the way the headers and content types were handled in
8
24
  the HTTP wrapper.
9
25
 
10
26
  ## 1.1.0
11
27
 
12
- [Commit history](https://github.com/rubymotion/BubbleWrap/compare/1.0...1.1])
28
+ [Commit history](https://github.com/rubymotion/BubbleWrap/compare/v1.0.0...v1.1.0)
29
+
13
30
  * Added `BubbleWrap::Reactor`, a simplified implementation of the Event Machine API on top of GCD.
14
31
  * Added upload support to the HTTP wrapper.
15
32
  * Added `BubbleWrap.create_uuid` to generate a uuid string.
@@ -24,6 +41,8 @@
24
41
 
25
42
  ## 1.0.0
26
43
 
44
+ [Commit history](https://github.com/rubymotion/BubbleWrap/compare/v0.4.0...v1.0.0)
45
+
27
46
  * Improved the integration with RubyMotion build system.
28
47
  * Improved test suite.
29
48
  * Added better documentation, including on how to work on the internals.
@@ -33,25 +52,35 @@
33
52
 
34
53
  ## 0.4.0
35
54
 
55
+ [Commit history](https://github.com/rubymotion/BubbleWrap/compare/v0.3.1...v0.4.0)
56
+
36
57
  * Refactored the code and test suite to be more modular and to handle
37
58
  dependencies. One can now require only a subset of BW such as `require 'bubble-wrap/core'` or 'bubble-wrap/http'
38
59
 
39
60
  ## 0.3.1
40
61
 
62
+ [Commit history](https://github.com/rubymotion/BubbleWrap/compare/v0.3.0...v0.3.1)
63
+
41
64
  * Added App.run_after(delay){ }
42
65
  * HTTP responses return true to ok? when the status code is 20x.
43
66
 
44
67
  ## 0.3.0
45
68
 
46
- * Major refactoring preparing for 1.0: [List of commits](https://github.com/mattetti/BubbleWrap/compare/v0.2.1...v0.3.0)
69
+ [Commit history](https://github.com/rubymotion/BubbleWrap/compare/v0.2.1...v0.3.0)
70
+
71
+ * Major refactoring preparing for 1.0
47
72
 
48
73
  ## 0.2.1
49
74
 
75
+ [Commit history](https://github.com/rubymotion/BubbleWrap/compare/v0.2.0...v0.2.1)
76
+
50
77
  * Minor fix in the way the dependencies are set (had to monkey patch
51
78
  RubyMotion)
52
79
 
53
80
  ## 0.2.0
54
81
 
82
+ [Commit history](https://github.com/rubymotion/BubbleWrap/compare/v0.1.2...v0.2.0)
83
+
55
84
  * Added network activity notification to the HTTP wrapper.
56
85
  * fixed a bug in the `NSNotificationCenter` wrapper.
57
86
 
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bubble-wrap (1.1.1)
4
+ bubble-wrap (1.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  bacon (1.1.0)
10
10
  metaclass (0.0.1)
11
- mocha (0.12.0)
11
+ mocha (0.11.4)
12
12
  metaclass (~> 0.0.1)
13
13
  mocha-on-bacon (0.2.0)
14
14
  mocha (>= 0.9.8)
@@ -20,5 +20,6 @@ PLATFORMS
20
20
  DEPENDENCIES
21
21
  bacon
22
22
  bubble-wrap!
23
+ mocha (= 0.11.4)
23
24
  mocha-on-bacon
24
25
  rake
data/README.md CHANGED
@@ -240,22 +240,22 @@ Helper methods to give NSNotificationCenter a Ruby-like interface:
240
240
 
241
241
  ```ruby
242
242
  def viewWillAppear(animated)
243
- @foreground_observer = notification_center.observe UIApplicationWillEnterForegroundNotification do |notification|
243
+ @foreground_observer = App.notification_center.observe UIApplicationWillEnterForegroundNotification do |notification|
244
244
  loadAndRefresh
245
245
  end
246
246
 
247
- @reload_observer = notification_center.observe ReloadNotification do |notification|
247
+ @reload_observer = App.notification_center.observe ReloadNotification do |notification|
248
248
  loadAndRefresh
249
249
  end
250
250
  end
251
251
 
252
252
  def viewWillDisappear(animated)
253
- notification_center.unobserve @foreground_observer
254
- notification_center.unobserve @reload_observer
253
+ App.notification_center.unobserve @foreground_observer
254
+ App.notification_center.unobserve @reload_observer
255
255
  end
256
256
 
257
257
  def reload
258
- notification_center.post ReloadNotification
258
+ App.notification_center.post ReloadNotification
259
259
  end
260
260
  ```
261
261
 
@@ -16,7 +16,8 @@ Gem::Specification.new do |gem|
16
16
 
17
17
  gem.extra_rdoc_files = gem.files.grep(%r{motion})
18
18
 
19
- gem.add_development_dependency 'bacon'
19
+ gem.add_development_dependency 'mocha', '0.11.4'
20
20
  gem.add_development_dependency 'mocha-on-bacon'
21
+ gem.add_development_dependency 'bacon'
21
22
  gem.add_development_dependency 'rake'
22
23
  end
@@ -22,13 +22,17 @@ module BubbleWrap
22
22
  end
23
23
 
24
24
  def strip_up_to_last_lib(path)
25
- path = path.split('lib')
26
- path = if path.size > 1
27
- path[0..-2].join('lib')
28
- else
29
- path[0]
30
- end
31
- path = path[0..-2] if path[-1] == '/'
25
+ if path =~ /\/lib$/
26
+ path = path.gsub(/\/lib$/, "")
27
+ else
28
+ path = path.split('lib')
29
+ path = if path.size > 1
30
+ path[0..-2].join('lib')
31
+ else
32
+ path[0]
33
+ end
34
+ path = path[0..-2] if path[-1] == '/'
35
+ end
32
36
  path
33
37
  end
34
38
 
@@ -1,3 +1,3 @@
1
1
  module BubbleWrap
2
- VERSION = '1.1.1' unless defined?(BubbleWrap::VERSION)
2
+ VERSION = '1.1.2' unless defined?(BubbleWrap::VERSION)
3
3
  end
@@ -119,6 +119,7 @@ module BubbleWrap
119
119
  @credentials = {:username => '', :password => ''}.merge(@credentials)
120
120
  @timeout = options.delete(:timeout) || 30.0
121
121
  @headers = escape_line_feeds(options.delete :headers)
122
+ @format = options.delete(:format)
122
123
  @cache_policy = options.delete(:cache_policy) || NSURLRequestUseProtocolCachePolicy
123
124
  @options = options
124
125
  @response = HTTP::Response.new
@@ -126,6 +127,7 @@ module BubbleWrap
126
127
  @url = create_url(url_string)
127
128
  @body = create_request_body
128
129
  @request = create_request
130
+ set_content_type
129
131
  @connection = create_connection(request, self)
130
132
  @connection.start
131
133
 
@@ -221,16 +223,6 @@ Cache policy: #{@cache_policy}, response: #{@response.inspect} >"
221
223
  return nil if (@method == "GET" || @method == "HEAD")
222
224
  return nil unless (@payload || @files)
223
225
 
224
- # if no headers provided, set content-type automatically
225
- if @headers.nil?
226
- @headers = {"Content-Type" => "multipart/form-data; boundary=#{@boundary}"}
227
- # else set content type unless it is specified
228
- # if content-type is specified, you should probably also specify
229
- # the :boundary key
230
- else
231
- @headers['Content-Type'] = "multipart/form-data; boundary=#{@boundary}" unless @headers.keys.find {|k| k.downcase == 'content-type'}
232
- end
233
-
234
226
  body = NSMutableData.data
235
227
 
236
228
  append_payload(body) if @payload
@@ -241,6 +233,27 @@ Cache policy: #{@cache_policy}, response: #{@response.inspect} >"
241
233
  body
242
234
  end
243
235
 
236
+ def set_content_type
237
+ # if no headers provided, set content-type automatically
238
+ if @headers.nil? || !@headers.keys.find {|k| k.downcase == 'content-type'}
239
+ @headers ||= {}
240
+ @headers["Content-Type"] = case @format
241
+ when :json
242
+ "application/json"
243
+ when :xml
244
+ "application/xml"
245
+ when :text
246
+ "text/plain"
247
+ else
248
+ if @format == :form_data || @set_body_to_close_boundary
249
+ "multipart/form-data; boundary=#{@boundary}"
250
+ else
251
+ "application/x-www-form-urlencoded"
252
+ end
253
+ end
254
+ end
255
+ end
256
+
244
257
  def append_payload(body)
245
258
  if @payload.is_a?(NSData)
246
259
  body.appendData(@payload)
@@ -255,7 +268,8 @@ Cache policy: #{@cache_policy}, response: #{@response.inspect} >"
255
268
  if @payload.is_a?(String)
256
269
  body.appendData(@payload.dataUsingEncoding NSUTF8StringEncoding)
257
270
  else
258
- @payload.each do |key, value|
271
+ list = process_payload_hash(@payload)
272
+ list.each do |key, value|
259
273
  form_data = NSMutableData.new
260
274
  s = "\r\n--#{@boundary}\r\n"
261
275
  s += "Content-Disposition: form-data; name=\"#{key}\"\r\n\r\n"
@@ -295,28 +309,29 @@ Cache policy: #{@cache_policy}, response: #{@response.inspect} >"
295
309
  end
296
310
 
297
311
  def convert_payload_to_url
298
- params_array = generate_get_params(@payload)
312
+ params_array = process_payload_hash(@payload)
313
+ params_array.map! { |key, value| "#{key}=#{value}" }
299
314
  @payload = params_array.join("&")
300
315
  end
301
316
 
302
- def generate_get_params(payload, prefix=nil)
317
+ def process_payload_hash(payload, prefix=nil)
303
318
  list = []
304
319
  payload.each do |k,v|
305
320
  if v.is_a?(Hash)
306
321
  new_prefix = prefix ? "#{prefix}[#{k.to_s}]" : k.to_s
307
- param = generate_get_params(v, new_prefix)
308
- list << param
322
+ param = process_payload_hash(v, new_prefix)
323
+ list += param
309
324
  elsif v.is_a?(Array)
310
325
  v.each do |val|
311
- param = prefix ? "#{prefix}[#{k}][]=#{val}" : "#{k}[]=#{val}"
312
- list << param
326
+ param = prefix ? "#{prefix}[#{k.to_s}][]" : "#{k.to_s}[]"
327
+ list << [param, val]
313
328
  end
314
329
  else
315
- param = prefix ? "#{prefix}[#{k}]=#{v}" : "#{k}=#{v}"
316
- list << param
330
+ param = prefix ? "#{prefix}[#{k.to_s}]" : k.to_s
331
+ list << [param, v]
317
332
  end
318
333
  end
319
- return list.flatten
334
+ list
320
335
  end
321
336
 
322
337
  def log(message)
@@ -0,0 +1,5 @@
1
+ .repl_history
2
+ build
3
+ resources/*.nib
4
+ resources/*.momd
5
+ resources/*.storyboardc
@@ -0,0 +1,4 @@
1
+ source :rubygems
2
+
3
+ gem 'bubble-wrap', '~> 1.1.0'
4
+ gem 'motion-dryer'
@@ -0,0 +1,12 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ bubble-wrap (1.1.1)
5
+ motion-dryer (0.0.1)
6
+
7
+ PLATFORMS
8
+ ruby
9
+
10
+ DEPENDENCIES
11
+ bubble-wrap (~> 1.1.0)
12
+ motion-dryer
@@ -0,0 +1,5 @@
1
+ ## Gesture Demo
2
+
3
+ A bubble-wrap demo to show how to use gesture API.
4
+
5
+ ![](http://f.cl.ly/items/0e1J3W0Y0p3n3S2a0k2K/%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7%202012-07-16%20%E4%B8%8B%E5%8D%8802.15.30.png)
@@ -0,0 +1,9 @@
1
+ # -*- coding: utf-8 -*-
2
+ $:.unshift("/Library/RubyMotion/lib")
3
+ require 'motion/project'
4
+ require 'bundler'
5
+ Bundler.require :default
6
+
7
+ Motion::Project::App.setup do |app|
8
+ app.name = 'gesture'
9
+ end
@@ -0,0 +1,16 @@
1
+ class AppDelegate
2
+ attr_reader :window
3
+
4
+ def application(application, didFinishLaunchingWithOptions:launchOptions)
5
+ setup_window
6
+ true
7
+ end
8
+
9
+ # setup UI
10
+ def setup_window
11
+ @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
12
+ @window.rootViewController = DrawingViewController.alloc.init
13
+ @window.rootViewController.wantsFullScreenLayout = true
14
+ @window.makeKeyAndVisible
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ class DrawingViewController < UIViewController
2
+ attr_reader :drawing_view
3
+
4
+ def loadView
5
+ screen = UIScreen.mainScreen.bounds
6
+ self.view = UIView.alloc.initWithFrame screen
7
+ self.view.backgroundColor = UIColor.whiteColor
8
+
9
+ @drawing_view = RectView.alloc.initWithFrame [[screen.size.width/2-50,screen.size.height/2-50], [100,100]]
10
+ self.view.addSubview @drawing_view
11
+ end
12
+ end
@@ -0,0 +1,2 @@
1
+ module DrawingHelper
2
+ end
@@ -0,0 +1,92 @@
1
+ class GestureView < UIView
2
+ attr_accessor :rotation, :scale, :translation
3
+
4
+ def initWithCoder(coder)
5
+ super
6
+ setup
7
+ self
8
+ end
9
+
10
+ def initWithFrame(coder)
11
+ super
12
+ setup
13
+ self
14
+ end
15
+
16
+ ## UIGestureRecognizerDelegate
17
+
18
+ # Note: this method allow rotate and pinch gesture happen at the same time
19
+ def gestureRecognizer(recognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer:other_recognizer)
20
+ case recognizer
21
+ when @rotated_recognizer
22
+ if other_recognizer == @pinch_recognizer
23
+ return true
24
+ end
25
+ when @pinch_recognizer
26
+ if other_recognizer == @rotated_recognizer
27
+ return true
28
+ end
29
+ end
30
+ return false
31
+ end
32
+
33
+ private
34
+
35
+ def setup
36
+ self.layer.shouldRasterize = true
37
+ self.rotation = 0
38
+ self.scale = 1
39
+ setup_gesture
40
+ end
41
+
42
+ def setup_gesture
43
+ @panned_recognizer = self.whenPanned do |recognizer|
44
+ case(recognizer.state)
45
+ when UIGestureRecognizerStateBegan
46
+ @last_position = self.position
47
+ when UIGestureRecognizerStateChanged
48
+ self.translation = recognizer.translationInView(self.superview)
49
+ self.position = [@last_position.x + self.translation.x, @last_position.y + self.translation.y]
50
+ when UIGestureRecognizerStateEnded
51
+ @last_position = nil
52
+ end
53
+ end
54
+ @panned_recognizer.maximumNumberOfTouches = 1
55
+ @panned_recognizer.minimumNumberOfTouches = 1
56
+ @panned_recognizer.delegate = self
57
+
58
+ @rotated_recognizer = self.whenRotated do |recognizer|
59
+ case(recognizer.state)
60
+ when UIGestureRecognizerStateBegan
61
+ @last_rotation = self.rotation
62
+ when UIGestureRecognizerStateChanged
63
+ self.rotation = @last_rotation + recognizer.rotation
64
+ reset_transformation
65
+ when UIGestureRecognizerStateEnded
66
+ @last_rotation = nil
67
+ end
68
+ end
69
+ @rotated_recognizer.delegate = self
70
+
71
+ @pinch_recognizer = self.whenPinched do |recognizer|
72
+ case(recognizer.state)
73
+ when UIGestureRecognizerStateBegan
74
+ @last_scale = self.scale
75
+ when UIGestureRecognizerStateChanged
76
+ self.scale = @last_scale * recognizer.scale
77
+ reset_transformation
78
+ when UIGestureRecognizerStateEnded
79
+ @last_scale = nil
80
+ end
81
+ end
82
+ @pinch_recognizer.delegate = self
83
+ end
84
+
85
+ def reset_transformation
86
+ transform = CATransform3DIdentity
87
+ transform = CATransform3DRotate(transform, -1 * self.rotation, 0.0, 0.0, -1.0)
88
+ transform = CATransform3DScale(transform, self.scale, self.scale, 1.0)
89
+ self.layer.transform = transform
90
+ end
91
+
92
+ end
@@ -0,0 +1,13 @@
1
+ class RectView < GestureView
2
+ def drawRect(rect)
3
+ super(rect)
4
+
5
+ context = UIGraphicsGetCurrentContext()
6
+ CGContextSetAllowsAntialiasing(context, true);
7
+ CGContextSetShouldAntialias(context, true);
8
+ CGContextSetFillColorWithColor(context, UIColor.redColor.CGColor)
9
+ CGContextSetLineWidth(context, 10.0)
10
+ CGContextAddRect(context, [[0,0], [self.frame.size.width,self.frame.size.height]])
11
+ CGContextFillPath(context)
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ describe "Application 'gesture'" do
2
+ before do
3
+ @app = UIApplication.sharedApplication
4
+ end
5
+
6
+ it "has one window" do
7
+ @app.windows.size.should == 1
8
+ end
9
+ end
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('../../../../../lib/bubble-wrap/requirement/path_manipulation', __FILE__)
2
2
 
3
3
  describe BubbleWrap::Requirement::PathManipulation do
4
-
4
+
5
5
  before do
6
6
  @subject = Object.new
7
7
  @subject.extend BubbleWrap::Requirement::PathManipulation
@@ -35,6 +35,11 @@ describe BubbleWrap::Requirement::PathManipulation do
35
35
  should == '/fake/lib/dir'
36
36
  end
37
37
 
38
+ it "strips off only a trailing lib" do
39
+ @subject.strip_up_to_last_lib('/fake/lib/dir/lib').
40
+ should == '/fake/lib/dir'
41
+ end
42
+
38
43
  it "doesn't modify the path otherwise" do
39
44
  @subject.strip_up_to_last_lib('/fake/path').
40
45
  should == '/fake/path'
@@ -108,6 +108,7 @@ describe "HTTP" do
108
108
  credentials: @credentials
109
109
  }
110
110
  @action = lambda{|fa, ke|}
111
+ @format = "application/x-www-form-urlencoded"
111
112
  @cache_policy = 24234
112
113
  @leftover_option = 'trololo'
113
114
  @headers = { 'User-Agent' => "Mozilla/5.0 (X11; Linux x86_64; rv:12.0) \n Gecko/20100101 Firefox/12.0" }
@@ -122,7 +123,8 @@ describe "HTTP" do
122
123
  credentials: @credentials,
123
124
  headers: @headers,
124
125
  cache_policy: @cache_policy,
125
- leftover_option: @leftover_option
126
+ leftover_option: @leftover_option,
127
+ format: @format
126
128
  }
127
129
  @query = BubbleWrap::HTTP::Query.new( @localhost_url , :get, @options )
128
130
  end
@@ -158,6 +160,11 @@ describe "HTTP" do
158
160
  @options.should.not.has_key? :files
159
161
  end
160
162
 
163
+ it "sets the format from options" do
164
+ @query.instance_variable_get(:@format).should.equal @format
165
+ @options.should.not.has_key? :format
166
+ end
167
+
161
168
  it "should set self as the delegator if action was not passed in" do
162
169
  new_query = BubbleWrap::HTTP::Query.new( 'http://localhost', :get, {})
163
170
  new_query.instance_variable_get(:@delegator).should.equal new_query
@@ -241,7 +248,7 @@ describe "HTTP" do
241
248
  lambda { query = create_query(data, nil) }.should.not.raise NoMethodError
242
249
  end
243
250
 
244
- it "sets the payload as a string if JSON" do
251
+ it "sets the payload as a string if JSON" do
245
252
  json = BW::JSON.generate({foo:42, bar:'BubbleWrap'})
246
253
  puts "\n"
247
254
  [:put, :post, :delete, :patch].each do |method|
@@ -252,6 +259,14 @@ describe "HTTP" do
252
259
  end
253
260
  end
254
261
 
262
+ it "sets the payload for a nested hash to multiple form-data parts" do
263
+ payload = { computer: { name: 'apple', model: 'macbook'} }
264
+ query = BubbleWrap::HTTP::Query.new( 'nil', :post, { payload: payload } )
265
+ uuid = query.instance_variable_get(:@boundary)
266
+ real_payload = NSString.alloc.initWithData(query.request.HTTPBody, encoding:NSUTF8StringEncoding)
267
+ real_payload.should.equal "\r\n--#{uuid}\r\nContent-Disposition: form-data; name=\"computer[name]\"\r\n\r\napple\r\n--#{uuid}\r\nContent-Disposition: form-data; name=\"computer[model]\"\r\n\r\nmacbook\r\n--#{uuid}--\r\n"
268
+ end
269
+
255
270
  end
256
271
 
257
272
  it "should set default timeout to 30s or the one from hash" do
@@ -351,6 +366,21 @@ describe "HTTP" do
351
366
  @post_query.request.allHTTPHeaderFields.should.include?('Content-Type')
352
367
  end
353
368
 
369
+ it "should use the format parameter to decide the Content-Type" do
370
+ json_query = BubbleWrap::HTTP::Query.new(@url_string, :post, {headers: @headers, format: :json, payload: "{\"key\":\"abc1234\"}"})
371
+ json_query.request.allHTTPHeaderFields['Content-Type'].should.equal "application/json"
372
+ end
373
+
374
+ it "should default to multipart/form-data for payloads with a hash" do
375
+ uuid = @post_query.instance_variable_get(:@boundary)
376
+ @post_query.request.allHTTPHeaderFields['Content-Type'].should.equal "multipart/form-data; boundary=#{uuid}"
377
+ end
378
+
379
+ it "should default to application/x-www-form-urlencoded for non-hash payloads" do
380
+ string_query = BubbleWrap::HTTP::Query.new(@url_string, :post, {headers: @headers, payload: "{\"key\":\"abc1234\"}"})
381
+ string_query.request.allHTTPHeaderFields['Content-Type'].should.equal "application/x-www-form-urlencoded"
382
+ end
383
+
354
384
  it "should not add Content-Type if you provide one yourself" do
355
385
  # also ensures check is case insenstive
356
386
  @headers = { fake: 'headers', 'CONTENT-TYPE' => 'x-banana' }
@@ -365,21 +395,21 @@ describe "HTTP" do
365
395
 
366
396
  end
367
397
 
368
- describe "Generating GET params" do
398
+ describe "Generating payloads" do
369
399
 
370
- it "should create params with nested hashes with prefix[key]=value" do
400
+ it "should create payload key/value pairs from nested hashes with prefix[key]=value" do
371
401
  expected_params = [
372
- 'user[name]=marin',
373
- 'user[surname]=usalj',
374
- 'twitter=@mneorr',
375
- 'website=mneorr.com',
376
- 'values[]=apple',
377
- 'values[]=orange',
378
- 'values[]=peach',
379
- "credentials[username]=mneorr",
380
- "credentials[password]=123456xx!@crazy"
402
+ ['user[name]', 'marin'],
403
+ ['user[surname]', 'usalj'],
404
+ ['twitter', '@mneorr'],
405
+ ['website', 'mneorr.com'],
406
+ ['values[]', 'apple'],
407
+ ['values[]', 'orange'],
408
+ ['values[]', 'peach'],
409
+ ['credentials[username]', 'mneorr'],
410
+ ['credentials[password]', '123456xx!@crazy']
381
411
  ]
382
- @query.send(:generate_get_params, @payload).should.equal expected_params
412
+ @query.send(:process_payload_hash, @payload).should.equal expected_params
383
413
  end
384
414
 
385
415
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bubble-wrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,22 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-07-15 00:00:00.000000000 Z
14
+ date: 2012-07-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: bacon
18
- requirement: &70352193392320 !ruby/object:Gem::Requirement
17
+ name: mocha
18
+ requirement: &70216781507520 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - =
22
+ - !ruby/object:Gem::Version
23
+ version: 0.11.4
24
+ type: :development
25
+ prerelease: false
26
+ version_requirements: *70216781507520
27
+ - !ruby/object:Gem::Dependency
28
+ name: mocha-on-bacon
29
+ requirement: &70216781507100 !ruby/object:Gem::Requirement
19
30
  none: false
20
31
  requirements:
21
32
  - - ! '>='
@@ -23,10 +34,10 @@ dependencies:
23
34
  version: '0'
24
35
  type: :development
25
36
  prerelease: false
26
- version_requirements: *70352193392320
37
+ version_requirements: *70216781507100
27
38
  - !ruby/object:Gem::Dependency
28
- name: mocha-on-bacon
29
- requirement: &70352193391900 !ruby/object:Gem::Requirement
39
+ name: bacon
40
+ requirement: &70216781506640 !ruby/object:Gem::Requirement
30
41
  none: false
31
42
  requirements:
32
43
  - - ! '>='
@@ -34,10 +45,10 @@ dependencies:
34
45
  version: '0'
35
46
  type: :development
36
47
  prerelease: false
37
- version_requirements: *70352193391900
48
+ version_requirements: *70216781506640
38
49
  - !ruby/object:Gem::Dependency
39
50
  name: rake
40
- requirement: &70352193391480 !ruby/object:Gem::Requirement
51
+ requirement: &70216781506220 !ruby/object:Gem::Requirement
41
52
  none: false
42
53
  requirements:
43
54
  - - ! '>='
@@ -45,7 +56,7 @@ dependencies:
45
56
  version: '0'
46
57
  type: :development
47
58
  prerelease: false
48
- version_requirements: *70352193391480
59
+ version_requirements: *70216781506220
49
60
  description: RubyMotion wrappers and helpers (Ruby for iOS) - Making Cocoa APIs more
50
61
  Ruby like, one API at a time. Fork away and send your pull request.
51
62
  email:
@@ -179,6 +190,17 @@ files:
179
190
  - motion/ui/ui_control.rb
180
191
  - motion/ui/ui_view_controller.rb
181
192
  - resources/atom.xml
193
+ - samples/gesture/.gitignore
194
+ - samples/gesture/Gemfile
195
+ - samples/gesture/Gemfile.lock
196
+ - samples/gesture/README.md
197
+ - samples/gesture/Rakefile
198
+ - samples/gesture/app/app_delegate.rb
199
+ - samples/gesture/app/controllers/drawing_view_controller.rb
200
+ - samples/gesture/app/helpers/drawing_helper.rb
201
+ - samples/gesture/app/views/drawing/gesture_view.rb
202
+ - samples/gesture/app/views/drawing/rect_view.rb
203
+ - samples/gesture/spec/main_spec.rb
182
204
  - spec/lib/bubble-wrap/ext/motion_project_app_spec.rb
183
205
  - spec/lib/bubble-wrap/ext/motion_project_config_spec.rb
184
206
  - spec/lib/bubble-wrap/requirement/path_manipulation_spec.rb
@@ -219,7 +241,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
219
241
  version: '0'
220
242
  segments:
221
243
  - 0
222
- hash: -1922890315766679291
244
+ hash: 4073507284193479358
223
245
  required_rubygems_version: !ruby/object:Gem::Requirement
224
246
  none: false
225
247
  requirements:
@@ -228,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
250
  version: '0'
229
251
  segments:
230
252
  - 0
231
- hash: -1922890315766679291
253
+ hash: 4073507284193479358
232
254
  requirements: []
233
255
  rubyforge_project:
234
256
  rubygems_version: 1.8.16