ecm_contact2 1.2.1 → 1.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d42f8beda87656e6462761dd1ae90037d2bef024
4
- data.tar.gz: 3dba30a81294f612ecdfafb4d690b322e9dc91bd
3
+ metadata.gz: c23440fc43b67bc00dd39c3e0a60f67f5acb0fc3
4
+ data.tar.gz: 4e47b62549a121316d6517d10ce38af3aaa90b5e
5
5
  SHA512:
6
- metadata.gz: f50fb7a9be854df3a15fc94402713b8df1a174797cbaa885576715d99b7a39ae0983cb4ab7cb05a472eae2b1b1905f32425c3cd877e95548cf67d6de55daa859
7
- data.tar.gz: 006d2406ba8d34691a7e433358d77ba84902c348257ef1f0679341c46db7b36d86756c33413f87648e936e3f89ee20472cb71742984915a83f1beaf5eda84639
6
+ metadata.gz: 23fc92a4af8b89d07a854844271be2c3d070d277c7879a9bddd9c93ce8ef03e43e571d5c17d648b9bc442dfbf9dcce82905d29afc79528aabab734924c368b7a
7
+ data.tar.gz: 073f60bbe95f05de9c2cb686accceb9246d75ba7f16ab94602861e8cedb3a1c6fbfc36023dade968c486638fe317c5dbea4e2c159ed4d8314deec50ea509f876
data/Rakefile CHANGED
@@ -22,5 +22,4 @@ end
22
22
 
23
23
  Bundler::GemHelper.install_tasks
24
24
 
25
-
26
- require 'rails/dummy/tasks'
25
+ require 'rails/dummy/tasks'
@@ -9,10 +9,9 @@ class Ecm::Contact::RequestsController < Ecm::Contact::Configuration.base_contro
9
9
  @contact_request = Ecm::Contact::Request.new(params[:ecm_contact_request])
10
10
 
11
11
  if @contact_request.deliver
12
- redirect_to({ :action => 'index' }, :notice => lambda { I18n.t('ecm.contact.form.messages.delivered') }.call )
12
+ redirect_to({ action: 'index' }, notice: -> { I18n.t('ecm.contact.form.messages.delivered') }.call)
13
13
  else
14
14
  render :index
15
15
  end
16
16
  end
17
17
  end
18
-
@@ -1,28 +1,28 @@
1
1
  module Ecm
2
2
  module Contact
3
3
  class Request < MailForm::Base
4
- attribute :name
4
+ attribute :name
5
5
  attribute :email
6
6
  attribute :phone
7
- attribute :message
7
+ attribute :message
8
8
  attribute :terms_of_service
9
- attribute :nickname, :captcha => true
10
-
11
- validates :email, :format => { :with => /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i }, :presence => true # , :message => Proc.new { I18n.t("activerecord.errors.messages.invalid") }.call }
12
- validates :message, :presence => true # { :message => Proc.new { I18n.t("activerecord.errors.messages.empty") }.call }
13
- validates :name, :presence => true # { :message => Proc.new { I18n.t("activerecord.errors.messages.empty") }.call }
14
- validates :terms_of_service, :acceptance => true # { :message => Proc.new { I18n.t("activerecord.errors.messages.accepted") }.call }
9
+ attribute :nickname, captcha: true
10
+
11
+ validates :email, format: { with: /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i }, presence: true # , :message => Proc.new { I18n.t("activerecord.errors.messages.invalid") }.call }
12
+ validates :message, presence: true # { :message => Proc.new { I18n.t("activerecord.errors.messages.empty") }.call }
13
+ validates :name, presence: true # { :message => Proc.new { I18n.t("activerecord.errors.messages.empty") }.call }
14
+ validates :terms_of_service, acceptance: true # { :message => Proc.new { I18n.t("activerecord.errors.messages.accepted") }.call }
15
15
 
16
16
  # Declare the e-mail headers. It accepts anything the mail method
17
17
  # in ActionMailer accepts.
18
18
  def headers
