mail_manager 0.1.4 → 3.0.0

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.
Files changed (45) hide show
  1. checksums.yaml +8 -8
  2. data/.gitignore +1 -0
  3. data/.rspec +1 -0
  4. data/.ruby-version +1 -1
  5. data/Gemfile +17 -12
  6. data/Procfile +1 -2
  7. data/app/controllers/mail_manager/application_controller.rb +2 -1
  8. data/app/models/mail_manager.rb +0 -9
  9. data/app/models/mail_manager/contactable_registry.rb +2 -2
  10. data/app/models/mail_manager/mailer.rb +24 -16
  11. data/app/models/mail_manager/subscription.rb +2 -2
  12. data/config/spring.rb +1 -0
  13. data/{spec/test_app/config/lockable.yml → config/with_lock.yml} +0 -0
  14. data/features/support/env.rb +3 -23
  15. data/lib/mail_manager/engine.rb +3 -0
  16. data/lib/mail_manager/lock.rb +36 -31
  17. data/lib/mail_manager/version.rb +1 -1
  18. data/mail_manager.gemspec +7 -4
  19. data/script/with_lock +37 -0
  20. data/spec/spec_helper.rb +4 -3
  21. data/spec/test_app/.rspec +2 -0
  22. data/spec/test_app/bin/cucumber +7 -0
  23. data/spec/test_app/bin/rails +10 -0
  24. data/spec/test_app/bin/rake +7 -0
  25. data/spec/test_app/bin/rspec +7 -0
  26. data/spec/test_app/bin/spring +18 -0
  27. data/spec/test_app/config/cucumber.yml +8 -0
  28. data/spec/test_app/config/database.mysql.yml +28 -0
  29. data/spec/test_app/config/{database.yml → database.sqlite.yml} +4 -1
  30. data/spec/test_app/config/spring.rb +1 -0
  31. data/spec/test_app/config/with_lock.example.yml +3 -0
  32. data/spec/test_app/features/support/env.rb +58 -0
  33. data/spec/test_app/lib/tasks/cucumber.rake +65 -0
  34. data/spec/test_app/script/cucumber +10 -0
  35. data/spec/test_app/script/{lockable → with_lock} +13 -13
  36. data/spec/test_app/spec/models/mail_manager/bounce_spec.rb +6 -3
  37. data/spec/test_app/spec/models/mail_manager/mailer_spec.rb +9 -0
  38. data/spec/test_app/spec/models/mail_manager/mailing_list_spec.rb +3 -3
  39. data/spec/test_app/spec/models/user_spec.rb +5 -5
  40. data/spec/test_app/spec/spec_helper.rb +38 -0
  41. data/spec/test_app/spec/support/database_cleaner.rb +6 -2
  42. data/spec/test_app/spec/support/post_office.rb +13 -0
  43. metadata +100 -27
  44. data/engine_plan.rb +0 -13
  45. data/zeus.json +0 -22
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTM3MzI4NzE3MmUxZDQ2N2VmMDRmMTc3NDY4ODc4MjVkZjVmOTUwMg==
4
+ YmI2YWUyOThkMDMzMWU4MGY2YzY0YjM4YjFhMmExMDVjNzU3MmQzOA==
5
5
  data.tar.gz: !binary |-
6
- ZTI0Yjg4NzgxNWVlMzc0ZWY3NWU2MjYwNTEyZGUwMzg5NjU3ZDdlMQ==
6
+ ZmMzMDA3OTNkZWYxY2EwM2UzMTlhNmE3ZjM0ZWZkNGYzMGM4NjExNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjUzYzcwYzQxMjI2ODdkOGRjNTlkYWQ5NjgyZGQwMThmNTlmN2M4MzAzZDdl
10
- ZGJjY2M0MWY0ZDRkMjlhZjQ4ZTczN2I2OGYyMjY4NjFkNmViYWJhNjE1ZmU4
11
- MmVlODRmYjEwZGY2YzZkZTA1Njc4ODBjYmI0OGQ0NmQ1YTgwMmQ=
9
+ MTRiYzdhMTk4ZWM5ZDYxMmM2MWYzZDg0NGFkYzZiMjg5N2JmNWFhOGJhNWU1
10
+ NzhhMmM2OTkwMjg1NTM3MzE4OGJkNjY4Y2YwMjRlMjFhMWE1NWY5YmY1ZjZk
11
+ ODE5NDJjZDA3NTFlNGRlNjJlNjY3NDI1NmE3NTY3YzI2ZDM3YWE=
12
12
  data.tar.gz: !binary |-
13
- NjA4OWM0ZTU1YzFlZjg5NWY1ZDFiOGQxYWUwODQ4YjU2MzViZDljYmUxMDYz
14
- YTM0ZjgwMDc0MDU0Y2RmYWJlOGExMjJkYTBlYzA5ZTJhN2I4MGU1YjE5OTgz
15
- YzE1ZDlkOTBlZDVkNzg5MTMwYWVhZjVkZGE1YWUxYzBiZDUwY2U=
13
+ YWYyYjI3MWZkODRlNmMzMjFhMmU5OWIzMzAxZjY0NmZmZTZhM2FlYjE0NDll
14
+ MWQ2NWE1ODEzNjU3OWMxZjcyMjk2YmRmZDRjOWNmZGZlYjgxNzE0N2Q3MTc2
15
+ NmYxMTg2ODJhMWRiYWEyNTJlZjFiNzZkNWU4MDQ1YjkwZWNkMjY=
data/.gitignore CHANGED
@@ -18,3 +18,4 @@ tmp
18
18
  *.sqlite3
19
19
  log
20
20
  *.log
21
+ spec/test_app/config/database.yml
data/.rspec CHANGED
@@ -1 +1,2 @@
1
1
  --color
2
+ --format documentation
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-1.9.3-p547
1
+ ruby-1.9.3-p551
data/Gemfile CHANGED
@@ -6,18 +6,23 @@ gemspec
6
6
 
7
7
  # jquery-rails is used by the dummy application
8
8
  gem "jquery-rails"
