rtopia 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/rtopia.rb +6 -8
  3. data/rtopia.gemspec +2 -2
  4. metadata +11 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/lib/rtopia.rb CHANGED
@@ -2,10 +2,8 @@ require 'uri'
2
2
  require 'cgi'
3
3
 
4
4
  module Rtopia
5
- def self.R(*args)
6
- @rtopia ||= Object.new.extend(self)
7
- @rtopia.R(*args)
8
- end
5
+ # In order to be able to do `Rtopia::R`, Rtopia needs to extend itself
6
+ extend self
9
7
 
10
8
  # Usage:
11
9
  #
@@ -47,21 +45,21 @@ private
47
45
  hash.inject([]) { |arr, (key, value)|
48
46
  if value.is_a?(Array)
49
47
  value.each do |e|
50
- arr << to_query("#{key}[]", e)
48
+ arr << key_value("#{key}[]", e)
51
49
  end
52
50
  arr
53
51
  elsif value.is_a?(Hash)
54
52
  value.each do |namespace, deeper|
55
- arr << to_query("#{key}[#{namespace}]", deeper)
53
+ arr << key_value("#{key}[#{namespace}]", deeper)
56
54
  end
57
55
  arr
58
56
  else
59
- arr << to_query(key, value)
57
+ arr << key_value(key, value)
60
58
  end
61
59
  }.join('&')
62
60
  end
63
61
 
64
- def to_query(k, v)
62
+ def key_value(k, v)
65
63
  '%s=%s' % [CGI.escape(k.to_s), URI.escape(to_param(v))]
66
64
  end
67
65
 
data/rtopia.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rtopia}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sinefunc"]
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
31
31
  s.homepage = %q{http://github.com/sinefunc/rtopia}
32
32
  s.rdoc_options = ["--charset=UTF-8"]
33
33
  s.require_paths = ["lib"]
34
- s.rubygems_version = %q{1.3.5}
34
+ s.rubygems_version = %q{1.3.6}
35
35
  s.summary = %q{A cute helper for route generation}
36
36
  s.test_files = [
37
37
  "test/helper.rb",
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtopia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 1
9
+ version: 0.2.1
5
10
  platform: ruby
6
11
  authors:
7
12
  - Sinefunc
@@ -46,18 +51,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
51
  requirements:
47
52
  - - ">="
48
53
  - !ruby/object:Gem::Version
54
+ segments:
55
+ - 0
49
56
  version: "0"
50
- version:
51
57
  required_rubygems_version: !ruby/object:Gem::Requirement
52
58
  requirements:
53
59
  - - ">="
54
60
  - !ruby/object:Gem::Version
61
+ segments:
62
+ - 0
55
63
  version: "0"
56
- version:
57
64
  requirements: []
58
65
 
59
66
  rubyforge_project:
60
- rubygems_version: 1.3.5
67
+ rubygems_version: 1.3.6
61
68
  signing_key:
62
69
  specification_version: 3
63
70
  summary: A cute helper for route generation