quick_response 0.2.2 → 0.2.3

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.
@@ -10,8 +10,8 @@ module QuickResponse
10
10
  # Extract options
11
11
  options = args.last.is_a?(Hash) ? DEFAULT_OPTIONS.merge(args.pop) : DEFAULT_OPTIONS
12
12
 
13
- self.content = args
14
- self.size = options[:size]
13
+ @content = to_format(args)
14
+ @size = options[:size]
15
15
  end
16
16
 
17
17
  def content=(*args)
@@ -58,6 +58,7 @@ module QuickResponse
58
58
  def self.format(format, options = {})
59
59
  define_method :to_format do |args|
60
60
  args = args.slice(0, options[:limit]) if options[:limit]
61
+ args = args.map { |a| CGI.escape(a) } if options[:query]
61
62
  output = options[:output] || format
62
63
  str = args.join(options[:join])
63
64
 
@@ -1,10 +1,5 @@
1
1
  module QuickResponse
2
2
  class Maps < ::QuickResponse::Base
3
- format "http://maps.google.com/maps?q=(.*)", :limit => 1
4
-
5
- def initialize(*args)
6
- args = args.map { |a| CGI.escape(a) }
7
- super(*args)
8
- end
3
+ format "http://maps.google.com/maps?q=(.*)", :limit => 1, :query => true
9
4
  end
10
5
  end
@@ -1,3 +1,3 @@
1
1
  module QuickResponse
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 2
9
- version: 0.2.2
8
+ - 3
9
+ version: 0.2.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Robin Clart