moxify 0.1.7.1 → 0.1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/config/locales/de.yml +1 -1
- data/lib/moxify/url_tempfile.rb +19 -0
- data/lib/moxify/version.rb +1 -1
- data/lib/moxify.rb +14 -0
- data/moxify.gemspec +1 -1
- data/spec/requests/routes_spec.rb +6 -0
- metadata +4 -3
data/config/locales/de.yml
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Moxify
|
2
|
+
class URLTempfile < Tempfile
|
3
|
+
|
4
|
+
def initialize(url)
|
5
|
+
@url = URI.parse(url)
|
6
|
+
|
7
|
+
begin
|
8
|
+
super('url', Dir.tmpdir, :encoding => 'ascii-8bit')
|
9
|
+
|
10
|
+
Net::HTTP.start(@url.host) do |http|
|
11
|
+
resp = http.get(@url.path)
|
12
|
+
self.write resp.body
|
13
|
+
end
|
14
|
+
ensure
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
data/lib/moxify/version.rb
CHANGED
data/lib/moxify.rb
CHANGED
@@ -3,6 +3,8 @@ require 'moxify/version'
|
|
3
3
|
|
4
4
|
module Moxify
|
5
5
|
|
6
|
+
autoload :URLTempfile, 'moxify/url_tempfile'
|
7
|
+
|
6
8
|
class Engine < Rails::Engine
|
7
9
|
|
8
10
|
initializer "static assets" do |app|
|
@@ -28,11 +30,23 @@ module Moxify
|
|
28
30
|
# override routes
|
29
31
|
collected_routes = []
|
30
32
|
Rails.application.routes.routes.each do |route|
|
33
|
+
match = false
|
34
|
+
|
31
35
|
if route.path =~ /refinery/ and
|
32
36
|
not route.path =~ /^\/refinery\(\/\*path\)/ # this is our catch all route
|
33
37
|
|
34
38
|
route.instance_variable_set "@path", route.path.gsub(/refinery/, "admin")
|
39
|
+
match = true
|
40
|
+
|
41
|
+
elsif route.path =~ /^\/users/ and
|
42
|
+
route.name =~ /user\_/
|
35
43
|
|
44
|
+
route.instance_variable_set "@path", route.path.gsub(/users/, "admin")
|
45
|
+
match = true
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
if match
|
36
50
|
# make sure we generate new path_info for changed paths
|
37
51
|
conditions = route.conditions
|
38
52
|
conditions[:path_info] = ::Rack::Mount::Strexp.compile(route.path, route.requirements, ::ActionDispatch::Routing::SEPARATORS, true)
|
data/moxify.gemspec
CHANGED
@@ -16,5 +16,5 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
17
|
s.require_paths = ["lib", "config", "app", "public"]
|
18
18
|
|
19
|
-
s.add_dependency 'refinerycms', '~> 0.9.9.
|
19
|
+
s.add_dependency 'refinerycms', '~> 0.9.9.21'
|
20
20
|
end
|
@@ -28,4 +28,10 @@ describe "Moxify routing" do
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
it "should rewrite users paths", :type => :request do
|
32
|
+
new_user_session_path.should == "/admin/login"
|
33
|
+
destroy_user_session_path.should == "/admin/logout"
|
34
|
+
new_user_registration_path.should == "/admin/register"
|
35
|
+
end
|
36
|
+
|
31
37
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: moxify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.7.
|
5
|
+
version: 0.1.7.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Marian Andre
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-05-02 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
requirements:
|
22
22
|
- - ~>
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: 0.9.9.
|
24
|
+
version: 0.9.9.21
|
25
25
|
type: :runtime
|
26
26
|
version_requirements: *id001
|
27
27
|
description: A blanket full of toy cars for Refinery CMS
|
@@ -45,6 +45,7 @@ files:
|
|
45
45
|
- config/routes.rb
|
46
46
|
- lib/moxify.rb
|
47
47
|
- lib/moxify/dragonfly_quality_hook.rb
|
48
|
+
- lib/moxify/url_tempfile.rb
|
48
49
|
- lib/moxify/version.rb
|
49
50
|
- moxify.gemspec
|
50
51
|
- public/stylesheets/refinery/moxify.css
|