contact_us 1.1.0 → 1.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 362c93f82604c1bb0719a60e7daf0fc6990e377d
4
- data.tar.gz: db544e80c7e02e6815be8a16a793486e39eda772
3
+ metadata.gz: 5232acabb9853f22ccef705dbc5b2c03f294c12a
4
+ data.tar.gz: cbf76855a7227d6b414533c9ce8bd9cd63940c92
5
5
  SHA512:
6
- metadata.gz: 8efd0645c12998ace526c17d544d680c1e31ca8420410758ce79809e9551d52937b72d7a668b1c673bd0d739f292821c3acd3c1e403fdf3439338efa464ec46a
7
- data.tar.gz: f27629db4982f646d0a7bffe5506beba108ff1d8705825b279f655c2d857c54a327088153b918670f54e3a0677deecc82fcd3d5f60cd9a0ac21833a149d18d72
6
+ metadata.gz: d86121cc8a852535869f44764695eac63ff98dc6dbc579bc84d6698cb43d2568ffe54711d4156ca1fe4553a993fcea14c3f8054f4081b6089d2ed7d0c10b312a
7
+ data.tar.gz: 0b422d2fb6941fc8f2e21863baaa54e42bf39e8a6b91df633d7f880aa1b02abf70e1051bb89878ccb126c5b8b6ee536b083a3c010bba27100e97c0f7b0b76ca3
@@ -1,8 +1,7 @@
1
1
  script: "bundle exec rspec spec"
2
2
  rvm:
3
- - 2.0
4
- - 2.1
5
- - 2.2
3
+ - 2.2.2
4
+ - 2.3.1
6
5
  - ruby-head
7
6
  language: ruby
8
7
  matrix:
