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 CHANGED
@@ -2,3 +2,5 @@
2
2
  rdoc/
3
3
  coverage/
4
4
  pkg/
5
+ .rvmrc
6
+ *.rbc
@@ -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.0'
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
- configuration = YAML::load(IO.read(uservoice_configuration_file))
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
@@ -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
 
@@ -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
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{uservoice}
8
- s.version = "0.3.0"
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-06-09}
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.7}
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::VERSION) >= Gem::Version.new('1.2.0') then
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: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
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-06-09 00:00:00 +02:00
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.7
145
+ rubygems_version: 1.3.6
146
146
  signing_key:
147
147
  specification_version: 3
148
148
  summary: Uservoice for your Rails application