maily 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -81,7 +81,7 @@ Most of emails need to populate data to consume it and do intersting things. Hoo
81
81
  # lib/maily_hooks.rb
82
82
  user = User.new(email: 'user@example.com')
83
83
  comment = Struct.new(:body).new('Lorem ipsum') # stub way
84
- service = Service.new(price: '100USD')
84
+ service = FactoryGirl.create(:service) # using fixtures with FactoryGirl
85
85
 
86
86
  Maily.hooks_for('Notifier') do |mailer|
87
87
  mailer.register_hook(:welcome, user, template_path: 'users')
@@ -121,7 +121,7 @@ class AdminController < ActionController::Base
121
121
  private
122
122
 
123
123
  def maily_authorized?
124
- (current_user && current_user.admin?) || raise('You don't have access to this section!')
124
+ (current_user && current_user.admin?) || raise("You don't have access to this section!")
125
125
  end
126
126
  end
127
127
  ```
@@ -129,7 +129,7 @@ end
129
129
  ## Notes
130
130
  Rails 4.1 introduced a built-in mechanism to preview the application emails. It is in fact a port of [basecamp/mail_view](https://github.com/basecamp/mail_view) gem to the core.
131
131
 
132
- Alternatively, there are some other plugins to get a similar functionality with different approaches and options. For example, [ryanb/letter_opener](https://github.com/ryanb/letter_opener), [MailCatcher](https://github.com/sj26/mailcatcher) or [Rails Email Preview](https://github.com/glebm/rails_email_preview).
132
+ Alternatively, there are some other plugins to get a similar functionality with different approaches and options. For example, [ryanb/letter_opener](https://github.com/ryanb/letter_opener), [sj26/mailcatcher](https://github.com/sj26/mailcatcher) or [glebm/rails_email_preview](https://github.com/glebm/rails_email_preview).
133
133
 
134
134
  ## License
135
135
  Copyright (c) 2013-2014 Marc Anguera. Maily is released under the [MIT](MIT-LICENSE) License.
data/lib/maily.rb CHANGED
@@ -40,7 +40,7 @@ module Maily
40
40
 
41
41
  def allowed_action?(action)
42
42
  case action.to_sym
43
- when :edit,
43
+ when :edit
44
44
  allow_edition
45
45
  when :update
46
46
  allow_edition && !Rails.env.production?
data/lib/maily/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Maily
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
data/spec/dummy/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Dummy App
2
2
 
3
- Dummy application for testing Maily.
3
+ Dummy Rails application for testing `Maily`.
4
4
 
5
- Run test suite:
5
+ Run test suite (from `Maily` root path):
6
6
 
7
7
  ```
8
8
  bundle exec rake
data/spec/email_spec.rb CHANGED
@@ -8,7 +8,7 @@ describe Maily::Email do
8
8
 
9
9
  it "should not require hook" do
10
10
  expect(email.required_arguments).to be_blank
11
- expect(email.require_hook?).to be_false
11
+ expect(email.require_hook?).to be false
12
12
  end
13
13
 
14
14
  it ".call" do
@@ -21,7 +21,7 @@ describe Maily::Email do
21
21
 
22
22
  it "should require hook" do
23
23
  expect(email.required_arguments).to be_present
24
- expect(email.require_hook?).to be_true
24
+ expect(email.require_hook?).to be true
25
25
  end
26
26
 
27
27
  it "should handle arguments successfully" do
data/spec/maily_spec.rb CHANGED
@@ -4,9 +4,9 @@ describe Maily do
4
4
  it "should set up with defaults if no block provided" do
5
5
  Maily.setup
6
6
 
7
- expect(Maily.enabled).to be_true
8
- expect(Maily.allow_edition).to be_true
9
- expect(Maily.allow_delivery).to be_true
7
+ expect(Maily.enabled).to be true
8
+ expect(Maily.allow_edition).to be true
9
+ expect(Maily.allow_delivery).to be true
10
10
  expect(Maily.available_locales).to eq(I18n.available_locales)
11
11
  expect(Maily.base_controller).to eq('ActionController::Base')
12
12
  end
@@ -14,13 +14,13 @@ describe Maily do
14
14
  it "should not allow edition if edition is disabled" do
15
15
  Maily.allow_edition = false
16
16
 
17
- expect(Maily.allowed_action?(:edit)).to be_false
18
- expect(Maily.allowed_action?(:update)).to be_false
17
+ expect(Maily.allowed_action?(:edit)).to be false
18
+ expect(Maily.allowed_action?(:update)).to be false
19
19
  end
20
20
 
21
21
  it "should not allow delivery if delivery is disabled" do
22
22
  Maily.allow_delivery = false
23
23
 
24
- expect(Maily.allowed_action?(:deliver)).to be_false
24
+ expect(Maily.allowed_action?(:deliver)).to be false
25
25
  end
26
26
  end
data/spec/spec_helper.rb CHANGED
@@ -9,4 +9,5 @@ require 'maily'
9
9
 
10
10
  RSpec.configure do |config|
11
11
  config.mock_with :rspec
12
+ config.order = 'random'
12
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maily
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -151,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  segments:
153
153
  - 0
154
- hash: 1797094736581911098
154
+ hash: 3711050222606402912
155
155
  required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  none: false
157
157
  requirements:
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  version: '0'
161
161
  segments:
162
162
  - 0
163
- hash: 1797094736581911098
163
+ hash: 3711050222606402912
164
164
  requirements: []
165
165
  rubyforge_project:
166
166
  rubygems_version: 1.8.23