redirect_to_back_url 0.0.1
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.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +1 -0
- data/lib/redirect_to_back_url/application_helper.rb +8 -0
- data/lib/redirect_to_back_url/controller.rb +16 -0
- data/lib/redirect_to_back_url/version.rb +3 -0
- data/lib/redirect_to_back_url.rb +3 -0
- data/redirect_to_back_url.gemspec +20 -0
- metadata +73 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module RedirectToBackUrl
|
2
|
+
module Controller
|
3
|
+
def redirect_to_back_url(back_url_key = :back_urk)
|
4
|
+
url = params[back_url_key]
|
5
|
+
if url
|
6
|
+
redirect_to url
|
7
|
+
else
|
8
|
+
if block_given?
|
9
|
+
yield
|
10
|
+
else
|
11
|
+
raise "Neither back url in params nor optional back url provided"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "redirect_to_back_url/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "redirect_to_back_url"
|
7
|
+
s.version = RedirectToBackUrl::VERSION
|
8
|
+
s.authors = ["razenha"]
|
9
|
+
s.email = ["rubem.azenha@gmail.com"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{Redirects to a previously stored url}
|
12
|
+
s.summary = %q{Redirects to a previously stored url}
|
13
|
+
|
14
|
+
s.rubyforge_project = "redirect_to_back_url"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: redirect_to_back_url
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- razenha
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-06-24 00:00:00 Z
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description:
|
22
|
+
email:
|
23
|
+
- rubem.azenha@gmail.com
|
24
|
+
executables: []
|
25
|
+
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files: []
|
29
|
+
|
30
|
+
files:
|
31
|
+
- .gitignore
|
32
|
+
- Gemfile
|
33
|
+
- Rakefile
|
34
|
+
- lib/redirect_to_back_url.rb
|
35
|
+
- lib/redirect_to_back_url/application_helper.rb
|
36
|
+
- lib/redirect_to_back_url/controller.rb
|
37
|
+
- lib/redirect_to_back_url/version.rb
|
38
|
+
- redirect_to_back_url.gemspec
|
39
|
+
homepage: ""
|
40
|
+
licenses: []
|
41
|
+
|
42
|
+
post_install_message:
|
43
|
+
rdoc_options: []
|
44
|
+
|
45
|
+
require_paths:
|
46
|
+
- lib
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
none: false
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
hash: 3
|
53
|
+
segments:
|
54
|
+
- 0
|
55
|
+
version: "0"
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 3
|
62
|
+
segments:
|
63
|
+
- 0
|
64
|
+
version: "0"
|
65
|
+
requirements: []
|
66
|
+
|
67
|
+
rubyforge_project: redirect_to_back_url
|
68
|
+
rubygems_version: 1.8.5
|
69
|
+
signing_key:
|
70
|
+
specification_version: 3
|
71
|
+
summary: Redirects to a previously stored url
|
72
|
+
test_files: []
|
73
|
+
|