kelredd-useful 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -91,8 +91,10 @@ module Useful
91
91
  # # => "id=thomas_hardy"
92
92
  # {:id => 23423, :since => Time.now}.to_http_str
93
93
  # # => "since=Thu,%2021%20Jun%202007%2012:10:05%20-0500&id=23423"
94
- def to_http_str
95
- self.empty? ? '' : self.collect{|key, val| "#{key.to_s}=#{CGI.escape(val.to_s)}"}.join('&')
94
+ def to_http_query_str(opts = {})
95
+ opts[:prepend] ||= '?'
96
+ opts[:append] ||= ''
97
+ self.empty? ? '' : "#{opts[:prepend]}#{self.collect{|key, val| "#{key.to_s}=#{CGI.escape(val.to_s)}"}.join('&')}#{opts[:append]}"
96
98
  end
97
99
 
98
100
  def to_html_attrs
@@ -3,7 +3,7 @@ module Useful
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- TINY = 0
6
+ TINY = 1
7
7
 
8
8
  def self.to_s # :nodoc:
9
9
  [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kelredd-useful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelredd