extended-routes 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 578db3c676efe330a68a320df62ef8ea884ef2dc
4
+ data.tar.gz: be36cf0bbf4cd399d923489073be70ebb4bc9d77
5
+ SHA512:
6
+ metadata.gz: af91508a6986f123c3f6c9a73b277a33790e60910cf3a521bb9509cf62f68ecff9f2f0a559a8fbde11b98167b9bc8b6e3fafb55b5627cfd1aca67ac05b99fe31
7
+ data.tar.gz: 6d2d81f8a8a5fa8913ad618b7f96dd3a3f935960ebd62ea37392b48305352fee54c75969c5a48e5e8d86db4b2ec5cf6e26edcd890bff461a13c2245ee07c9352
@@ -0,0 +1,3 @@
1
+ class ExtendedRoutes
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,40 @@
1
+ class ExtendedRoutes
2
+ class << self
3
+
4
+ def init(routes)
5
+ @@routes = routes
6
+ end
7
+
8
+ def get(application, path, options = {})
9
+ options.merge!({ to: redirect(application, path) })
10
+ routes.get path, options
11
+ end
12
+
13
+ def base_urls=(urls)
14
+ @@base_urls = {}
15
+ urls.each do |app, base|
16
+ @@base_urls[app.to_s] = base.sub(/\/\z/, '')
17
+ end
18
+ @@base_urls
19
+ end
20
+
21
+ def base_url(app)
22
+ @@base_urls[app.to_s]
23
+ end
24
+
25
+ private
26
+
27
+ def redirect(application, path)
28
+ routes.redirect { url(application, path) }
29
+ end
30
+
31
+ def url(app, path)
32
+ base_url(app) + "/#{path}/".gsub('//', '/')
33
+ end
34
+
35
+ def routes
36
+ @@routes
37
+ end
38
+
39
+ end
40
+ end
metadata ADDED
@@ -0,0 +1,114 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: extended-routes
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - The CareerBuilder.com Consumer Development teams
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.8.7
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.8.7
27
+ - !ruby/object:Gem::Dependency
28
+ name: simplecov
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.7.1
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.7.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '2.11'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '2.11'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-pride
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.2.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 2.2.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 0.9.12.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 0.9.12.1
83
+ description: Ruby wrapper around Consumer Routes
84
+ email: ConsumerDevelopment@careerbuilder.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - lib/extended_routes/version.rb
90
+ - lib/extended_routes.rb
91
+ homepage: http://m.careerbuilder.com
92
+ licenses: []
93
+ metadata: {}
94
+ post_install_message:
95
+ rdoc_options: []
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubyforge_project:
110
+ rubygems_version: 2.0.3
111
+ signing_key:
112
+ specification_version: 4
113
+ summary: Ruby wrapper around Consumer Routes
114
+ test_files: []