tiny-rails 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -18,7 +18,7 @@ the idea is to try to give you a really basic application to try out new Rails
18
18
  gems, create spikes and to provide an isolated small Rails environment for
19
19
  reproducing bugs to support bug reports.
20
20
 
21
- You could also use this to create a single page application with all rails
21
+ You could also use this to create a single page application with Rails
22
22
  features like code reloading and the asset pipeline without having to set up
23
23
  a Sinatra application from the ground app.
24
24
 
@@ -39,8 +39,8 @@ $ tiny-rails new tiny-app
39
39
  ```
40
40
 
41
41
  This will give you a pretty basic application that you can run with `rackup`
42
- or you prefferend server. It even supports code reloading for the generated
43
- controller!
42
+ or you preferred server. It even supports code reloading for the generated
43
+ controller, models and mailers!
44
44
 
45
45
  You can also fire up a console to play around with the generated app running
46
46
  `tiny-rails console`. If you want to use Pry, you can just add the `pry-rails`
@@ -75,6 +75,7 @@ Here's a list of the addons bundled with the gem:
75
75
  * [coffeescript](https://github.com/fgrehm/tiny-rails/blob/master/addons/coffeescript.rb)
76
76
  * [jquery](https://github.com/fgrehm/tiny-rails/blob/master/addons/jquery.rb)
77
77
  * [client_side_validations](https://github.com/fgrehm/tiny-rails/blob/master/addons/client_side_validations.rb)
78
+ * [email](https://github.com/fgrehm/tiny-rails/blob/master/addons/email.rb)
78
79
 
79
80
 
80
81
  ### Building your own addon
@@ -0,0 +1,17 @@
1
+ gem 'actionmailer', '~> 3.2'
2
+ gem 'letter_opener'
3
+ gem 'nokogiri'
4
+ gem 'premailer-rails3'
5
+
6
+ require_mailers_code = <<-CODE
7
+ # Enable code reloading for mailers
8
+ require_dependency 'mailers'
9
+ CODE
10
+ inject_into_file 'application_controller.rb', "\n#{require_mailers_code}", :after => /class ApplicationController < ActionController::Base/
11
+
12
+ application " config.action_mailer.delivery_method = :letter_opener\n"
13
+
14
+ inject_into_file 'boot.rb', "\nrequire \"action_mailer/railtie\"", :after => /require ['"]action_controller\/railtie['"]/
15
+
16
+ template 'actionmailer/mailers.rb', 'mailers.rb'
17
+ template 'actionmailer/test_mail.html.erb', 'test_mail.html.erb'
@@ -1,3 +1,3 @@
1
1
  module TinyRails
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -0,0 +1,10 @@
1
+ class TinyMailer < ActionMailer::Base
2
+ append_view_path File.dirname(__FILE__)
3
+
4
+ default from: 'no-reply@example.com',
5
+ template_path: '.'
6
+
7
+ def test_mail
8
+ mail(to: 'user@example.com', subject: 'Testing mailer', template_name: 'test_mail')
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ <style type="text/css">
2
+ h1 { color: green }
3
+ </style>
4
+
5
+ <h1>This is a test mail!</h1>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -131,6 +131,7 @@ files:
131
131
  - addons/activerecord.rb
132
132
  - addons/client_side_validations.rb
133
133
  - addons/coffeescript.rb
134
+ - addons/email.rb
134
135
  - addons/jquery.rb
135
136
  - bin/tiny-rails
136
137
  - lib/tiny-rails.rb
@@ -151,6 +152,8 @@ files:
151
152
  - spec/support/matchers/have_single_occurrence_matcher.rb
152
153
  - templates/.gitignore
153
154
  - templates/Gemfile
155
+ - templates/actionmailer/mailers.rb
156
+ - templates/actionmailer/test_mail.html.erb
154
157
  - templates/activerecord/migrate
155
158
  - templates/activerecord/models.rb
156
159
  - templates/application_controller.rb
@@ -173,7 +176,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
173
176
  version: '0'
174
177
  segments:
175
178
  - 0
176
- hash: -4104238879239819067
179
+ hash: -1856058317244773790
177
180
  required_rubygems_version: !ruby/object:Gem::Requirement
178
181
  none: false
179
182
  requirements:
@@ -182,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
185
  version: '0'
183
186
  segments:
184
187
  - 0
185
- hash: -4104238879239819067
188
+ hash: -1856058317244773790
186
189
  requirements: []
187
190
  rubyforge_project:
188
191
  rubygems_version: 1.8.23