19
19
  {
20
- :subject => Proc.new { I18n.t('ecm.contact.request.subject', :application_name => Rails.application.class.to_s.split("::").first) }.call,
20
+ subject: proc { I18n.t('ecm.contact.request.subject', application_name: Rails.application.class.to_s.split('::').first) }.call,
21
21
  # :to => I18n.t('ecm.contact.request.recipients'),
22
- :to => Ecm::Contact::Configuration.recipients[Rails.env],
23
- :from => %("#{name}" <#{email}>)
22
+ to: Ecm::Contact::Configuration.recipients[Rails.env],
23
+ from: %("#{name}" <#{email}>)
24
24
  }
25
- end
25
+ end
26
26
  end
27
27
  end
28
28
  end
@@ -13,7 +13,7 @@ de:
13
13
  views:
14
14
  actions:
15
15
  back: 'Zurück'
16
- routes:
16
+ routes:
17
17
  ecm_contact_requests: kontakt
18
18
  simple_form:
19
19
  "yes": 'Ja'
@@ -9,23 +9,23 @@ module Ecm
9
9
  yield self
10
10
  end
11
11
  mattr_accessor :input_name_css_classes do
12
- 'form-control'
12
+ 'form-control'
13
13
  end
14
14
 
15
15
  mattr_accessor :input_email_css_classes do
16
- 'form-control'
16
+ 'form-control'
17
17
  end
18
18
 
19
19
  mattr_accessor :input_phone_css_classes do
20
- 'form-control'
20
+ 'form-control'
21
21
  end
22
22
 
23
23
  mattr_accessor :input_message_css_classes do
24
- 'form-control'
24
+ 'form-control'
25
25
  end
26
26
 
27
27
  mattr_accessor :input_terms_of_service_css_classes do
28
- ''
28
+ ''
29
29
  end
30
30
 
31
31
  mattr_accessor :recipients do
@@ -2,7 +2,7 @@ module Ecm
2
2
  module Contact
3
3
  class Engine < ::Rails::Engine
4
4
  config.to_prepare do
5
- Rails.application.config.assets.precompile += %w[ecm_contact.css]
5
+ Rails.application.config.assets.precompile += %w(ecm_contact.css)
6
6
  end
7
7
  end
8
8
  end
@@ -3,11 +3,11 @@ module Ecm
3
3
  class Routing
4
4
  def self.routes(router, options = {})
5
5
  options.reverse_merge!(
6
- { :contact_request_actions => [:index, :create] }
6
+ contact_request_actions: [:index, :create]
7
7
  )
8
-
9
- router.resources :ecm_contact_requests, :only => options[:contact_request_actions], :controller => 'ecm/contact/requests'
8
+
9
+ router.resources :ecm_contact_requests, only: options[:contact_request_actions], controller: 'ecm/contact/requests'
10
10
  end
11
11
  end
12
12
  end
13
- end
13
+ end
@@ -1,6 +1,5 @@
1
1
  module Ecm
2
2
  module Contact
3
- VERSION = '1.2.1'
3
+ VERSION = '1.2.2'.freeze
4
4
  end
5
5
  end
6
-
@@ -2,14 +2,20 @@ module Ecm
2
2
  module Contact
3
3
  module Generators
4
4
  class InstallGenerator < Rails::Generators::Base
5
- desc "Generates the intializer"
5
+ desc 'Generates the intializer'
6
6
 
7
- source_root File.expand_path('../templates', __FILE__)
8
-
9
- def generate_intializer
10
- copy_file "ecm_contact.rb", "config/initializers/ecm_contact.rb"
11
- end
7
+ source_root File.expand_path('../templates', __FILE__)
8
+
9
+ def generate_initializer
10
+ copy_file 'initializer.rb', 'config/initializers/ecm_contact.rb'
11
+ end
12
+
13
+ def generate_routes
14
+ inject_into_file 'config/routes.rb', before: "\nend" do
15
+ File.read(File.join(File.expand_path('../templates', __FILE__), 'routes.source'))
16
+ end
17
+ end
12
18
  end
13
19
  end
14
20
  end
15
- end
21
+ end
@@ -12,9 +12,9 @@ Ecm::Contact.configure do |config|
12
12
  # }
13
13
  #
14
14
  config.recipients = {
15
- :development => %w[ info@development.example.com ],
16
- :test => %w[ info@test.example.com ],
17
- :production => %w[ info@production.example.com ]
15
+ development: %w( info@development.example.com ),
16
+ test: %w( info@test.example.com ),
17
+ production: %w( info@production.example.com )
18
18
  }
19
19
 
20
20
  # Configure your input field css classes here.
@@ -63,4 +63,3 @@ Ecm::Contact.configure do |config|
63
63
  #
64
64
  config.additional_contact_information = nil
65
65
  end
66
-
@@ -0,0 +1,5 @@
1
+
2
+ # ECM Contact Frontend Routing
3
+ localized do
4
+ Ecm::Contact::Routing.routes(self)
5
+ end
@@ -2,19 +2,18 @@ module Ecm
2
2
  module Contact
3
3
  module Generators
4
4
  class LocalesGenerator < Rails::Generators::Base
5
- desc "Generates the locales"
5
+ desc 'Generates the locales'
6
6
 
7
7
  source_root File.expand_path('../../../../../../config/locales', __FILE__)
8
8
 
9
9
  def generate_intializer
10
- copy_file "ecm.contact.de.yml", "config/locales/ecm.contact.de.yml"
11
- copy_file "ecm.contact.en.yml", "config/locales/ecm.contact.en.yml"
10
+ copy_file 'ecm.contact.de.yml', 'config/locales/ecm.contact.de.yml'
11
+ copy_file 'ecm.contact.en.yml', 'config/locales/ecm.contact.en.yml'
12
12
 
13
- copy_file "ecm.contact.request.de.yml", "config/locales/ecm.contact.request.de.yml"
14
- copy_file "ecm.contact.request.en.yml", "config/locales/ecm.contact.request.en.yml"
13
+ copy_file 'ecm.contact.request.de.yml', 'config/locales/ecm.contact.request.de.yml'
14
+ copy_file 'ecm.contact.request.en.yml', 'config/locales/ecm.contact.request.en.yml'
15
15
  end
16
16
  end
17
17
  end
18
18
  end
19
19
  end
20
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_contact2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-30 00:00:00.000000000 Z
11
+ date: 2016-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -281,7 +281,8 @@ files:
281
281
  - lib/ecm/contact/version.rb
282
282
  - lib/ecm_contact2.rb
283
283
  - lib/generators/ecm/contact/install/install_generator.rb
284
- - lib/generators/ecm/contact/install/templates/ecm_contact.rb
284
+ - lib/generators/ecm/contact/install/templates/initializer.rb
285
+ - lib/generators/ecm/contact/install/templates/routes.source
285
286
  - lib/generators/ecm/contact/locales/locales_generator.rb
286
287
  - lib/tasks/ecm_contact_tasks.rake
287
288
  homepage: https://github.com/robotex82/ecm_contact2