@@ -1,3 +1,9 @@
1
+ ## ContactUs 1.2.0 (?)
2
+
3
+ * Bump required Ruby to 2.2.2
4
+ * Add Arabic translation. [https://github.com/JDutil/contact_us/pull/59]
5
+ * Add optional I18n locale routing [https://github.com/JDutil/contact_us/pull/58]
6
+
1
7
  ## ContactUs 1.1.0 (May 1st 2015)
2
8
 
3
9
  * Configurable mailer inheritance. [https://github.com/JDutil/contact_us/pull/53]
data/README.md CHANGED
@@ -68,6 +68,12 @@ To redirect to a specific URL after a successful form submission:
68
68
  config.success_redirect = '/contact-success'
69
69
  ```
70
70
 
71
+ If you're using I18n localization and would like to have the locale be a part of your paths
72
+ For example: /en/contact-us OR /fr/contact-us OR /en-UK/contact-us
73
+ ```ruby
74
+ config.localize_routes = true
75
+ ```
76
+
71
77
  ### Views
72
78
 
73
79
  To copy the view files to `app/views/contact_us`, and customize them to suit your needs run:
@@ -86,6 +92,9 @@ bundle exec rake contact_us:copy_locales
86
92
 
87
93
  Please feel free to submit your own locales so that other users will hopefully find this gem more useful in your language.
88
94
 
95
+ If you would like to include the locale in your paths (e.g. /en/contact-us), set the localize_routes
96
+ parameter to true in your initializer (see the configuration section above)
97
+
89
98
  ### Formtastic
90
99
 
91
100
  In order to use a Formtastic compatible template to hook into your custom form styles configure `config/initializers/contact_us.rb`:
@@ -33,6 +33,6 @@
33
33
  <% end %>
34
34
  </div>
35
35
  <div class='commit'>
36
- <%= f.submit :submit, :class => 'submit create', :title => t('.submit') %>
36
+ <%= f.submit :submit, :class => 'submit create', :title => t('.submit'), :value => t('.submit') %>
37
37
  </div>
38
38
  <% end %>
@@ -0,0 +1,25 @@
1
+ # Sample localization file for Arabic. Add more files in this directory for other locales.
2
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ ar:
5
+ contact_us:
6
+ contact_mailer:
7
+ contact_email:
8
+ sent_by_contact_form: "تم إرساله عبر نموذج اتصل بنا من %{email}"
9
+ sent_by_name: "أُرسل من %{name} بواسطة %{email}"
10
+ subject: "رسالة اتصل بنا من %{email}"
11
+ contacts:
12
+ new: &new
13
+ contact_us: "اتصل بنا"
14
+ email: "البريد الإلكتروني"
15
+ message: "الرسالة"
16
+ name: "الاسم"
17
+ subject: "الموضوع"
18
+ submit: "إرسال"
19
+ new_formtastic:
20
+ <<: *new
21
+ new_simple_form:
22
+ <<: *new
23
+ notices:
24
+ error: "يجب إدخال كلا الحقلين."
25
+ success: "تم إرسال نموذج التواصل بنجاح."
@@ -1,20 +1,20 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
1
+ # Sample localization file for Spanish. Add more files in this directory for other locales.
2
2
  # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
3
 
4
4
  es:
5
5
  contact_us:
6
6
  contact_mailer:
7
7
  contact_email:
8
- sent_by_contact_form: "Enviado por el formulario de contacto. %{email}"
9
- sent_by_name: "Sent by %{name} from %{email}"
10
- subject: "Contact Us message from %{email}"
8
+ sent_by_contact_form: "Enviado por el formulario de contacto desde %{email}"
9
+ sent_by_name: "Enviado por %{name} con la dirección %{email}"
10
+ subject: "Mensaje de contacto de %{email}"
11
11
  contacts:
12
12
  new: &new
13
13
  contact_us: "Contactanos"
14
- email: "Email"
14
+ email: "Correo electrónico"
15
15
  message: "Mensaje"
16
- name: "Name"
17
- subject: "Subject"
16
+ name: "Nombre"
17
+ subject: "Tema"
18
18
  submit: "Enviar"
19
19
  new_formtastic:
20
20
  <<: *new
@@ -1,6 +1,21 @@
1
1
  Rails.application.routes.draw do
2
- resources :contacts,
3
- :controller => 'contact_us/contacts',
4
- :only => [:new, :create]
5
- get 'contact-us' => 'contact_us/contacts#new', :as => :contact_us
2
+ # Place the contact_us routes within the optional locale scope
3
+ # If the I18n gem is installed and the localize_routes variable has
4
+ # been set to true in the application's initializer file
5
+ if defined?(I18n) && ContactUs.localize_routes
6
+ scope "(:locale)", locale: /#{I18n.available_locales.join("|")}/ do
7
+ resources :contacts,
8
+ controller: "contact_us/contacts",
9
+ only: [:new, :create]
10
+
11
+ get "contact-us" => "contact_us/contacts#new", as: :contact_us
12
+ end
13
+
14
+ else
15
+ resources :contacts,
16
+ controller: "contact_us/contacts",
17
+ only: [:new, :create]
18
+
19
+ get "contact-us" => "contact_us/contacts#new", as: :contact_us
20
+ end
6
21
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.summary = %q{Gem providing simple Contact Us functionality with a Rails 3+ Engine.}
13
13
  s.description = %q{A Rails 3+ Engine providing a basic contact form. I used Formtastic to keep things simple, and to hook into your apps custom Formtastic stylesheets.}
14
14
 
15
- s.required_ruby_version = '>= 2.0.0'
15
+ s.required_ruby_version = '>= 2.2.2'
16
16
  s.rubyforge_project = "contact_us"
17
17
 
18
18
  s.files = `git ls-files`.split("\n")
@@ -21,11 +21,11 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.add_development_dependency "capybara", "~> 2.0"
23
23
  s.add_development_dependency "rspec-rails", "~> 3.1"
24
- s.add_development_dependency "shoulda-matchers", ">= 1.5.4"
24
+ s.add_development_dependency "shoulda-matchers", "~> 2.6"
25
25
  s.add_development_dependency "simplecov", "~> 0.7"
26
26
  s.add_development_dependency "sqlite3", "~> 1.3.5"
27
27
  s.add_development_dependency "formtastic", ">= 2.1.0"
28
28
  s.add_development_dependency "simple_form"
29
-
29
+ s.add_development_dependency 'rails-controller-testing'
30
30
  s.add_runtime_dependency "rails", ">= 4.2.0"
31
31
  end
@@ -23,6 +23,10 @@ module ContactUs
23
23
  mattr_accessor :parent_mailer
24
24
  @@parent_mailer = "ActionMailer::Base"
25
25
 
26
+ # allows for a locale to appear in the path
27
+ # (e.g. /fr/contact-us OR /en/contact-us)
28
+ mattr_accessor :localize_routes
29
+
26
30
  # Default way to setup ContactUs. Run rake contact_us:install to create
27
31
  # a fresh initializer with all configuration values.
28
32
  def self.setup
@@ -1,3 +1,3 @@
1
1
  module ContactUs
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -6,6 +6,7 @@ ENV["RAILS_ENV"] = "test"
6
6
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
7
7
  require "rails/test_help"
8
8
  require "rspec/rails"
9
+ require 'rails-controller-testing'
9
10
  require 'shoulda-matchers'
10
11
 
11
12
  unless defined?(Rubinius).present? or RUBY_VERSION == '1.8.7'
@@ -43,4 +44,10 @@ RSpec.configure do |config|
43
44
  config.include RSpec::Matchers
44
45
  config.infer_spec_type_from_file_location!
45
46
  config.raise_errors_for_deprecations!
47
+
48
+ [:controller, :view, :request].each do |type|
49
+ config.include ::Rails::Controller::Testing::TestProcess, type: type
50
+ config.include ::Rails::Controller::Testing::TemplateAssertions, type: type
51
+ config.include ::Rails::Controller::Testing::Integration, type: type
52
+ end
46
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contact_us
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dutil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-01 00:00:00.000000000 Z
11
+ date: 2016-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: shoulda-matchers
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.5.4
47
+ version: '2.6'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.5.4
54
+ version: '2.6'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: simplecov
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rails-controller-testing
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: rails
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -147,6 +161,7 @@ files:
147
161
  - app/views/contact_us/contacts/new.html.erb
148
162
  - app/views/contact_us/contacts/new_formtastic.html.erb
149
163
  - app/views/contact_us/contacts/new_simple_form.html.erb
164
+ - config/locales/contact_us.ar.yml
150
165
  - config/locales/contact_us.de.yml
151
166
  - config/locales/contact_us.el.yml
152
167
  - config/locales/contact_us.en.yml
@@ -219,7 +234,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
219
234
  requirements:
220
235
  - - ">="
221
236
  - !ruby/object:Gem::Version
222
- version: 2.0.0
237
+ version: 2.2.2
223
238
  required_rubygems_version: !ruby/object:Gem::Requirement
224
239
  requirements:
225
240
  - - ">="
@@ -227,7 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
242
  version: '0'
228
243
  requirements: []
229
244
  rubyforge_project: contact_us
230
- rubygems_version: 2.4.5
245
+ rubygems_version: 2.5.1
231
246
  signing_key:
232
247
  specification_version: 4
233
248
  summary: Gem providing simple Contact Us functionality with a Rails 3+ Engine.