Permalink
Browse files

Only supported Rails, rubies supporting 1.9 mode

Also upgrade hash syntax
  • Loading branch information...
1 parent 88a4d66 commit f48963fc1a2976f73de8d41f619a32fad9920de0 @justincampbell justincampbell committed Nov 27, 2013
View
19 .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
View
10 Gemfile
@@ -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'
View
10 capistrano-notifier.gemspec
@@ -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
View
10 lib/capistrano/notifier/mail.rb
@@ -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
View
2 lib/capistrano/notifier/statsd.rb
@@ -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
View
60 spec/capistrano/notifier/mail_spec.rb
@@ -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'
@@ -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
@@ -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
@@ -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
@@ -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
View
6 spec/capistrano/notifier/statsd_spec.rb
@@ -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'
@@ -59,7 +59,7 @@
before :each do
configuration.load do
set :notifier_statsd_options, {
- :with => :gauge
+ with: :gauge
}
set :application, 'example'

0 comments on commit f48963f

Please sign in to comment.