9
-
10
- # Testing Gems
11
- gem "rspec-rails", "~>2.14"
12
- gem "factory_girl_rails", "~>4.3"
13
- gem "faker"
14
- gem "sqlite3"
15
- gem 'post_office'
16
- gem 'foreman'
17
- gem 'database_cleaner'
9
+ gem 'spring'
10
+ gem "spring-commands-rspec"
11
+ gem "spring-commands-cucumber"
12
+ gem 'pry-rails'
13
+ gem 'thor', '0.19.1'
18
14
  gem 'guard-rspec'
19
15
  gem 'guard-livereload'
20
- gem 'zeus'
21
- gem 'pry-rails'
22
16
  gem 'delayed_job_active_record'
23
- gem 'cucumber-rails'
17
+ gem 'sqlite3'
18
+ gem 'mysql2'
19
+
20
+ # Testing Gems
21
+ group :test do
22
+ gem "rspec-rails", "~>2.14"
23
+ gem "factory_girl_rails", "~>4.3"
24
+ gem "faker"
25
+ gem 'post_office'
26
+ gem 'database_cleaner'
27
+ gem 'cucumber-rails', require: false
28
+ end
data/Procfile CHANGED
@@ -1,4 +1,3 @@
1
- lockable: spec/test_app/script/lockable run
1
+ lockable: spec/test_app/script/with_lock run
2
2
  post_office: post_office -s 25000 -p 11000
3
3
  guard: guard
4
- zeus: zeus start
@@ -1,4 +1,5 @@
1
1
  module MailManager
2
- class ApplicationController < ActionController::Base
2
+ class ApplicationController < ApplicationController
3
+ load_and_authorize_resource if respond_to? :load_and_authorize_resource
3
4
  end
4
5
  end
@@ -1,12 +1,3 @@
1
1
  module MailManager
2
2
  end
3
3
 
4
- require 'mail_manager/bounce'
5
- require 'mail_manager/mailable_registry'
6
- require 'mail_manager/mailer'
7
- require 'mail_manager/mailing'
8
- require 'mail_manager/mailing_list'
9
- require 'mail_manager/message'
10
- require 'mail_manager/contactable_registry'
11
- require 'mail_manager/subscription'
12
- require 'mail_manager/contact'
@@ -95,8 +95,8 @@ module MailManager
95
95
  subscription_attributes[:mailing_list_id].to_i == subscription.mailing_list_id.to_i} || {}
96
96
  end
97
97
 
98
- def subscribe(mailing_list)
99
- set_contactable_data && MailManager::Subscription.subscribe(contact,mailing_list)
98
+ def subscribe(mailing_list, status='active')
99
+ set_contactable_data && MailManager::Subscription.subscribe(contact,mailing_list, status)
100
100
  end
101
101
 
102
102
  def unsubscribe(mailing_list)
@@ -241,23 +241,31 @@ module MailManager
241
241
 
242
242
  def fetch(uri_str, limit = 10)
243
243
  # You should choose better exception.
