simple-fluther 0.1.0 → 0.2.0
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/lib/simple-fluther/controller_methods.rb +11 -5
- metadata +6 -6
@@ -3,8 +3,15 @@ require 'em-http-request'
|
|
3
3
|
module SimpleFluther
|
4
4
|
module ControllerMethods
|
5
5
|
def make_fluther_request
|
6
|
-
|
7
|
-
|
6
|
+
if request.path.ends_with?('/')
|
7
|
+
setup_fluther_user
|
8
|
+
return exec_request
|
9
|
+
else
|
10
|
+
path_with_slash = request.path + '/'
|
11
|
+
Rails.logger.debug "Found no trailing slash, redirecing to #{path_with_slash}"
|
12
|
+
redirect_to path_with_slash, :status => 301
|
13
|
+
return false
|
14
|
+
end
|
8
15
|
end
|
9
16
|
|
10
17
|
def setup_fluther_user
|
@@ -40,10 +47,9 @@ module SimpleFluther
|
|
40
47
|
|
41
48
|
path = request.path.sub( %r{^#{SimpleFluther::Config.prefix}}, '' )
|
42
49
|
path = '/' + path unless path.starts_with?('/')
|
43
|
-
path = path + '/' unless path.ends_with?('/')
|
44
50
|
url = "#{request.scheme}://#{SimpleFluther::Config.fluther_host}#{path}"
|
45
51
|
|
46
|
-
Rails.logger.debug request.request_method
|
52
|
+
Rails.logger.debug "#{request.request_method} for #{request.path}"
|
47
53
|
Rails.logger.debug url
|
48
54
|
Rails.logger.debug options
|
49
55
|
|
@@ -73,7 +79,7 @@ module SimpleFluther
|
|
73
79
|
redirect_to fluther.response_header['LOCATION'], :status => fluther.response_header.status
|
74
80
|
false
|
75
81
|
elsif request.xhr? || (content_type != 'text/html')
|
76
|
-
Rails.logger.debug "AJAX?"
|
82
|
+
Rails.logger.debug "AJAX? Rendering..."
|
77
83
|
render :text => fluther.response, :layout => false
|
78
84
|
# [ fluther.response_header.status, {'Content-Type' => type_header}, [fluther.response] ]
|
79
85
|
true
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-fluther
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 2
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Justin Chen
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08
|
18
|
+
date: 2010-09-08 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: "0"
|
33
33
|
type: :runtime
|
34
34
|
version_requirements: *id001
|
35
|
-
description:
|
35
|
+
description: Ruby interface to the Fluther discussion system
|
36
36
|
email: justin@menuism.com
|
37
37
|
executables: []
|
38
38
|
|
@@ -79,6 +79,6 @@ rubyforge_project:
|
|
79
79
|
rubygems_version: 1.3.7
|
80
80
|
signing_key:
|
81
81
|
specification_version: 3
|
82
|
-
summary:
|
82
|
+
summary: Modified version of original fluther gem for integrating into Rails.
|
83
83
|
test_files: []
|
84
84
|
|