Skip to content

Commit

Permalink
Only supported Rails, rubies supporting 1.9 mode
Browse files Browse the repository at this point in the history
Also upgrade hash syntax
  • Loading branch information
justincampbell committed Nov 27, 2013
1 parent 88a4d66 commit f48963f
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 68 deletions.
19 changes: 6 additions & 13 deletions .travis.yml
@@ -1,25 +1,18 @@
env:
- RAILS_VERSION=none
- RAILS_VERSION=2.3
- RAILS_VERSION=3.0
- RAILS_VERSION=3.1
- RAILS_VERSION=3.2
- RAILS_VERSION=4.0
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- jruby
- rbx
- ree
- 2.0.0
- jruby-19mode
- rbx-19mode
- jruby-head
- ruby-head
matrix:
allow_failures:
- rvm: jruby
- rvm: rbx
- rvm: ruby-head
exclude:
- rvm: ruby-head
env: RAILS_VERSION=2.3
- rvm: jruby-head
notifications:
email:
- sysadmin@cramerdev.com
Expand Down
10 changes: 1 addition & 9 deletions Gemfile
Expand Up @@ -2,12 +2,4 @@ source 'https://rubygems.org'

gemspec

group :development, :test do
gem 'rake'

group :darwin do
gem 'rb-fsevent'
gem 'growl'
end
end

gem 'guard-rspec'
10 changes: 3 additions & 7 deletions capistrano-notifier.gemspec
Expand Up @@ -16,22 +16,18 @@ Gem::Specification.new do |gem|
gem.version = Capistrano::Notifier::VERSION

case ENV['RAILS_VERSION']
when '2.3'
gem.add_dependency 'actionmailer', '~> 2.3.0'
when '3.0'
gem.add_dependency 'actionmailer', '~> 3.0.0'
when '3.1'
gem.add_dependency 'actionmailer', '~> 3.1.0'
when '3.2'
gem.add_dependency 'actionmailer', '~> 3.2.0'
when '4.0'
gem.add_dependency 'actionmailer', '~> 4.0.0'
else
gem.add_dependency 'actionmailer'
end

gem.add_dependency 'activesupport'
gem.add_dependency 'capistrano', '>= 2', '< 3'

gem.add_development_dependency 'guard-rspec'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'rspec'
gem.add_development_dependency 'timecop'
end
10 changes: 5 additions & 5 deletions lib/capistrano/notifier/mail.rb
Expand Up @@ -11,11 +11,11 @@ class Capistrano::Notifier::Mailer < ActionMailer::Base
if ActionMailer::Base.respond_to?(:mail)
def notice(text, from, subject, to, delivery_method)
mail({
:body => text,
:delivery_method => delivery_method,
:from => from,
:subject => subject,
:to => to
body: text,
delivery_method: delivery_method,
from: from,
subject: subject,
to: to
})
end
else
Expand Down
2 changes: 1 addition & 1 deletion lib/capistrano/notifier/statsd.rb
Expand Up @@ -2,7 +2,7 @@
require 'socket'

class Capistrano::Notifier::StatsD < Capistrano::Notifier::Base
DEFAULTS = { :host => "127.0.0.1", :port => "8125", :with => :counter }
DEFAULTS = { host: "127.0.0.1", port: "8125", with: :counter }

def self.load_into(configuration)
configuration.load do
Expand Down
60 changes: 30 additions & 30 deletions spec/capistrano/notifier/mail_spec.rb
Expand Up @@ -8,10 +8,10 @@
before :each do
configuration.load do |configuration|
set :notifier_mail_options, {
:github => 'example/example',
:method => :sendmail,
:from => 'sender@example.com',
:to => 'example@example.com'
github: 'example/example',
method: :sendmail,
from: 'sender@example.com',
to: 'example@example.com'
}

set :application, 'example'
Expand All @@ -32,10 +32,10 @@
it 'delivers mail' do
configuration.load do |configuration|
set :notifier_mail_options, {
:github => 'example/example',
:method => :test,
:from => 'sender@example.com',
:to => 'example@example.com'
github: 'example/example',
method: :test,
from: 'sender@example.com',
to: 'example@example.com'
}
end

Expand All @@ -58,32 +58,32 @@
it 'delivers smtp mail' do
configuration.load do |configuration|
set :notifier_mail_options, {
:github => 'example/example',
:method => :test,
:from => 'sender@example.com',
:to => 'example@example.com',
:smtp_settings => {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:authentication => "plain",
:enable_starttls_auto => true,
:user_name => "USERNAME",
:password => "PASSWORD"
github: 'example/example',
method: :test,
from: 'sender@example.com',
to: 'example@example.com',
smtp_settings: {
address: "smtp.gmail.com",
port: 587,
domain: "gmail.com",
authentication: "plain",
enable_starttls_auto: true,
user_name: "USERNAME",
password: "PASSWORD"
}
}
end

subject.perform

subject.send(:smtp_settings).should == {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:authentication => "plain",
:enable_starttls_auto => true,
:user_name => "USERNAME",
:password => "PASSWORD"
address: "smtp.gmail.com",
port: 587,
domain: "gmail.com",
authentication: "plain",
enable_starttls_auto: true,
user_name: "USERNAME",
password: "PASSWORD"
}

last_delivery = ActionMailer::Base.deliveries.last
Expand All @@ -101,7 +101,7 @@
it 'should work with gitlab' do
configuration.load do |configuration|
set :notifier_mail_options, {
:giturl => 'https://my.gitlab.url/',
giturl: 'https://my.gitlab.url/',
}
end

Expand All @@ -111,8 +111,8 @@
it 'should default to whatever was specified in giturl' do
configuration.load do |configuration|
set :notifier_mail_options, {
:giturl => 'https://my.gitlab.url/',
:github => 'example/example'
giturl: 'https://my.gitlab.url/',
github: 'example/example'
}
end

Expand Down
6 changes: 3 additions & 3 deletions spec/capistrano/notifier/statsd_spec.rb
Expand Up @@ -41,8 +41,8 @@
before :each do
configuration.load do
set :notifier_statsd_options, {
:host => '10.0.0.1',
:port => '1234'
host: '10.0.0.1',
port: '1234'
}

set :application, 'example'
Expand All @@ -59,7 +59,7 @@
before :each do
configuration.load do
set :notifier_statsd_options, {
:with => :gauge
with: :gauge
}

set :application, 'example'
Expand Down

0 comments on commit f48963f

Please sign in to comment.