Skip to content

Commit

Permalink
Merge branch 'v1'
Browse files Browse the repository at this point in the history
  • Loading branch information
pat committed Feb 17, 2012
2 parents 4848c65 + 3bae613 commit 8906e3a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions HISTORY
@@ -1,4 +1,5 @@
Edge:
* Load MySQL SSL settings from database.yml (James Brooks).
* Adding Sphinx 2.0.3 support (identical to 2.1.0).
* Dropping Rails 1.2 and 2.0.x support.
* Association keys now are the association stacks as arrays - more reliable in Rubinius.
Expand Down
5 changes: 5 additions & 0 deletions lib/thinking_sphinx/source.rb
Expand Up @@ -97,6 +97,11 @@ def set_source_database_settings(source)
source.sql_db = config[:database]
source.sql_port = config[:port]
source.sql_sock = config[:socket]

# MySQL SSL support
source.mysql_ssl_ca = config[:sslca] if config[:sslca]
source.mysql_ssl_cert = config[:sslcert] if config[:sslcert]
source.mysql_ssl_key = config[:sslkey] if config[:sslkey]
end

def set_source_fields(source)
Expand Down
8 changes: 7 additions & 1 deletion spec/sphinx_helper.rb
Expand Up @@ -18,6 +18,9 @@ def initialize
@username = config['username']
@password = config['password']
@socket = config['socket']
@sslca = config['sslca']
@sslcert = config['sslcert']
@sslkey = config['sslkey']
end

@path = File.expand_path(File.dirname(__FILE__))
Expand All @@ -30,7 +33,10 @@ def setup_mysql
:username => @username,
:password => @password,
:host => @host,
:socket => @socket
:socket => @socket,
:sslca => @sslca,
:sslcert => @sslcert,
:sslkey => @sslkey
)
ActiveRecord::Base.logger = Logger.new(File.open('tmp/activerecord.log', 'a'))

Expand Down
4 changes: 4 additions & 0 deletions spec/thinking_sphinx/source_spec.rb
Expand Up @@ -85,6 +85,10 @@
@riddle.sql_host.should == config[:host]
@riddle.sql_port.should == config[:port]
@riddle.sql_sock.should == config[:socket]

@riddle.mysql_ssl_ca.should == config[:sslca]
@riddle.mysql_ssl_cert.should == config[:sslcert]
@riddle.mysql_ssl_key.should == config[:sslkey]
end

it "should use a environment user if nothing else is provided" do
Expand Down

0 comments on commit 8906e3a

Please sign in to comment.