244
- # raise ArgumentError, 'HTTP redirect too deep' if limit == 0
245
-
246
- # response = Net::HTTP.get_response(URI.parse(uri_str))
247
- # case response
248
- # when Net::HTTPSuccess then response.body
249
- # when Net::HTTPRedirection then fetch(response['location'], limit - 1)
250
- # else
251
- # response.error!
252
- # end
253
- body = ''
254
- Curl.get(uri_str) do |http|
255
- http.follow_location = true
256
- http.interface = '127.0.0.1' if request_local?(uri_str)
257
- http.on_success{|response| body = response.body}
244
+ raise ArgumentError, 'HTTP redirect too deep' if limit == 0
245
+ uri = URI.parse(uri_str)
246
+ request = Net::HTTP::Get.new("#{uri.path}#{"?"+uri.query if uri.query.to_s.strip != ''}")
247
+
248
+ response = Net::HTTP.start(
249
+ uri.host, uri.port,
250
+ :use_ssl => uri.scheme == 'https',
251
+ :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|
252
+ https.request(request)
258
253
  end
259
- raise Exception.new("Couldn't fetch URL: #{uri_str}") unless body.present?
260
- body
254
+ case response
255
+ when Net::HTTPSuccess then response.body
256
+ when Net::HTTPRedirection then fetch(response['location'], limit - 1)
257
+ else
258
+ response.error!
259
+ end
260
+ # CURB version - gem wouldn't install anymore on CentOS
261
+ # body = ''
262
+ # Curl.get(uri_str) do |http|
263
+ # http.follow_location = true
264
+ # http.interface = '127.0.0.1' if request_local?(uri_str)
265
+ # http.on_success{|response| body = response.body}
266
+ # end
267
+ # raise Exception.new("Couldn't fetch URL: #{uri_str}") unless body.present?
268
+ # body
261
269
  end
262
270
  end
263
271
  end
@@ -66,8 +66,8 @@ module MailManager
66
66
  end
67
67
 
68
68
  # subscribes the contact to the list
69
- def self.subscribe(contact, mailing_list)
70
- change_subscription_status(contact, mailing_list, 'active')
69
+ def self.subscribe(contact, mailing_list, status='active')
70
+ change_subscription_status(contact, mailing_list, status)
71
71
  end
72
72
 
73
73
  # unsubscribes the contact from the list
data/config/spring.rb ADDED
@@ -0,0 +1 @@
1
+ Spring.application_root = 'spec/test_app'
@@ -2,30 +2,10 @@
2
2
  ENV["RAILS_ENV"] ||= "test"
3
3
  ENV["RAILS_ROOT"] ||= File.dirname(__FILE__) + "/../../spec/test_app"
4
4
  require File.expand_path(ENV['RAILS_ROOT'] + "/config/environment.rb")
5
+ require 'database_cleaner'
5
6
  require 'cucumber/rails/world'
6
7
  require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
7
- Cucumber::Rails.use_transactional_fixtures
8
- Cucumber::Rails.bypass_rescue # Comment out this line if you want Rails own error handling
9
- # (e.g. rescue_action_in_public / rescue_responses / rescue_from)
10
8
 
11
- require 'webrat'
9
+ `rake db:schema:load`
12
10
 
13
- Webrat.configure do |config|
14
- config.mode = :rails
15
- end
16
-
17
- require 'cucumber/rails/rspec'
18
- require 'webrat/core/matchers'
19
-
20
- `rake db:test:clone_structure`
21
-
22
- require "#{MailManager::PLUGIN_ROOT}/spec/factories"
23
- require 'pickle/world'
24
- # Example of configuring pickle:
25
- #
26
- #Pickle.configure do |config|
27
- # config.adapters = [:factory_girl]
28
- #config.map 'I', 'myself', 'me', 'my', :to => 'user: "me"'
29
- #end
30
- require 'pickle/path/world'
31
- require 'pickle/email/world'
11
+ #require "#{MailManager::PLUGIN_ROOT}/spec/factories"
@@ -9,6 +9,9 @@ module MailManager
9
9
  MailManager.initialize_with_config(MailManager::Config.initialize!)
10
10
  end
11
11
  end
12
+ initializer "mail_manager.factories", :after => "factory_girl.set_factory_paths" do
13
+ FactoryGirl.definition_file_paths << File.expand_path('../../../spec/test_app/spec/factories', __FILE__) if defined?(FactoryGirl)
14
+ end
12
15
  config.generators do |g|
13
16
  g.test_framework :rspec, :fixture => false
14
17
  g.fixture_replacement :factory_girl, :dir => 'spec/factories'
@@ -1,36 +1,41 @@
1
- class MailManager::Lock
2
- class MailManager::LockException < Exception
3
- end
4
- def self.with_lock(name, timeout=5, max_attempts=1, &block)
5
- ActiveRecord::Base.connection_pool.with_connection do |connection|
6
- begin
7
- lock = get_lock(connection,name,timeout,max_attempts)
8
- raise MailManager::LockException.new("Failed to obtain lock #{name} in #{timeout} secs") unless lock
9
- yield lock
10
- ensure
11
- is_released = release_lock(connection,name)
12
- Rails.logger.warn "Warning: lock #{name} not released!" unless is_released.values.include?('1')
1
+ if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
2
+ class MailManager::Lock
3
+ class MailManager::LockException < Exception
4
+ end
5
+ def self.with_lock(name, timeout=5, max_attempts=1, &block)
6
+ ActiveRecord::Base.connection_pool.with_connection do |connection|
7
+ begin
8
+ lock = get_lock(connection,name,timeout,max_attempts)
9
+ raise MailManager::LockException.new("Failed to obtain lock #{name} in #{timeout} secs") unless lock
10
+ yield lock
11
+ ensure
12
+ is_released = release_lock(connection,name)
13
+ Rails.logger.warn "Warning: lock #{name} not released!" unless is_released.values.include?('1')
14
+ end
13
15
  end
14
16
  end
15
- end
16
-
17
- private
18
-
19
- def self.name_prefix
20
- "#{MailManager.site_url}-#{Rails.env}"
21
- end
22
-
23
- def self.get_lock(connection,name,timeout,max_attempts)
24
- attempts = 0
25
- lock = {}
26
- while !lock.values.include?('1') and attempts < max_attempts do
27
- attempts += 1
28
- lock = connection.select_one("SELECT GET_LOCK('#{name_prefix}-#{name}',#{timeout})")
17
+
18
+ private
19
+
20
+ def self.name_prefix
21
+ "#{MailManager.site_url}-#{Rails.env}"
22
+ end
23
+
24
+ def self.get_lock(connection,name,timeout,max_attempts)
25
+ attempts = 0
26
+ lock = {}
27
+ while !lock.values.include?('1') and attempts < max_attempts do
28
+ attempts += 1
29
+ lock = connection.select_one("SELECT GET_LOCK('#{name_prefix}-#{name}',#{timeout})")
30
+ end
31
+ lock.values.detect{|value| value.to_s.eql?('1')}
32
+ end
33
+
34
+ def self.release_lock(connection,name)
35
+ connection.select_one("SELECT RELEASE_LOCK('#{name_prefix}-#{name}')")
29
36
  end
30
- lock.values.detect{|value| value.to_s.eql?('1')}
31
- end
32
-
33
- def self.release_lock(connection,name)
34
- connection.select_one("SELECT RELEASE_LOCK('#{name_prefix}-#{name}')")
35
37
  end
38
+ else
39
+ require 'with_lock'
40
+ MailManager::Lock = WithLock::Client
36
41
  end
@@ -1,3 +1,3 @@
1
1
  module MailManager
2
- VERSION = "0.1.4"
2
+ VERSION = "3.0.0"
3
3
  end
data/mail_manager.gemspec CHANGED
@@ -13,12 +13,15 @@ Gem::Specification.new do |gem|
13
13
  gem.homepage = "http://ireach.com"
14
14
 
15
15
  gem.add_dependency "rails", "~>3.2"
16
- gem.add_dependency "daemons"
17
- gem.add_dependency "mini_magick"
18
- gem.add_dependency "will_paginate"
16
+ gem.add_dependency "daemons", "~>1.1"
17
+ gem.add_dependency "with_lock", "~>0.1"
18
+ gem.add_dependency "mini_magick", "~>4.1"
19
+ gem.add_dependency "will_paginate", "~>3.0"
20
+ gem.add_dependency 'unix_utils', "~>0.0"
19
21
  gem.add_dependency "delayed_job", "~>4"
20
- gem.add_dependency 'delayed_job_active_record'
22
+ gem.add_dependency 'delayed_job_active_record', "~>4"
21
23
  gem.add_dependency "dynamic_form", "~>1.1"
24
+ gem.add_dependency 'cancancan', "~>1.9"
22
25
 
23
26
  gem.files = `git ls-files`.split($/)
24
27
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
data/script/with_lock ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- encoding: utf-8 -*-
3
+ $:.push File.expand_path(File.join('..','..','lib'), __FILE__)
4
+
5
+ require "rubygems"
6
+ require "bundler"
7
+ Bundler.setup
8
+
9
+ FileUtils.mkdir_p('tmp/pids') unless File.exists?('tmp/pids')
10
+
11
+ require 'with_lock'
12
+ if ARGV.include?('start')
13
+ begin
14
+ locker = WithLock::Client.locker
15
+ rescue WithLock::LockException => e
16
+ puts "Starting WithLock on #{WithLock::Server::url}!"
17
+ WithLock::Server::start_service
18
+ locker = WithLock::Client.locker
19
+ end
20
+ puts "Clearing WithLock locks!"
21
+ locker = WithLock::Client.locker
22
+ locker.locks.each_pair do |lock,data|
23
+ pid = data[:owner].split('|').last
24
+ if locker.running?(pid) || !data[:owner].include?(`hostname`.strip)
25
+ puts "Running - pid"
26
+ else
27
+ puts "Not Running - pid"
28
+ locker.release(data[:owner],lock)
29
+ end
30
+ end
31
+ elsif ARGV.include?('stop')
32
+ puts "Stopping WithLock!"
33
+ WithLock::Server::stop_service
34
+ elsif ARGV.include?('run')
35
+ puts "Running WithLock!"
36
+ WithLock::Server::run_service
37
+ end
data/spec/spec_helper.rb CHANGED
@@ -3,6 +3,7 @@ ENV["RAILS_ENV"] ||= 'test'
3
3
 
4
4
  require File.expand_path("../../spec/test_app/config/environment", __FILE__)
5
5
 
6
+ require 'database_cleaner'
6
7
  require 'rspec/rails'
7
8
  # require 'rspec/autorun'
8
9
  `rake db:schema:load`
@@ -25,7 +26,7 @@ RSpec.configure do |config|
25
26
  # If you're not using ActiveRecord, or you'd prefer not to run each of your
26
27
  # examples within a transaction, remove the following line or assign false
27
28
  # instead of true.
28
- config.use_transactional_fixtures = false
29
+ config.use_transactional_fixtures = true
29
30
 
30
31
  # If true, the base class of anonymous controllers will be inferred
31
32
  # automatically. This will be the default behavior in future versions of
@@ -41,7 +42,7 @@ RSpec.configure do |config|
41
42
  config.color_enabled = true
42
43
 
43
44
  # Use color not only in STDOUT but also in pagers and files
44
- config.tty = true
45
+ #config.tty = true
45
46
 
46
- config.formatter = :documentation # :progress, :html, :textmate
47
+ #config.formatter = :documentation # :progress, :html, :textmate
47
48
  end
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ require 'bundler/setup'
7
+ load Gem.bin_path('cucumber', 'cucumber')
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
7
+
8
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
9
+ require File.expand_path('../../config/boot', __FILE__)
10
+ require 'rails/commands'
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ require 'bundler/setup'
7
+ load Gem.bin_path('rake', 'rake')
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ require 'bundler/setup'
7
+ load Gem.bin_path('rspec-core', 'rspec')
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast
4
+ # It gets overwritten when you run the `spring binstub` command
5
+
6
+ unless defined?(Spring)
7
+ require "rubygems"
8
+ require "bundler"
9
+
10
+ if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
11
+ ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
12
+ ENV["GEM_HOME"] = ""
13
+ Gem.paths = ENV
14
+
15
+ gem "spring", match[1]
16
+ require "spring/binstub"
17
+ end
18
+ end
@@ -0,0 +1,8 @@
1
+ <%
2
+ rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
+ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
+ std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
5
+ %>
6
+ default: <%= std_opts %> features
7
+ wip: --tags @wip:3 --wip features
8
+ rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
@@ -0,0 +1,28 @@
1
+ credentials: &credentials
2
+ encoding: utf8
3
+ adapter: mysql2
4
+ username: mail_manager
5
+ password: mail_manager_pass
6
+ host: localhost
7
+ reconnect: true
8
+ pool: 5
9
+ timeout: 5000
10
+
11
+ development:
12
+ <<: *credentials
13
+ database: mail_manager_development
14
+
15
+ # Warning: The database defined as "test" will be erased and
16
+ # re-generated from your development database when you run "rake".
17
+ # Do not set this db to the same as development or production.
18
+ test: &test
19
+ <<: *credentials
20
+ database: mail_manager_test
21
+
22
+ # production:
23
+ # <<: *credentials
24
+ # database: mail_manager
25
+ # host: localhost
26
+
27
+ cucumber:
28
+ <<: *test
@@ -12,7 +12,7 @@ development:
12
12
  # Warning: The database defined as "test" will be erased and
13
13
  # re-generated from your development database when you run "rake".
14
14
  # Do not set this db to the same as development or production.
15
- test:
15
+ test: &test
16
16
  adapter: sqlite3
17
17
  database: db/test.sqlite3
18
18
  pool: 5
@@ -23,3 +23,6 @@ test:
23
23
  # database: db/production.sqlite3
24
24
  # pool: 5
25
25
  # timeout: 5000
26
+
27
+ cucumber:
28
+ <<: *test
@@ -0,0 +1 @@
1
+ Spring.application_root = './'
@@ -0,0 +1,3 @@
1
+ url: druby://localhost:9999
2
+ scope: <%= File.basename(File.expand_path('.')) %><%= ":#{Rails.env}" if defined?(Rails) %>
3
+ directory: 'tmp'
@@ -0,0 +1,58 @@
1
+ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
2
+ # It is recommended to regenerate this file in the future when you upgrade to a
3
+ # newer version of cucumber-rails. Consider adding your own code to a new file
4
+ # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5
+ # files.
6
+
7
+ require 'cucumber/rails'
8
+
9
+ # Capybara defaults to CSS3 selectors rather than XPath.
10
+ # If you'd prefer to use XPath, just uncomment this line and adjust any
11
+ # selectors in your step definitions to use the XPath syntax.
12
+ # Capybara.default_selector = :xpath
13
+
14
+ # By default, any exception happening in your Rails application will bubble up
15
+ # to Cucumber so that your scenario will fail. This is a different from how
16
+ # your application behaves in the production environment, where an error page will
17
+ # be rendered instead.
18
+ #
19
+ # Sometimes we want to override this default behaviour and allow Rails to rescue
20
+ # exceptions and display an error page (just like when the app is running in production).
21
+ # Typical scenarios where you want to do this is when you test your error pages.
22
+ # There are two ways to allow Rails to rescue exceptions:
23
+ #
24
+ # 1) Tag your scenario (or feature) with @allow-rescue
25
+ #
26
+ # 2) Set the value below to true. Beware that doing this globally is not
27
+ # recommended as it will mask a lot of errors for you!
28
+ #
29
+ ActionController::Base.allow_rescue = false
30
+
31
+ # Remove/comment out the lines below if your app doesn't have a database.
32
+ # For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
33
+ begin
34
+ DatabaseCleaner.strategy = :transaction
35
+ rescue NameError
36
+ raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
37
+ end
38
+
39
+ # You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
40
+ # See the DatabaseCleaner documentation for details. Example:
41
+ #
42
+ # Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
43
+ # # { :except => [:widgets] } may not do what you expect here
44
+ # # as Cucumber::Rails::Database.javascript_strategy overrides
45
+ # # this setting.
46
+ # DatabaseCleaner.strategy = :truncation
47
+ # end
48
+ #
49
+ # Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
50
+ # DatabaseCleaner.strategy = :transaction
51
+ # end
52
+ #
53
+
54
+ # Possible values are :truncation and :transaction
55
+ # The :transaction strategy is faster, but might give you threading problems.
56
+ # See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
57
+ Cucumber::Rails::Database.javascript_strategy = :truncation
58
+
@@ -0,0 +1,65 @@
1
+ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
2
+ # It is recommended to regenerate this file in the future when you upgrade to a
3
+ # newer version of cucumber-rails. Consider adding your own code to a new file
4
+ # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5
+ # files.
6
+
7
+
8
+ unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
9
+
10
+ vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
11
+ $LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
12
+
13
+ begin
14
+ require 'cucumber/rake/task'
15
+
16
+ namespace :cucumber do
17
+ Cucumber::Rake::Task.new({:ok => 'test:prepare'}, 'Run features that should pass') do |t|
18
+ t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
19
+ t.fork = true # You may get faster startup if you set this to false
20
+ t.profile = 'default'
21
+ end
22
+
23
+ Cucumber::Rake::Task.new({:wip => 'test:prepare'}, 'Run features that are being worked on') do |t|
24
+ t.binary = vendored_cucumber_bin
25
+ t.fork = true # You may get faster startup if you set this to false
26
+ t.profile = 'wip'
27
+ end
28
+
29
+ Cucumber::Rake::Task.new({:rerun => 'test:prepare'}, 'Record failing features and run only them if any exist') do |t|
30
+ t.binary = vendored_cucumber_bin
31
+ t.fork = true # You may get faster startup if you set this to false
32
+ t.profile = 'rerun'
33
+ end
34
+
35
+ desc 'Run all features'
36
+ task :all => [:ok, :wip]
37
+
38
+ task :statsetup do
39
+ require 'rails/code_statistics'
40
+ ::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
41
+ ::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
42
+ end
43
+ end
44
+ desc 'Alias for cucumber:ok'
45
+ task :cucumber => 'cucumber:ok'
46
+
47
+ task :default => :cucumber
48
+
49
+ task :features => :cucumber do
50
+ STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
51
+ end
52
+
53
+ # In case we don't have the generic Rails test:prepare hook, append a no-op task that we can depend upon.
54
+ task 'test:prepare' do
55
+ end
56
+
57
+ task :stats => 'cucumber:statsetup'
58
+ rescue LoadError
59
+ desc 'cucumber rake task not available (cucumber not installed)'
60
+ task :cucumber do
61
+ abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
62
+ end
63
+ end
64
+
65
+ end
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
4
+ if vendored_cucumber_bin
5
+ load File.expand_path(vendored_cucumber_bin)
6
+ else
7
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
8
+ require 'cucumber'
9
+ load Cucumber::BINARY
10
+ end
@@ -7,17 +7,17 @@ Bundler.setup
7
7
 
8
8
  FileUtils.mkdir_p('tmp/pids') unless File.exists?('tmp/pids')
9
9
 
10
- require 'lockable'
10
+ require 'with_lock'
11
11
  if ARGV.include?('start')
12
12
  begin
13
- locker = Lockable::Client.locker
14
- rescue Lockable::LockException => e
15
- puts "Starting Lockable on #{Lockable::Server::url}!"
16
- Lockable::Server::start_service
17
- locker = Lockable::Client.locker
13
+ locker = WithLock::Client.locker
14
+ rescue WithLock::LockException => e
15
+ puts "Starting WithLock on #{WithLock::Server::url}!"
16
+ WithLock::Server::start_service
17
+ locker = WithLock::Client.locker
18
18
  end
19
- puts "Clearing Lockable locks!"
20
- locker = Lockable::Client.locker
19
+ puts "Clearing WithLock locks!"
20
+ locker = WithLock::Client.locker
21
21
  locker.locks.each_pair do |lock,data|
22
22
  pid = data[:owner].split('|').last
23
23
  if locker.running?(pid) || !data[:owner].include?(`hostname`.strip)
@@ -28,9 +28,9 @@ if ARGV.include?('start')
28
28
  end
29
29
  end
30
30
  elsif ARGV.include?('stop')
31
- puts "Stopping Lockable!"
32
- Lockable::Server::stop_service
31
+ puts "Stopping WithLock!"
32
+ WithLock::Server::stop_service
33
33
  elsif ARGV.include?('run')
34
- puts "Running Lockable!"
35
- Lockable::Server::run_service
36
- end
34
+ puts "Running WithLock!"
35
+ WithLock::Server::run_service
36
+ end
@@ -4,14 +4,17 @@ require 'spec_helper'
4
4
  describe MailManager::Bounce do
5
5
  context "when checking pop account" do
6
6
  it "should not blow up when mail contains a bad extended char" do
7
+ Delayed::Worker.delay_jobs = true
7
8
  send_bounce('bad_utf8_chars.eml')
8
9
  MailManager::BounceJob.new.perform
10
+ Delayed::Worker.delay_jobs = false
9
11
  end
10
12
  end
11
13
  def send_bounce(filename)
12
- mail = Mail.new(File.readlines(File.expand_path(File.join(__FILE__,'..','..','..','support','files',filename))).join)
13
- mail.delivery_method ActionMailer::Base.delivery_method
14
+ PostOffice.start_post_office
15
+ mail = Mail.new(File.read(File.join(Rails.root,'spec','support','files',filename)))
16
+ mail.delivery_method :smtp
14
17
  mail.delivery_method.settings.merge!(ActionMailer::Base.smtp_settings)
15
18
  mail.deliver
16
19
  end
17
- end
20
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe MailManager::Mailer do
4
+ it "Can fetch images from https servers" do
5
+ image_url = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRwNmnMYLBp2Sw9vg-snbZ_GKONKo_WY0f3S1ETL2era2DZKKqD'
6
+ data = MailManager::Mailer.fetch(image_url)
7
+ expect(data.to_s[0..100]).to include('JFIF')
8
+ end
9
+ end
@@ -6,10 +6,10 @@ describe MailManager::MailingList do
6
6
  @mailing_list = FactoryGirl.build(:mailing_list)
7
7
  end
8
8
  it "must have a name" do
9
- @mailing_list.name.present?.should be_true
10
- @mailing_list.valid?.should be_true
9
+ @mailing_list.name.present?.should == true
10
+ @mailing_list.valid?.should == true
11
11
  @mailing_list.name = nil
12
- @mailing_list.valid?.should be_false
12
+ @mailing_list.valid?.should == false
13
13
  end
14
14
  end
15
15
  end
@@ -8,12 +8,12 @@ describe User do
8
8
  it "should have a uniq email" do
9
9
  @user.save
10
10
  @user2 = FactoryGirl.build(:user, {email: @user.email})
11
- @user2.valid?.should be_false
11
+ @user2.valid?.should == false
12
12
  end
13
13
  it "should have an email" do
14
- @user.valid?.should be_true
14
+ @user.valid?.should == true
15
15
  @user.email = nil
16
- @user.valid?.should be_false
16
+ @user.valid?.should == false
17
17
  end
18
18
  end
19
19
  context "integrated with mail manager" do
@@ -21,10 +21,10 @@ describe User do
21
21
  @user = FactoryGirl.create(:user)
22
22
  end
23
23
  it "should respond to subscriptions" do
24
- @user.respond_to?(:subscriptions).should be_true
24
+ @user.respond_to?(:subscriptions).should == true
25
25
  end
26
26
  it "should have a contact" do
27
- @user.contact.present?.should be_true
27
+ @user.contact.present?.should == true
28
28
  end
29
29
  it "should have the same email as the contact" do
30
30
  @user.email.should == @user.contact.email_address
@@ -0,0 +1,38 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+ require File.expand_path("../../config/environment", __FILE__)
4
+ require 'rspec/rails'
5
+ require 'rspec/autorun'
6
+
7
+ # Requires supporting ruby files with custom matchers and macros, etc,
8
+ # in spec/support/ and its subdirectories.
9
+ Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
10
+
11
+ RSpec.configure do |config|
12
+ # ## Mock Framework
13
+ #
14
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
15
+ #
16
+ # config.mock_with :mocha
17
+ # config.mock_with :flexmock
18
+ # config.mock_with :rr
19
+
20
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
21
+ # config.fixture_path = "#{::Rails.root}/spec/fixtures"
22
+
23
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
24
+ # examples within a transaction, remove the following line or assign false
25
+ # instead of true.
26
+ config.use_transactional_fixtures = false
27
+
28
+ # If true, the base class of anonymous controllers will be inferred
29
+ # automatically. This will be the default behavior in future versions of
30
+ # rspec-rails.
31
+ config.infer_base_class_for_anonymous_controllers = false
32
+
33
+ # Run specs in random order to surface order dependencies. If you find an
34
+ # order dependency and want to debug it, you can fix the order by providing
35
+ # the seed, which is printed after each run.
36
+ # --seed 1234
37
+ config.order = "random"
38
+ end
@@ -5,7 +5,11 @@ RSpec.configure do |config|
5
5
  end
6
6
 
7
7
  config.before(:each) do
8
- DatabaseCleaner.strategy = :transaction
8
+ if ActiveRecord::Base.connection.adapter_name =~ /sqlite/
9
+ DatabaseCleaner.strategy = :truncation # sqlite3 doesn't support nested transactions :transaction
10
+ else
11
+ DatabaseCleaner.strategy = :transaction # assume a transactional database (we're using active_record)
12
+ end
9
13
  end
10
14
 
11
15
  config.before(:each, :js => true) do
@@ -20,4 +24,4 @@ RSpec.configure do |config|
20
24
  DatabaseCleaner.clean
21
25
  end
22
26
 
23
- end
27
+ end
@@ -0,0 +1,13 @@
1
+ module PostOffice
2
+ def self.start_post_office
3
+ return if `lsof -i TCP:25000 | grep LISTEN | wc -l`.to_i == 1
4
+ unless(@post_office_pipe.present?)
5
+ @post_office_pipe = IO.popen("post_office -s 25000 -p 11000")
6
+ 5.times do
7
+ break if `lsof -i TCP:25000 | grep LISTEN | wc -l`.to_i == 1
8
+ sleep 0.1
9
+ end
10
+ Rails.logger.debug "Opened post office! SMTP: 2500 POP: 11000" if `lsof -i TCP:25000 | grep LISTEN | wc -l`.to_i == 1
11
+ end
12
+ end
13
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lone Star Internet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-10 00:00:00.000000000 Z
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -28,44 +28,72 @@ dependencies:
28
28
  name: daemons
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '1.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '1.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: with_lock
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '0.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '0.1'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: mini_magick
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ! '>='
59
+ - - ~>
46
60
  - !ruby/object:Gem::Version
47
- version: '0'
61
+ version: '4.1'
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - ! '>='
66
+ - - ~>
53
67
  - !ruby/object:Gem::Version
54
- version: '0'
68
+ version: '4.1'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: will_paginate
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - ! '>='
73
+ - - ~>
60
74
  - !ruby/object:Gem::Version
61
- version: '0'
75
+ version: '3.0'
62
76
  type: :runtime
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - ! '>='
80
+ - - ~>
67
81
  - !ruby/object:Gem::Version
68
- version: '0'
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: unix_utils
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '0.0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '0.0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: delayed_job
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +112,16 @@ dependencies:
84
112
  name: delayed_job_active_record
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
- - - ! '>='
115
+ - - ~>
88
116
  - !ruby/object:Gem::Version
89
- version: '0'
117
+ version: '4'
90
118
  type: :runtime
91
119
  prerelease: false
92
120
  version_requirements: !ruby/object:Gem::Requirement
93
121
  requirements:
94
- - - ! '>='
122
+ - - ~>
95
123
  - !ruby/object:Gem::Version
96
- version: '0'
124
+ version: '4'
97
125
  - !ruby/object:Gem::Dependency
98
126
  name: dynamic_form
99
127
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +136,20 @@ dependencies:
108
136
  - - ~>
109
137
  - !ruby/object:Gem::Version
110
138
  version: '1.1'
139
+ - !ruby/object:Gem::Dependency
140
+ name: cancancan
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ~>
144
+ - !ruby/object:Gem::Version
145
+ version: '1.9'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ~>
151
+ - !ruby/object:Gem::Version
152
+ version: '1.9'
111
153
  description: Manages the delivery of mailable items. Handles bounces, unsubscribe,
112
154
  opt-in, etc.
113
155
  email:
@@ -196,6 +238,8 @@ files:
196
238
  - config/daemons.yml
197
239
  - config/initializers/delayed_job.rb
198
240
  - config/routes.rb
241
+ - config/spring.rb
242
+ - config/with_lock.yml
199
243
  - db/migrate/001_mail_mgr_initial.rb
200
244
  - db/migrate/002_mail_mgr_create_contact.rb
201
245
  - db/migrate/003_mail_mgr_test_message.rb
@@ -210,7 +254,6 @@ files:
210
254
  - db/mlm_migrate/005_mlm_to_mail_mgr_scoped.rb
211
255
  - doc/README_FOR_APP
212
256
  - doc/mlm.wiki.txt
213
- - engine_plan.rb
214
257
  - features/bounce_management.feature
215
258
  - features/contact_management.feature
216
259
  - features/mailable.feature
@@ -245,9 +288,11 @@ files:
245
288
  - lib/workers/mail_manager/test_message_job.rb
246
289
  - mail_manager.gemspec
247
290
  - script/rails
291
+ - script/with_lock
248
292
  - spec/rcov.opts
249
293
  - spec/spec.opts
250
294
  - spec/spec_helper.rb
295
+ - spec/test_app/.rspec
251
296
  - spec/test_app/README.rdoc
252
297
  - spec/test_app/Rakefile
253
298
  - spec/test_app/app/assets/javascripts/application.js
@@ -266,10 +311,17 @@ files:
266
311
  - spec/test_app/app/views/users/index.html.erb
267
312
  - spec/test_app/app/views/users/new.html.erb
268
313
  - spec/test_app/app/views/users/show.html.erb
314
+ - spec/test_app/bin/cucumber
315
+ - spec/test_app/bin/rails
316
+ - spec/test_app/bin/rake
317
+ - spec/test_app/bin/rspec
318
+ - spec/test_app/bin/spring
269
319
  - spec/test_app/config.ru
270
320
  - spec/test_app/config/application.rb
271
321
  - spec/test_app/config/boot.rb
272
- - spec/test_app/config/database.yml
322
+ - spec/test_app/config/cucumber.yml
323
+ - spec/test_app/config/database.mysql.yml
324
+ - spec/test_app/config/database.sqlite.yml
273
325
  - spec/test_app/config/environment.rb
274
326
  - spec/test_app/config/environments/development.rb
275
327
  - spec/test_app/config/environments/production.rb
@@ -281,9 +333,10 @@ files:
281
333
  - spec/test_app/config/initializers/session_store.rb
282
334
  - spec/test_app/config/initializers/wrap_parameters.rb
283
335
  - spec/test_app/config/locales/en.yml
284
- - spec/test_app/config/lockable.yml
285
336
  - spec/test_app/config/mail_manager.yml
286
337
  - spec/test_app/config/routes.rb
338
+ - spec/test_app/config/spring.rb
339
+ - spec/test_app/config/with_lock.example.yml
287
340
  - spec/test_app/db/migrate/20131217101010_create_users.rb
288
341
  - spec/test_app/db/migrate/20131221064151_mail_mgr_initial.rb
289
342
  - spec/test_app/db/migrate/20131221064152_mail_mgr_create_contact.rb
@@ -295,30 +348,35 @@ files:
295
348
  - spec/test_app/db/migrate/20131221072600_create_delayed_jobs.rb
296
349
  - spec/test_app/db/schema.rb
297
350
  - spec/test_app/db/structure.sql
351
+ - spec/test_app/features/support/env.rb
352
+ - spec/test_app/lib/tasks/cucumber.rake
298
353
  - spec/test_app/public/404.html
299
354
  - spec/test_app/public/422.html
300
355
  - spec/test_app/public/500.html
301
356
  - spec/test_app/public/favicon.ico
357
+ - spec/test_app/script/cucumber
302
358
  - spec/test_app/script/delayed_job
303
- - spec/test_app/script/lockable
304
359
  - spec/test_app/script/rails
360
+ - spec/test_app/script/with_lock
305
361
  - spec/test_app/spec/controllers/users_controller_spec.rb
306
362
  - spec/test_app/spec/factories/mailing_lists.rb
307
363
  - spec/test_app/spec/factories/mailings.rb
308
364
  - spec/test_app/spec/factories/original_factories.rb.txt
309
365
  - spec/test_app/spec/factories/users.rb
310
366
  - spec/test_app/spec/models/mail_manager/bounce_spec.rb
367
+ - spec/test_app/spec/models/mail_manager/mailer_spec.rb
311
368
  - spec/test_app/spec/models/mail_manager/mailing_list_spec.rb
312
369
  - spec/test_app/spec/models/user_spec.rb
313
370
  - spec/test_app/spec/requests/users_spec.rb
314
371
  - spec/test_app/spec/routing/users_routing_spec.rb
372
+ - spec/test_app/spec/spec_helper.rb
315
373
  - spec/test_app/spec/support/database_cleaner.rb
316
374
  - spec/test_app/spec/support/files/bad_utf8_chars.eml
375
+ - spec/test_app/spec/support/post_office.rb
317
376
  - spec/test_app/spec/views/users/edit.html.erb_spec.rb
318
377
  - spec/test_app/spec/views/users/index.html.erb_spec.rb
319
378
  - spec/test_app/spec/views/users/new.html.erb_spec.rb
320
379
  - spec/test_app/spec/views/users/show.html.erb_spec.rb
321
- - zeus.json
322
380
  homepage: http://ireach.com
323
381
  licenses: []
324
382
  metadata: {}
@@ -338,7 +396,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
338
396
  version: '0'
339
397
  requirements: []
340
398
  rubyforge_project:
341
- rubygems_version: 2.2.2
399
+ rubygems_version: 2.4.5
342
400
  signing_key:
343
401
  specification_version: 4
344
402
  summary: Mailing list management tool
@@ -358,6 +416,7 @@ test_files:
358
416
  - spec/rcov.opts
359
417
  - spec/spec.opts
360
418
  - spec/spec_helper.rb
419
+ - spec/test_app/.rspec
361
420
  - spec/test_app/README.rdoc
362
421
  - spec/test_app/Rakefile
363
422
  - spec/test_app/app/assets/javascripts/application.js
@@ -376,10 +435,17 @@ test_files:
376
435
  - spec/test_app/app/views/users/index.html.erb
377
436
  - spec/test_app/app/views/users/new.html.erb
378
437
  - spec/test_app/app/views/users/show.html.erb
438
+ - spec/test_app/bin/cucumber
439
+ - spec/test_app/bin/rails
440
+ - spec/test_app/bin/rake
441
+ - spec/test_app/bin/rspec
442
+ - spec/test_app/bin/spring
379
443
  - spec/test_app/config.ru
380
444
  - spec/test_app/config/application.rb
381
445
  - spec/test_app/config/boot.rb
382
- - spec/test_app/config/database.yml
446
+ - spec/test_app/config/cucumber.yml
447
+ - spec/test_app/config/database.mysql.yml
448
+ - spec/test_app/config/database.sqlite.yml
383
449
  - spec/test_app/config/environment.rb
384
450
  - spec/test_app/config/environments/development.rb
385
451
  - spec/test_app/config/environments/production.rb
@@ -391,9 +457,10 @@ test_files:
391
457
  - spec/test_app/config/initializers/session_store.rb
392
458
  - spec/test_app/config/initializers/wrap_parameters.rb
393
459
  - spec/test_app/config/locales/en.yml
394
- - spec/test_app/config/lockable.yml
395
460
  - spec/test_app/config/mail_manager.yml
396
461
  - spec/test_app/config/routes.rb
462
+ - spec/test_app/config/spring.rb
463
+ - spec/test_app/config/with_lock.example.yml
397
464
  - spec/test_app/db/migrate/20131217101010_create_users.rb
398
465
  - spec/test_app/db/migrate/20131221064151_mail_mgr_initial.rb
399
466
  - spec/test_app/db/migrate/20131221064152_mail_mgr_create_contact.rb
@@ -405,25 +472,31 @@ test_files:
405
472
  - spec/test_app/db/migrate/20131221072600_create_delayed_jobs.rb
406
473
  - spec/test_app/db/schema.rb
407
474
  - spec/test_app/db/structure.sql
475
+ - spec/test_app/features/support/env.rb
476
+ - spec/test_app/lib/tasks/cucumber.rake
408
477
  - spec/test_app/public/404.html
409
478
  - spec/test_app/public/422.html
410
479
  - spec/test_app/public/500.html
411
480
  - spec/test_app/public/favicon.ico
481
+ - spec/test_app/script/cucumber
412
482
  - spec/test_app/script/delayed_job
413
- - spec/test_app/script/lockable
414
483
  - spec/test_app/script/rails
484
+ - spec/test_app/script/with_lock
415
485
  - spec/test_app/spec/controllers/users_controller_spec.rb
416
486
  - spec/test_app/spec/factories/mailing_lists.rb
417
487
  - spec/test_app/spec/factories/mailings.rb
418
488
  - spec/test_app/spec/factories/original_factories.rb.txt
419
489
  - spec/test_app/spec/factories/users.rb
420
490
  - spec/test_app/spec/models/mail_manager/bounce_spec.rb
491
+ - spec/test_app/spec/models/mail_manager/mailer_spec.rb
421
492
  - spec/test_app/spec/models/mail_manager/mailing_list_spec.rb
422
493
  - spec/test_app/spec/models/user_spec.rb
423
494
  - spec/test_app/spec/requests/users_spec.rb
424
495
  - spec/test_app/spec/routing/users_routing_spec.rb
496
+ - spec/test_app/spec/spec_helper.rb
425
497
  - spec/test_app/spec/support/database_cleaner.rb
426
498
  - spec/test_app/spec/support/files/bad_utf8_chars.eml
499
+ - spec/test_app/spec/support/post_office.rb
427
500
  - spec/test_app/spec/views/users/edit.html.erb_spec.rb
428
501
  - spec/test_app/spec/views/users/index.html.erb_spec.rb
429
502
  - spec/test_app/spec/views/users/new.html.erb_spec.rb
data/engine_plan.rb DELETED
@@ -1,13 +0,0 @@
1
- require 'zeus/rails'
2
-
3
- ROOT_PATH = File.expand_path(Dir.pwd)
4
- ENV_PATH = File.expand_path('spec/test_app/config/environment', ROOT_PATH)
5
- BOOT_PATH = File.expand_path('spec/test_app/config/boot', ROOT_PATH)
6
- APP_PATH = File.expand_path('spec/test_app/config/application', ROOT_PATH)
7
- ENGINE_ROOT = File.expand_path(Dir.pwd)
8
- ENGINE_PATH = File.expand_path('lib/mail_manager/engine', ENGINE_ROOT)
9
-
10
- class EnginePlan < Zeus::Rails
11
- end
12
-
13
- Zeus.plan = EnginePlan.new
data/zeus.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "command": "ruby -rubygems -r./engine_plan -eZeus.go",
3
-
4
- "plan": {
5
- "boot": {
6
- "default_bundle": {
7
- "development_environment": {
8
- "prerake": {"rake": []},
9
- "runner": ["r"],
10
- "console": ["c"],
11
- "server": ["s"],
12
- "generate": ["g"],
13
- "destroy": ["d"],
14
- "dbconsole": []
15
- },
16
- "test_environment": {
17
- "test_helper": {"test": ["rspec", "testrb"]}
18
- }
19
- }
20
- }
21
- }
22
- }