uservoice 0.3.0 → 0.3.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 +2 -0
- data/README.rdoc +2 -1
- data/Rakefile +1 -1
- data/lib/uservoice/instance_methods.rb +4 -1
- data/test/test_uservoice.rb +10 -0
- data/test/uservoice_test.yml +2 -0
- data/uservoice.gemspec +4 -4
- metadata +5 -5
data/README.rdoc
CHANGED
@@ -24,7 +24,8 @@ Find both settings in widgets section of the admin interface of Uservoice.
|
|
24
24
|
Your API key <api_key> can be found in the API section of the admin documentation.
|
25
25
|
|
26
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.
|
27
|
+
directory of your Rails application. Make it fitting to your needs. Feel free to
|
28
|
+
use erb expressions.
|
28
29
|
|
29
30
|
Add javascript function and configuration to HTML HEAD section of your template file:
|
30
31
|
<%= uservoice_config_javascript %>
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ begin
|
|
10
10
|
gem.email = 'alexxx@iltempo.de'
|
11
11
|
gem.homepage = 'http://github.com/iltempo/uservoice'
|
12
12
|
gem.authors = ['Alexander Greim']
|
13
|
-
gem.version = '0.3.
|
13
|
+
gem.version = '0.3.1'
|
14
14
|
gem.add_dependency('ezcrypto', '>= 0.7.2')
|
15
15
|
gem.add_dependency('activesupport', '>= 2.1')
|
16
16
|
gem.add_dependency('actionpack', '>= 2.1')
|
@@ -6,6 +6,8 @@
|
|
6
6
|
# Copyright:: Copyright (c) 2010 il tempo
|
7
7
|
# License:: Distributes under the same terms as Ruby
|
8
8
|
|
9
|
+
require "erb"
|
10
|
+
|
9
11
|
module Uservoice
|
10
12
|
module InstanceMethods
|
11
13
|
|
@@ -28,7 +30,8 @@ module Uservoice
|
|
28
30
|
#
|
29
31
|
def uservoice_configuration
|
30
32
|
@@uservoice_configuration ||= begin
|
31
|
-
|
33
|
+
config = ERB.new(IO.read(uservoice_configuration_file)).result
|
34
|
+
configuration = YAML::load(config)
|
32
35
|
HashWithIndifferentAccess.new(configuration)
|
33
36
|
end
|
34
37
|
end
|
data/test/test_uservoice.rb
CHANGED
@@ -21,6 +21,10 @@ class MyUservoiceController < ActionController::Base
|
|
21
21
|
def config_js_custom_alignment
|
22
22
|
render :inline => "<%= uservoice_config_javascript(:alignment => 'right') %>"
|
23
23
|
end
|
24
|
+
|
25
|
+
def config_js_erb
|
26
|
+
render :inline => "<%= uservoice_config_javascript %>"
|
27
|
+
end
|
24
28
|
end
|
25
29
|
|
26
30
|
|
@@ -37,6 +41,7 @@ class UservoiceControllerTest < ActionController::TestCase
|
|
37
41
|
map.connect 'config_js_default', :controller => 'my_uservoice', :action => :config_js_default
|
38
42
|
map.connect 'config_js_custom_forum', :controller => 'my_uservoice', :action => :config_js_custom_forum
|
39
43
|
map.connect 'config_js_custom_alignment', :controller => 'my_uservoice', :action => :config_js_custom_alignment
|
44
|
+
map.connect 'config_js_erb', :controller => 'my_uservoice', :action => :config_js_erb
|
40
45
|
end
|
41
46
|
end
|
42
47
|
|
@@ -59,5 +64,10 @@ class UservoiceControllerTest < ActionController::TestCase
|
|
59
64
|
assert_match /"forum":12345/, @response.body
|
60
65
|
assert_match /"alignment":"right"/, @response.body
|
61
66
|
end
|
67
|
+
|
68
|
+
def test_config_erb
|
69
|
+
get :config_js_erb
|
70
|
+
assert_match /"erb_value":"testing 1 2 3"/, @response.body
|
71
|
+
end
|
62
72
|
end
|
63
73
|
|
data/test/uservoice_test.yml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
<% test_value = "testing 1 2 3" %>
|
1
2
|
uservoice_options:
|
2
3
|
key: test
|
3
4
|
host: test.uservoice.com
|
@@ -8,6 +9,7 @@ uservoice_options:
|
|
8
9
|
text_color: white
|
9
10
|
hover_color: "#06C"
|
10
11
|
lang: en
|
12
|
+
erb_value: <%= test_value %>
|
11
13
|
|
12
14
|
uservoice_api:
|
13
15
|
api_key: testapikey
|
data/uservoice.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{uservoice}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.1"
|
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-
|
12
|
+
s.date = %q{2010-07-02}
|
13
13
|
s.description = %q{This adds Uservoice support to your Rails application
|
14
14
|
including single sign-on.}
|
15
15
|
s.email = %q{alexxx@iltempo.de}
|
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
|
|
43
43
|
s.homepage = %q{http://github.com/iltempo/uservoice}
|
44
44
|
s.rdoc_options = ["--charset=UTF-8"]
|
45
45
|
s.require_paths = ["lib"]
|
46
|
-
s.rubygems_version = %q{1.3.
|
46
|
+
s.rubygems_version = %q{1.3.6}
|
47
47
|
s.summary = %q{Uservoice for your Rails application}
|
48
48
|
s.test_files = [
|
49
49
|
"test/helper.rb",
|
@@ -57,7 +57,7 @@ Gem::Specification.new do |s|
|
|
57
57
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
58
58
|
s.specification_version = 3
|
59
59
|
|
60
|
-
if Gem::Version.new(Gem::
|
60
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
61
61
|
s.add_runtime_dependency(%q<ezcrypto>, [">= 0.7.2"])
|
62
62
|
s.add_runtime_dependency(%q<activesupport>, [">= 2.1"])
|
63
63
|
s.add_runtime_dependency(%q<actionpack>, [">= 2.1"])
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uservoice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alexander Greim
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-07-02 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
142
|
requirements: []
|
143
143
|
|
144
144
|
rubyforge_project:
|
145
|
-
rubygems_version: 1.3.
|
145
|
+
rubygems_version: 1.3.6
|
146
146
|
signing_key:
|
147
147
|
specification_version: 3
|
148
148
|
summary: Uservoice for your Rails application
|