edgarjs-ajaxful_rating 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +2 -0
- data/Rakefile +1 -1
- data/ajaxful_rating.gemspec +2 -2
- data/lib/ajaxful_rating_helper.rb +11 -5
- metadata +4 -3
data/README.textile
CHANGED
@@ -2,6 +2,8 @@ h1. Ajaxful Rating
|
|
2
2
|
|
3
3
|
Provides a simple way to add rating functionality to your application.
|
4
4
|
|
5
|
+
!http://s3.amazonaws.com/ember/v9SvvO3rdSkA40e1sXBf8JgpuaWCC0uB_o.png!
|
6
|
+
|
5
7
|
h2. Repository
|
6
8
|
|
7
9
|
Find it at "github.com/edgarjs/ajaxful-rating":http://github.com/edgarjs/ajaxful-rating
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('ajaxful_rating', '2.1.
|
5
|
+
Echoe.new('ajaxful_rating', '2.1.3') do |p|
|
6
6
|
p.description = "Provides a simple way to add rating functionality to your application."
|
7
7
|
p.url = "http://github.com/edgarjs/ajaxful-rating"
|
8
8
|
p.author = "Edgar J. Suarez"
|
data/ajaxful_rating.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{ajaxful_rating}
|
5
|
-
s.version = "2.1.
|
5
|
+
s.version = "2.1.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Edgar J. Suarez"]
|
9
|
-
s.date = %q{2009-09-
|
9
|
+
s.date = %q{2009-09-09}
|
10
10
|
s.description = %q{Provides a simple way to add rating functionality to your application.}
|
11
11
|
s.email = %q{e@dgar.org}
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "README.textile", "lib/ajaxful_rating.rb", "lib/ajaxful_rating_helper.rb", "lib/ajaxful_rating_model.rb"]
|
@@ -150,7 +150,7 @@ module AjaxfulRating # :nodoc:
|
|
150
150
|
# Builds the default options for the link_to_remote function.
|
151
151
|
def build_remote_options(html, i)
|
152
152
|
options[:remote_options].reverse_merge(:html => html).merge(
|
153
|
-
:url => "#{options[:remote_options][:url]}?#{{:stars => i, :dimension => options[:dimension]}.to_query}")
|
153
|
+
:url => "#{options[:remote_options][:url]}?#{{:stars => i, :dimension => options[:dimension], :small_stars => options[:small_stars]}.to_query}")
|
154
154
|
end
|
155
155
|
|
156
156
|
# Extracts the hash options and returns the user instance.
|
@@ -160,11 +160,17 @@ module AjaxfulRating # :nodoc:
|
|
160
160
|
elsif args.first != :static
|
161
161
|
current_user if respond_to?(:current_user)
|
162
162
|
end
|
163
|
-
|
164
|
-
if
|
165
|
-
|
166
|
-
|
163
|
+
config = (!args.empty? && args.last.is_a?(Hash)) ? args.last : {}
|
164
|
+
if config[:remote_options] && config[:remote_options][:url]
|
165
|
+
# we keep the passed url
|
166
|
+
elsif user
|
167
|
+
config[:remote_options] = {
|
168
|
+
:url => respond_to?(url = "rate_#{rateable.class.name.downcase}_path") ?
|
169
|
+
send(url, rateable) : raise(MissingRateRoute)
|
170
|
+
}
|
167
171
|
end
|
172
|
+
config[:small_stars] = (config[:small_stars].downcase == "true") if config[:small_stars].is_a?(String)
|
173
|
+
options.merge!(config)
|
168
174
|
options[:html].reverse_merge!(:class => "#{options[:class]} #{options[:small_star_class] if options[:small_stars]}")
|
169
175
|
user
|
170
176
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edgarjs-ajaxful_rating
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edgar J. Suarez
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-09 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -44,6 +44,7 @@ files:
|
|
44
44
|
- lib/ajaxful_rating_model.rb
|
45
45
|
has_rdoc: false
|
46
46
|
homepage: http://github.com/edgarjs/ajaxful-rating
|
47
|
+
licenses:
|
47
48
|
post_install_message:
|
48
49
|
rdoc_options:
|
49
50
|
- --line-numbers
|
@@ -69,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
70
|
requirements: []
|
70
71
|
|
71
72
|
rubyforge_project: ajaxful_rating
|
72
|
-
rubygems_version: 1.
|
73
|
+
rubygems_version: 1.3.5
|
73
74
|
signing_key:
|
74
75
|
specification_version: 3
|
75
76
|
summary: Provides a simple way to add rating functionality to your application.
|