crud_responder 0.2.4 → 0.2.5

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: ea30ca09041d63698596e2b63ae437f5644117ae
4
- data.tar.gz: 4f9a690ccfc8a24403963c62819f4fbcd7d0a0bf
3
+ metadata.gz: bc4c6a90000c908653f2a0a63e6fd05111888fa8
4
+ data.tar.gz: c99c02ff88014b717adb59c24623907150f1badb
5
5
  SHA512:
6
- metadata.gz: d4dce5eaf2a58601ab686cbaa7f3bb5e9727e0e49a8794d5df652fed29110bea81474aab2999f6bcd93b138fa853b706ff0512b3c9e2025e00e73b152792742c
7
- data.tar.gz: da2913826aeea78d96f7f7c93c4511e4b23afe1d53772b63ddc31614918e229207e57888926642e553efd611ac8cb69a640ada0edb7983a3c56473d29e9782ff
6
+ metadata.gz: 1f98a0eb1aa646f2951e211d664a5cc1afc7d83672919ed882ca5000832850025ecf9cd5623e746c6c6b619f40cba702bf0112cf5404bd7ba9d153ef6d155b4c
7
+ data.tar.gz: 338a0c8c5126ecfd2a6d57378949b075480b65ac79ffeedb6c217c99c35a4659bce08b983522d2722b55b119690150c9326a5bcc817e16865d27fc9885e9d153
data/README.md CHANGED
@@ -84,31 +84,23 @@ gem 'crud_responder'
84
84
 
85
85
  And then execute:
86
86
 
87
- $ bundle install
88
-
87
+ ```Shell
88
+ $ bundle install
89
+ ```
89
90
  Or install it yourself as:
90
91
 
91
- $ gem install crud_responder
92
-
93
- Copy translations from gem's `config/locales` to your `config/locales`. Or, for example, create file `config/locales/crud_responder.en.yml` in your project with following content:
94
- ```yaml
95
- en:
96
- flash:
97
- actions:
98
- create:
99
- notice: '%{resource_name} %{resource_desc} was successfully created.'
100
- alert: '%{resource_name} %{resource_desc} cannot be created. %{errors}'
101
- update:
102
- notice: '%{resource_name} %{resource_desc} was successfully updated.'
103
- alert: '%{resource_name} %{resource_desc} cannot be updated. %{errors}'
104
- destroy:
105
- notice: '%{resource_name} %{resource_desc} was successfully destroyed.'
106
- alert: '%{resource_name} %{resource_desc} cannot be destroyed. %{errors}'
92
+ ```Shell
93
+ $ gem install crud_responder
94
+ ```
95
+ Generate initial files:
96
+
97
+ ```Shell
98
+ $ rails g crud_responder:install
107
99
  ```
108
100
 
109
101
  ## Usage
110
102
 
111
- Include `CrudResponder` into your `ApplicationController` (or whatever base controller you have)
103
+ Include `CrudResponder` into your `ApplicationController` (or whatever base controller you have). Note: generator already has included CrudResponder to Application controller.
112
104
  ```ruby
113
105
  class ApplicationController
114
106
  include CrudResponder
@@ -185,8 +177,8 @@ Now your controllers are skinny again! Also, you are forced to think in terms of
185
177
 
186
178
  ## TODO
187
179
 
188
- * Cutomizing flash messages (+ task to copy skeleton locale)
189
- * Support for pure API controllers (which is much simplier)
180
+ * Customizing flash messages
181
+ * Support for pure API controllers (which is much simpler)
190
182
  * Testing
191
183
 
192
184
  Note about pure API controllers. I already use this idea:
@@ -1,3 +1,3 @@
1
1
  module CrudResponder
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
@@ -0,0 +1,20 @@
1
+ module CrudResponder
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ source_root File.expand_path('..', __FILE__)
5
+
6
+ desc 'Creates an initializer with default crud_responder configuration and copy locale file'
7
+
8
+ def update_application_controller
9
+ inject_into_class 'app/controllers/application_controller.rb', 'ApplicationController', <<-RUBY
10
+ include CrudResponder
11
+
12
+ RUBY
13
+ end
14
+
15
+ def copy_locale
16
+ copy_file '../../../config/locales/en.yml', 'config/locales/crud_responder.en.yml'
17
+ end
18
+ end
19
+ end
20
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crud_responder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Antonyan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-25 00:00:00.000000000 Z
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -117,6 +117,7 @@ files:
117
117
  - lib/crud_responder.rb
118
118
  - lib/crud_responder/default_options.rb
119
119
  - lib/crud_responder/version.rb
120
+ - lib/generators/crud_responder/install_generator.rb
120
121
  homepage: https://github.com/olegantonyan/crud_responder
121
122
  licenses:
122
123
  - MIT