uservoice 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/CHANGELOG.rdoc +14 -0
- data/README.rdoc +30 -18
- data/Rakefile +3 -4
- data/generators/uservoice/USAGE +2 -2
- data/generators/uservoice/templates/uservoice_template.yml +5 -2
- data/generators/uservoice/uservoice_generator.rb +1 -1
- data/lib/uservoice/instance_methods.rb +25 -3
- data/lib/uservoice/uservoice_helper.rb +16 -5
- data/lib/uservoice/uservoice_token.rb +32 -0
- data/lib/uservoice.rb +10 -5
- data/test/test_uservoice.rb +7 -32
- data/test/test_uservoice_generator.rb +11 -5
- data/test/test_uservoice_sso.rb +39 -0
- data/test/test_uservoice_token.rb +24 -0
- data/test/uservoice_sso_test.yml +13 -0
- data/test/uservoice_test.yml +1 -3
- data/uservoice.gemspec +14 -9
- metadata +26 -9
- data/lib/uservoice/class_methods.rb +0 -26
data/.gitignore
CHANGED
data/CHANGELOG.rdoc
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
== v0.2.0 (2010-05-25)
|
2
|
+
|
3
|
+
* Enhancements
|
4
|
+
|
5
|
+
* added single sign-on support
|
6
|
+
|
7
|
+
* Changes
|
8
|
+
|
9
|
+
* enable_uservoice depricated as config will be loaded by default
|
10
|
+
* new config parameter uservoice_api[:api_key] in uservoice.yml
|
11
|
+
|
12
|
+
== v0.1.0 (2010-01-01)
|
13
|
+
|
14
|
+
* initial release including support for feedback button
|
data/README.rdoc
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
= Uservoice feedback for Ruby on Rails
|
2
2
|
|
3
|
-
This adds {Uservoice}[http://www.uservoice.com]
|
4
|
-
Rails application
|
5
|
-
file and override settings like forum id (for payed accounts) in your layout or
|
6
|
-
view.
|
3
|
+
This adds {Uservoice}[http://www.uservoice.com] support to your
|
4
|
+
Rails application including single sign-on.
|
7
5
|
|
8
6
|
== Installation
|
9
7
|
|
@@ -20,30 +18,44 @@ view.
|
|
20
18
|
== Configuration
|
21
19
|
|
22
20
|
Generate files for your app:
|
23
|
-
./script/generate uservoice <key> <forum>
|
21
|
+
./script/generate uservoice <key> <forum> [<api_key>]
|
24
22
|
Where <key> is the Uservoice account name and <forum> the id of your main forum.
|
25
23
|
Find both settings in widgets section of the admin interface of Uservoice.
|
24
|
+
Your API key <api_key> can be found in the API section of the admin documentation.
|
26
25
|
|
27
|
-
Default properties are stored in a file named uservoice.yml in the config
|
28
|
-
of your Rails application. Make it
|
26
|
+
Default properties are stored in a file named uservoice.yml in the config
|
27
|
+
directory of your Rails application. Make it fitting to your needs.
|
29
28
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
class MyController < ApplicationController
|
34
|
-
enable_uservoice
|
35
|
-
...
|
36
|
-
end
|
37
|
-
|
38
|
-
Link Uservoice javascript file and add configuration to HTML HEAD section of
|
39
|
-
your template file:
|
29
|
+
Link Uservoice javascript file and add configuration to HTML HEAD
|
30
|
+
section of your template file:
|
40
31
|
<%= javascript_include_tag 'uservoice' %>
|
41
32
|
<%= uservoice_config_javascript %>
|
42
33
|
|
43
|
-
You can
|
34
|
+
You can override default uservoice settings in your view:
|
44
35
|
<%= uservoice_config_javascript(:alignment => 'right', :forum => 12983) %>
|
45
36
|
|
46
37
|
|
38
|
+
== Single Sign-on
|
39
|
+
|
40
|
+
Uservoice is allowing single sign-on starting from the Bronze plan.
|
41
|
+
http://uservoice.com/signup?ref=nav
|
42
|
+
|
43
|
+
To use single sign-on with on uservoice you have to set your api_key in
|
44
|
+
config/uservoice.yml. Find it on
|
45
|
+
https://ACCOUNT.uservoice.com/admin2/docs#/legacy_api
|
46
|
+
|
47
|
+
Set user data in your controller action.
|
48
|
+
def index
|
49
|
+
set_uservoice_sso(:guid => @current_user.id, :email => @current_user.email)
|
50
|
+
end
|
51
|
+
|
52
|
+
Parameter <em>:guid</em> should be unique identifier for example the user id in your
|
53
|
+
system. Uservoice recommends setting <em>:email</em> parameter to enable users to get
|
54
|
+
updates and notifications via email.
|
55
|
+
See https://ACCOUNT.uservoice.com/admin2/docs#/sso for a list of parameters
|
56
|
+
available.
|
57
|
+
|
58
|
+
|
47
59
|
== Note on Patches/Pull Requests
|
48
60
|
|
49
61
|
* Fork the project.
|
data/Rakefile
CHANGED
@@ -6,13 +6,12 @@ begin
|
|
6
6
|
Jeweler::Tasks.new do |gem|
|
7
7
|
gem.name = "uservoice"
|
8
8
|
gem.summary = %Q{Uservoice for your Rails application}
|
9
|
-
gem.description = %Q{This adds Uservoice
|
10
|
-
|
11
|
-
settings like forum id (for payed accounts) in your layout or view.}
|
9
|
+
gem.description = %Q{This adds Uservoice support to your Rails application
|
10
|
+
including single sign-on.}
|
12
11
|
gem.email = 'alexxx@iltempo.de'
|
13
12
|
gem.homepage = 'http://github.com/iltempo/uservoice'
|
14
13
|
gem.authors = ['Alexander Greim']
|
15
|
-
gem.version = '0.
|
14
|
+
gem.version = '0.2.0'
|
16
15
|
end
|
17
16
|
Jeweler::GemcutterTasks.new
|
18
17
|
rescue LoadError
|
data/generators/uservoice/USAGE
CHANGED
@@ -4,11 +4,11 @@ Name
|
|
4
4
|
Description:
|
5
5
|
This generator creates all files needed for uservoice integration.
|
6
6
|
|
7
|
-
./script/generate uservoice <uservoice_key> <main_forum_id>
|
7
|
+
./script/generate uservoice <uservoice_key> <main_forum_id> [<api_key>]
|
8
8
|
|
9
9
|
Please add to head section of your layout file:
|
10
10
|
<%= javascript_include_tag 'uservoice' %>
|
11
11
|
<%= uservoice_config_javascript %>
|
12
12
|
|
13
13
|
Example:
|
14
|
-
./script/generate uservoice mypage 12345
|
14
|
+
./script/generate uservoice mypage 12345 myapikey
|
@@ -3,10 +3,13 @@ uservoice_options:
|
|
3
3
|
key: <%= args.first %>
|
4
4
|
host: <%= args.first %>.uservoice.com
|
5
5
|
forum: <%= args.second %>
|
6
|
-
showTab: true
|
7
6
|
# optional
|
7
|
+
showTab: true
|
8
8
|
alignment: left
|
9
9
|
background_color: "#f00"
|
10
10
|
text_color: white
|
11
11
|
hover_color: "#06C"
|
12
|
-
lang: en
|
12
|
+
lang: en
|
13
|
+
|
14
|
+
uservoice_api:
|
15
|
+
api_key: <%= args.third %>
|
@@ -9,11 +9,33 @@
|
|
9
9
|
module Uservoice
|
10
10
|
module InstanceMethods
|
11
11
|
|
12
|
-
#
|
12
|
+
# Loads uservoice configuration into a controller
|
13
13
|
# instance variable
|
14
14
|
#
|
15
|
-
def
|
16
|
-
@uservoice_configuration
|
15
|
+
def load_uservoice_config
|
16
|
+
@uservoice_configuration = begin
|
17
|
+
configuration = YAML::load(IO.read(uservoice_configuration_file))
|
18
|
+
HashWithIndifferentAccess.new(configuration)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# Set uservoice configuration file path.
|
23
|
+
# Can be overridden.
|
24
|
+
#
|
25
|
+
def uservoice_configuration_file #:nodoc:
|
26
|
+
"#{RAILS_ROOT}/config/uservoice.yml"
|
27
|
+
end
|
28
|
+
|
29
|
+
# Generates token for uservoice single sign-on
|
30
|
+
# that will be delivered by uservoice helper.
|
31
|
+
# See https://ACCOUNT.uservoice.com/admin2/docs#/sso for
|
32
|
+
# properties available.
|
33
|
+
#
|
34
|
+
def set_uservoice_sso(user_data)
|
35
|
+
@uservoice_sso_token = Uservoice::Token.new(
|
36
|
+
@uservoice_configuration['uservoice_options']['key'],
|
37
|
+
@uservoice_configuration['uservoice_api']['api_key'],
|
38
|
+
user_data)
|
17
39
|
end
|
18
40
|
|
19
41
|
end
|
@@ -7,14 +7,25 @@
|
|
7
7
|
|
8
8
|
module UservoiceHelper
|
9
9
|
|
10
|
-
# Renders javascript
|
11
|
-
#
|
12
|
-
#
|
10
|
+
# Renders javascript to configure uservoice feedback widget. Options
|
11
|
+
# can be used to override default settings like forum id.
|
12
|
+
# e.g. uservoice_config_javascript(forum_id => 12345)
|
13
|
+
# See https://ACCOUNT.uservoice.com/admin2/docs#/widget for options
|
14
|
+
# available.
|
13
15
|
#
|
14
16
|
def uservoice_config_javascript(options={})
|
15
|
-
config = @uservoice_configuration.dup
|
17
|
+
config = @uservoice_configuration['uservoice_options'].dup
|
16
18
|
config.merge!(options)
|
17
|
-
|
19
|
+
|
20
|
+
if @uservoice_sso_token
|
21
|
+
config.merge!({:params => {:sso => @uservoice_sso_token.data}})
|
22
|
+
end
|
23
|
+
|
24
|
+
<<-EOS
|
25
|
+
<script type=\"text/javascript\">
|
26
|
+
var uservoiceOptions = #{config.to_json};
|
27
|
+
</script>
|
28
|
+
EOS
|
18
29
|
end
|
19
30
|
|
20
31
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# This module represents an encrypted token
|
2
|
+
# to authenticate a user against the uservoice
|
3
|
+
# service.
|
4
|
+
#
|
5
|
+
# Author:: Alexander Greim (mailto:alexxx@iltempo.de)
|
6
|
+
# Copyright:: Copyright (c) 2010 il tempo
|
7
|
+
# License:: Distributes under the same terms as Ruby
|
8
|
+
|
9
|
+
module Uservoice
|
10
|
+
class Token
|
11
|
+
attr_reader :data
|
12
|
+
|
13
|
+
# Creates a sign-in token to authenticate user against
|
14
|
+
# the uservoice service.
|
15
|
+
# See https://ACCOUNT.uservoice.com/admin2/docs#/sso for
|
16
|
+
# data properties available.
|
17
|
+
#
|
18
|
+
def initialize(key, api_key, data)
|
19
|
+
data.merge!({:expires => (Time.now + 5 * 60).to_s})
|
20
|
+
|
21
|
+
crypt_key = EzCrypto::Key.with_password(key, api_key)
|
22
|
+
encrypted_data = crypt_key.encrypt(data.to_json)
|
23
|
+
|
24
|
+
@data = CGI.escape(Base64.encode64(encrypted_data).gsub(/\n/, ''))
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_s #:nodoc:
|
28
|
+
@data
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
data/lib/uservoice.rb
CHANGED
@@ -6,16 +6,21 @@ ActiveSupport::Dependencies.load_once_paths.delete(path)
|
|
6
6
|
module Uservoice
|
7
7
|
end
|
8
8
|
|
9
|
-
require '
|
9
|
+
require 'cgi'
|
10
|
+
require 'rubygems'
|
11
|
+
require 'ezcrypto'
|
12
|
+
require 'uservoice_token'
|
10
13
|
require 'instance_methods'
|
11
14
|
|
12
15
|
module ActionController #:nodoc:
|
13
16
|
class Base #:nodoc:
|
14
|
-
cattr_accessor :uservoice_configuration
|
15
|
-
before_filter :uservoice_init
|
16
17
|
helper :uservoice
|
18
|
+
before_filter :load_uservoice_config
|
17
19
|
|
18
20
|
include Uservoice::InstanceMethods
|
19
|
-
|
21
|
+
|
22
|
+
def self.enable_uservoice
|
23
|
+
warn "[DEPRECATION] 'enable_uservoice' is deprecated. Uservoice is loaded by default in every controller now."
|
24
|
+
end
|
20
25
|
end
|
21
|
-
end
|
26
|
+
end
|
data/test/test_uservoice.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'helper'
|
2
2
|
|
3
3
|
class MyUservoiceController < ActionController::Base
|
4
|
-
|
4
|
+
|
5
|
+
def uservoice_configuration_file
|
5
6
|
File.dirname(__FILE__) + '/uservoice_test.yml'
|
6
7
|
end
|
7
|
-
enable_uservoice
|
8
8
|
|
9
9
|
def assignment
|
10
|
-
render :
|
10
|
+
render :nothing => true
|
11
11
|
end
|
12
12
|
|
13
13
|
def config_js_default
|
@@ -23,26 +23,8 @@ class MyUservoiceController < ActionController::Base
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
class UservoiceTest < ActiveSupport::TestCase
|
27
|
-
|
28
|
-
def setup
|
29
|
-
@my_controller = MyUservoiceController.new
|
30
|
-
end
|
31
|
-
|
32
|
-
['uservoice_configuration_file'].each do |method|
|
33
|
-
test "should add class method '#{method}' to controller classes" do
|
34
|
-
assert MyUservoiceController.methods.include?(method)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
['uservoice_init'].each do |method|
|
39
|
-
test "should add instance method '#{method}' to controller classes" do
|
40
|
-
assert @my_controller.methods.include?(method)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
26
|
|
45
|
-
class
|
27
|
+
class UservoiceControllerTest < ActionController::TestCase
|
46
28
|
tests MyUservoiceController
|
47
29
|
|
48
30
|
def setup
|
@@ -58,30 +40,23 @@ class MyUservoiceControllerTest < ActionController::TestCase
|
|
58
40
|
end
|
59
41
|
end
|
60
42
|
|
61
|
-
def test_controller
|
62
|
-
get :assignment
|
63
|
-
config = assigns('uservoice_configuration')
|
64
|
-
assert config.is_a?(Hash)
|
65
|
-
assert_equal 'test', config['key']
|
66
|
-
end
|
67
|
-
|
68
43
|
def test_config_javascript_default
|
69
44
|
get :config_js_default
|
70
|
-
assert_match Regexp.new('<script type="text/javascript"
|
45
|
+
assert_match Regexp.new('<script type="text/javascript">\s*var uservoiceOptions = .*\s*</script>'), @response.body
|
71
46
|
assert_match Regexp.new('"host":"test.uservoice.com"'), @response.body
|
72
47
|
assert_match Regexp.new('"forum":12345'), @response.body
|
73
48
|
end
|
74
49
|
|
75
50
|
def test_config_custom_forum
|
76
51
|
get :config_js_custom_forum
|
77
|
-
assert_match Regexp.new('<script type="text/javascript"
|
52
|
+
assert_match Regexp.new('<script type="text/javascript">\s*var uservoiceOptions = .*\s*</script>'), @response.body
|
78
53
|
assert_match Regexp.new('"forum":815'), @response.body
|
79
54
|
assert_no_match Regexp.new('"forum":12345'), @response.body
|
80
55
|
end
|
81
56
|
|
82
57
|
def test_config_custom_alignment
|
83
58
|
get :config_js_custom_alignment
|
84
|
-
assert_match Regexp.new('<script type="text/javascript"
|
59
|
+
assert_match Regexp.new('<script type="text/javascript">\s*var uservoiceOptions = .*\s*</script>'), @response.body
|
85
60
|
assert_match Regexp.new('"forum":12345'), @response.body
|
86
61
|
assert_match Regexp.new('"alignment":"right"'), @response.body
|
87
62
|
end
|
@@ -26,9 +26,15 @@ class UservoiceGeneratorTest < Test::Unit::TestCase
|
|
26
26
|
def test_config_file_contains_settings
|
27
27
|
run_generator('uservoice', 'my_name', '98765')
|
28
28
|
config = read_config_file
|
29
|
-
assert_equal 'my_name', config['key']
|
30
|
-
assert_equal 'my_name.uservoice.com', config['host']
|
31
|
-
assert_equal 98765, config['forum']
|
29
|
+
assert_equal 'my_name', config['uservoice_options']['key']
|
30
|
+
assert_equal 'my_name.uservoice.com', config['uservoice_options']['host']
|
31
|
+
assert_equal 98765, config['uservoice_options']['forum']
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_config_file_contains_api_key_if_given
|
35
|
+
run_generator('uservoice', 'my_name', '98765', 'testapikey')
|
36
|
+
config = read_config_file
|
37
|
+
assert_equal 'testapikey', config['uservoice_api']['api_key']
|
32
38
|
end
|
33
39
|
|
34
40
|
private
|
@@ -44,11 +50,11 @@ class UservoiceGeneratorTest < Test::Unit::TestCase
|
|
44
50
|
end
|
45
51
|
|
46
52
|
def read_config_file
|
47
|
-
YAML::load(IO.read(File.join(fake_rails_root, 'config/uservoice.yml')))
|
53
|
+
YAML::load(IO.read(File.join(fake_rails_root, 'config/uservoice.yml')))
|
48
54
|
end
|
49
55
|
|
50
56
|
def run_generator(*options)
|
51
57
|
Rails::Generator::Scripts::Generate.new.run(options, :destination => fake_rails_root, :quiet => true)
|
52
58
|
end
|
53
59
|
|
54
|
-
end
|
60
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class MyUservoiceSsoController < ActionController::Base
|
4
|
+
|
5
|
+
def uservoice_configuration_file
|
6
|
+
File.dirname(__FILE__) + '/uservoice_sso_test.yml'
|
7
|
+
end
|
8
|
+
|
9
|
+
def action_with_sso
|
10
|
+
set_uservoice_sso(:guid => 123, :display_name => 'Bancheff', :email => 'chef@bahn.de')
|
11
|
+
render :inline => '<%= uservoice_config_javascript %>'
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
class UservoiceSsoTest < ActionController::TestCase
|
17
|
+
tests MyUservoiceSsoController
|
18
|
+
|
19
|
+
def setup
|
20
|
+
@my_controller = MyUservoiceSsoController.new
|
21
|
+
@request = ActionController::TestRequest.new
|
22
|
+
@response = ActionController::TestResponse.new
|
23
|
+
|
24
|
+
ActionController::Routing::Routes.draw do |map|
|
25
|
+
map.connect 'action_with_sso', :controller => 'my_uservoice_sso', :action => :action_with_sso
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_sso_token_set
|
30
|
+
get :action_with_sso
|
31
|
+
assert_match Regexp.new('<script type="text/javascript">\s*var uservoiceOptions = .*\s*</script>'), @response.body
|
32
|
+
assert_match Regexp.new('"params":\{"sso":".*"\}'), @response.body
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_api_key_not_to_appear
|
36
|
+
get :action_with_sso
|
37
|
+
assert_no_match /api_key/, @response.body
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class UservoiceTokenTest < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@key = 'test'
|
7
|
+
@api_key = 'testapikey'
|
8
|
+
@user_data = {:guid => 123}
|
9
|
+
@token = Uservoice::Token.new(@key, @api_key, @user_data)
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_token_does_not_contain_line_breaks
|
13
|
+
assert_no_match /\n/, @token.to_s
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_can_be_decrypted
|
17
|
+
crypt_key = EzCrypto::Key.with_password(@key, @api_key)
|
18
|
+
encrypted_data = Base64::decode64(CGI.unescape(@token.data))
|
19
|
+
data = JSON.parse(crypt_key.decrypt(encrypted_data)).symbolize_keys
|
20
|
+
|
21
|
+
assert_equal @user_data, data
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
data/test/uservoice_test.yml
CHANGED
data/uservoice.gemspec
CHANGED
@@ -5,14 +5,13 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{uservoice}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alexander Greim"]
|
12
|
-
s.date = %q{2010-
|
13
|
-
s.description = %q{This adds Uservoice
|
14
|
-
|
15
|
-
settings like forum id (for payed accounts) in your layout or view.}
|
12
|
+
s.date = %q{2010-05-25}
|
13
|
+
s.description = %q{This adds Uservoice support to your Rails application
|
14
|
+
including single sign-on.}
|
16
15
|
s.email = %q{alexxx@iltempo.de}
|
17
16
|
s.extra_rdoc_files = [
|
18
17
|
"LICENSE",
|
@@ -20,6 +19,7 @@ Gem::Specification.new do |s|
|
|
20
19
|
]
|
21
20
|
s.files = [
|
22
21
|
".gitignore",
|
22
|
+
"CHANGELOG.rdoc",
|
23
23
|
"LICENSE",
|
24
24
|
"README.rdoc",
|
25
25
|
"Rakefile",
|
@@ -29,31 +29,36 @@ Gem::Specification.new do |s|
|
|
29
29
|
"generators/uservoice/uservoice_generator.rb",
|
30
30
|
"init.rb",
|
31
31
|
"lib/uservoice.rb",
|
32
|
-
"lib/uservoice/class_methods.rb",
|
33
32
|
"lib/uservoice/instance_methods.rb",
|
34
33
|
"lib/uservoice/uservoice_helper.rb",
|
34
|
+
"lib/uservoice/uservoice_token.rb",
|
35
35
|
"test/helper.rb",
|
36
36
|
"test/test_uservoice.rb",
|
37
37
|
"test/test_uservoice_generator.rb",
|
38
|
+
"test/test_uservoice_sso.rb",
|
39
|
+
"test/test_uservoice_token.rb",
|
40
|
+
"test/uservoice_sso_test.yml",
|
38
41
|
"test/uservoice_test.yml",
|
39
42
|
"uservoice.gemspec"
|
40
43
|
]
|
41
44
|
s.homepage = %q{http://github.com/iltempo/uservoice}
|
42
45
|
s.rdoc_options = ["--charset=UTF-8"]
|
43
46
|
s.require_paths = ["lib"]
|
44
|
-
s.rubygems_version = %q{1.3.
|
47
|
+
s.rubygems_version = %q{1.3.7}
|
45
48
|
s.summary = %q{Uservoice for your Rails application}
|
46
49
|
s.test_files = [
|
47
50
|
"test/helper.rb",
|
48
51
|
"test/test_uservoice.rb",
|
49
|
-
"test/test_uservoice_generator.rb"
|
52
|
+
"test/test_uservoice_generator.rb",
|
53
|
+
"test/test_uservoice_sso.rb",
|
54
|
+
"test/test_uservoice_token.rb"
|
50
55
|
]
|
51
56
|
|
52
57
|
if s.respond_to? :specification_version then
|
53
58
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
54
59
|
s.specification_version = 3
|
55
60
|
|
56
|
-
if Gem::Version.new(Gem::
|
61
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
57
62
|
else
|
58
63
|
end
|
59
64
|
else
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uservoice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Alexander Greim
|
@@ -9,14 +15,13 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-05-25 00:00:00 +02:00
|
13
19
|
default_executable:
|
14
20
|
dependencies: []
|
15
21
|
|
16
22
|
description: |-
|
17
|
-
This adds Uservoice
|
18
|
-
|
19
|
-
settings like forum id (for payed accounts) in your layout or view.
|
23
|
+
This adds Uservoice support to your Rails application
|
24
|
+
including single sign-on.
|
20
25
|
email: alexxx@iltempo.de
|
21
26
|
executables: []
|
22
27
|
|
@@ -27,6 +32,7 @@ extra_rdoc_files:
|
|
27
32
|
- README.rdoc
|
28
33
|
files:
|
29
34
|
- .gitignore
|
35
|
+
- CHANGELOG.rdoc
|
30
36
|
- LICENSE
|
31
37
|
- README.rdoc
|
32
38
|
- Rakefile
|
@@ -36,12 +42,15 @@ files:
|
|
36
42
|
- generators/uservoice/uservoice_generator.rb
|
37
43
|
- init.rb
|
38
44
|
- lib/uservoice.rb
|
39
|
-
- lib/uservoice/class_methods.rb
|
40
45
|
- lib/uservoice/instance_methods.rb
|
41
46
|
- lib/uservoice/uservoice_helper.rb
|
47
|
+
- lib/uservoice/uservoice_token.rb
|
42
48
|
- test/helper.rb
|
43
49
|
- test/test_uservoice.rb
|
44
50
|
- test/test_uservoice_generator.rb
|
51
|
+
- test/test_uservoice_sso.rb
|
52
|
+
- test/test_uservoice_token.rb
|
53
|
+
- test/uservoice_sso_test.yml
|
45
54
|
- test/uservoice_test.yml
|
46
55
|
- uservoice.gemspec
|
47
56
|
has_rdoc: true
|
@@ -54,21 +63,27 @@ rdoc_options:
|
|
54
63
|
require_paths:
|
55
64
|
- lib
|
56
65
|
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
57
67
|
requirements:
|
58
68
|
- - ">="
|
59
69
|
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
60
73
|
version: "0"
|
61
|
-
version:
|
62
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
63
76
|
requirements:
|
64
77
|
- - ">="
|
65
78
|
- !ruby/object:Gem::Version
|
79
|
+
hash: 3
|
80
|
+
segments:
|
81
|
+
- 0
|
66
82
|
version: "0"
|
67
|
-
version:
|
68
83
|
requirements: []
|
69
84
|
|
70
85
|
rubyforge_project:
|
71
|
-
rubygems_version: 1.3.
|
86
|
+
rubygems_version: 1.3.7
|
72
87
|
signing_key:
|
73
88
|
specification_version: 3
|
74
89
|
summary: Uservoice for your Rails application
|
@@ -76,3 +91,5 @@ test_files:
|
|
76
91
|
- test/helper.rb
|
77
92
|
- test/test_uservoice.rb
|
78
93
|
- test/test_uservoice_generator.rb
|
94
|
+
- test/test_uservoice_sso.rb
|
95
|
+
- test/test_uservoice_token.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# This module holds all class methods to be
|
2
|
-
# included into ActionController::Base class
|
3
|
-
# for enabling uservoice in a Rails app.
|
4
|
-
#
|
5
|
-
# Author:: Alexander Greim (mailto:alexxx@iltempo.de)
|
6
|
-
# Copyright:: Copyright (c) 2010 il tempo
|
7
|
-
# License:: Distributes under the same terms as Ruby
|
8
|
-
|
9
|
-
module Uservoice
|
10
|
-
module ClassMethods
|
11
|
-
|
12
|
-
# Loads uservoice configuration from yaml file.
|
13
|
-
#
|
14
|
-
def enable_uservoice
|
15
|
-
self.uservoice_configuration ||= begin
|
16
|
-
configuration = YAML::load(IO.read(self.uservoice_configuration_file))
|
17
|
-
HashWithIndifferentAccess.new(configuration['uservoice_options'])
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def uservoice_configuration_file #:nodoc:
|
22
|
-
"#{RAILS_ROOT}/config/uservoice.yml"
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|