decent_exposure 3.0.0.beta2 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7cfd8c745c922accdd68b09011ac06094d2c71bc
4
- data.tar.gz: 3eab645e6e2b13e763cbe6835125ec8104730c9d
3
+ metadata.gz: 2f8425a920206dc8af5e761d2f3f3783a7a7c6b4
4
+ data.tar.gz: b3f21e7fb044bf0b554cc26918d40ce84aa5b188
5
5
  SHA512:
6
- metadata.gz: 7413bd28015045c87343f8bcc3210a46964420782f96c016fb2687c8f07a4ce26cdeb5868f35b9c376934593f36973fcfca2d1955bba40cd3b6e5ee4864bd67a
7
- data.tar.gz: 92bb65c55c3c2f5902b93cb24ab54dadaf52b844360f377d49736df2b261e949f7130b551d9ad4b719625013ffe7398435efddbf00bd31aaaf35659d34f70120
6
+ metadata.gz: fbe1b3c1f9806de47df1a8ce1700d9ab5908c1981bc92fd1f63e528f4d60896556e9c9ede8b73b1966a047916158aaa33a141a3451aa4577a4cadf9da092ee2f
7
+ data.tar.gz: f50003ad917244794fdd3a767d9e18dc3d40ab22914a60f8efb7d77639facdf09e02436647821df43a0157ff0bb4f2332005275db419f784ab18dfc21a25bcad
data/.travis.yml CHANGED
@@ -4,7 +4,7 @@ rvm:
4
4
  - 2.3.0
5
5
  gemfile:
6
6
  - Gemfile
7
- - gemfiles/Gemfile.rails-5.0.0.rc1
7
+ - gemfiles/Gemfile.rails-5.0.0
8
8
  - gemfiles/Gemfile.rails-4.2.6
9
9
  - gemfiles/Gemfile.rails-4.2.0
10
10
  notifications:
data/README.md CHANGED
@@ -18,7 +18,7 @@ Version `3.0` will support Rails 4 and 5.
18
18
  Add this line to your application's Gemfile:
19
19
 
20
20
  ```ruby
21
- gem 'decent_exposure', '3.0.0.beta1'
21
+ gem 'decent_exposure', '3.0.0'
22
22
  ```
23
23
 
24
24
  And then execute:
@@ -309,6 +309,7 @@ decoration process. Initially, this does nothing, but you can obviously change
309
309
  that:
310
310
 
311
311
  ```ruby
312
+ expose :things, ->{ Thing.all.map{ |thing| ThingDecorator.new(thing) } }
312
313
  expose :thing, decorate: ->(thing){ ThingDecorator.new(thing) }
313
314
  ```
314
315
 
@@ -325,6 +326,32 @@ expose :thing, with: [:cool_find, :cool_build]
325
326
  expose :another_thing, with: :cool_build
326
327
  ```
327
328
 
329
+ ## Rails Mailers
330
+
331
+ Mailers and Controllers use the save decent_exposure dsl.
332
+
333
+ ### Example Mailer
334
+
335
+ ```ruby
336
+ class PostMailer < ApplicationMailer
337
+ attr_accessor :post_id
338
+
339
+ expose(:posts, -> { Post.last(10) })
340
+ expose(:post, id: -> { post_id })
341
+
342
+ def top_posts
343
+ @greeting = "Top Posts"
344
+ mail to: "to@example.org"
345
+ end
346
+
347
+ def featured_post(post_id = nil)
348
+ self.post_id = post_id
349
+ @greeting = "Featured Post"
350
+ mail to: "to@example.org"
351
+ end
352
+ end
353
+ ```
354
+
328
355
  ## Rails Scaffold Templates
329
356
 
330
357
  If you want to generate rails scaffold templates prepared for `decent_exposure` run:
@@ -333,7 +360,18 @@ If you want to generate rails scaffold templates prepared for `decent_exposure`
333
360
  rails generate decent_exposure:scaffold_templates [--template_engine erb|haml]
334
361
  ```
335
362
 
336
- This will create the templates in your `lib/templates` folder. Now you can run scaffold like:
363
+ This will create the templates in your `lib/templates` folder.
364
+
365
+ Make sure you have configured your templates engine for generators in `config/application.rb`:
366
+
367
+ ```ruby
368
+ # config/application.rb
369
+ config.generators do |g|
370
+ g.template_engine :erb
371
+ end
372
+ ```
373
+
374
+ Now you can run scaffold like:
337
375
 
338
376
  ```bash
339
377
  rails generate scaffold post title description:text
@@ -349,6 +387,6 @@ rails generate scaffold post title description:text
349
387
 
350
388
  ## About
351
389
 
352
- [![Hashrocket logo](hashrocket_logo.png)](https://hashrocket.com)
390
+ [![Hashrocket logo](https://hashrocket.com/hashrocket_logo.svg)](https://hashrocket.com)
353
391
 
354
392
  Decent Exposure is supported by the team at [Hashrocket](https://hashrocket.com), a multidisciplinary design & development consultancy. If you'd like to [work with us](https://hashrocket.com/contact-us/hire-us) or [join our team](https://hashrocket.com/contact-us/jobs), don't hesitate to get in touch.
@@ -2,4 +2,4 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec path: ".."
4
4
 
5
- gem "rails", "5.0.0.rc1"
5
+ gem "rails", "5.0.0"
@@ -13,4 +13,8 @@ module DecentExposure
13
13
  ActiveSupport.on_load :action_controller do
14
14
  include Controller
15
15
  end
16
+
17
+ ActiveSupport.on_load :action_mailer do
18
+ include Controller
19
+ end
16
20
  end
@@ -1,3 +1,3 @@
1
1
  module DecentExposure
2
- VERSION = "3.0.0.beta2"
2
+ VERSION = "3.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decent_exposure
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.beta2
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pravosud
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-11 00:00:00.000000000 Z
12
+ date: 2016-07-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -75,8 +75,7 @@ files:
75
75
  - decent_exposure.png
76
76
  - gemfiles/Gemfile.rails-4.2.0
77
77
  - gemfiles/Gemfile.rails-4.2.6
78
- - gemfiles/Gemfile.rails-5.0.0.rc1
79
- - hashrocket_logo.png
78
+ - gemfiles/Gemfile.rails-5.0.0
80
79
  - lib/decent_exposure.rb
81
80
  - lib/decent_exposure/attribute.rb
82
81
  - lib/decent_exposure/behavior.rb
@@ -118,12 +117,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
117
  version: '2.0'
119
118
  required_rubygems_version: !ruby/object:Gem::Requirement
120
119
  requirements:
121
- - - ">"
120
+ - - ">="
122
121
  - !ruby/object:Gem::Version
123
- version: 1.3.1
122
+ version: '0'
124
123
  requirements: []
125
124
  rubyforge_project:
126
- rubygems_version: 2.6.4
125
+ rubygems_version: 2.5.1
127
126
  signing_key:
128
127
  specification_version: 4
129
128
  summary: A helper for creating declarative interfaces in controllers
data/hashrocket_logo.png DELETED
Binary file