easy_gen 1.6.0 → 1.6.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
  SHA256:
3
- metadata.gz: 704dd52bb44c930196671167649dcaad74f1db4a643a15b37089de0ed6c063c1
4
- data.tar.gz: cbb167f75520b3572f09b58e57f37728edb058cca74e05ac2c215078e714d6f2
3
+ metadata.gz: f1362b1ba2da4814d58d654dd6115e53ff229bdb6f8bfe8592e2461956b74b9a
4
+ data.tar.gz: 7d612ef8aebffde4479feda485b5438c0ec3ab8532e303f5a9afd6367051ab64
5
5
  SHA512:
6
- metadata.gz: c2b522d66b5b4a5f3b3f62d213ee104e20a433818986e55f3fdf856a444bea52fe7473ad26ee8b188c6fc2a3ca09116151204b9aa1986d941d6128dc26aee25d
7
- data.tar.gz: 210b48f4eeda121cec5d6adecb1035183643c14cfa13a9187f3182da5ffe1bc7bb74850b2ea424661a4129543bc06717152f28651939777864b9f613ef1ee91c
6
+ metadata.gz: a850f22cef20e15f1e94a04159a024c531e5b5213ab0f37ba304234bc3a3be0f90b9d7c6ce87b155783411acbf05e79ac704e008b855bcb27f0f465ab9d3af6e
7
+ data.tar.gz: 18bb3f3bffb31f8dbeceb1e8dca4f48233fb271648388ffa4481cc364a221c25419a3fdc9b75e92eab6c08c6964f91f7f8193e8d4fd2de11974425e610c61f14
data/README.md CHANGED
@@ -9,7 +9,7 @@ Save typing when generating certain classes in somewhat standard patterns.
9
9
  Add the following to the development group in your Gemfile:
10
10
 
11
11
  ```ruby
12
- gem "easy_gen"
12
+ gem "easy_gen", group: :development
13
13
  ```
14
14
 
15
15
  Then run
@@ -134,6 +134,24 @@ The command above:
134
134
  - Installs new test class in '/test/strategies/fishing' with the name 'LineStrategy' in the file '/test/strategies/line_strategy_test.rb'.
135
135
  - Installs new test class in '/test/strategies/fishing' with the name 'NetStrategy' in the file '/test/strategies/net_strategy_test.rb'.
136
136
 
137
+ ### Serializer Classes
138
+ If you want to do something other than standard JSON serialization...
139
+
140
+ ```sh
141
+ bundle exec rails g serializer basic
142
+ ```
143
+
144
+ The command above:
145
+
146
+ - Creates '/app/serializers' directory if it doesnt exist.
147
+ - Installs new application serializer class in '/app/serializers' with the name 'ApplicationSerializer' in file '/app/decorators/application_serializer.rb.'.
148
+ - Installs new serializer class in '/app/serializer' with the class name 'BasicSerializer' in the file /app/decorators/basic_seralizer.rb. This will inherit from /app/decorators/application_serializer.rb.'
149
+ - Creates '/test/serializers' directory if it doesnt exist.
150
+ - Installs new test class in '/test/serializers' with the name 'BasicSerializerTest' in the file '/test/decorators/basic_serializer_test.rb'.
151
+
152
+
153
+ Module option is also supported.
154
+
137
155
 
138
156
  ## Summary
139
157
  ** Saves a bit of typing
@@ -18,7 +18,6 @@ class DecoratorGenerator < Rails::Generators::NamedBase
18
18
  class_option :module, type: :string
19
19
 
20
20
  def main
21
- raise "No such model - #{model_name} - in #{model_path} (#{Dir.pwd})- please check naming" unless model_exists?
22
21
  copy_templates
23
22
  end
24
23
 
@@ -52,6 +52,7 @@ module EasyGenGenerator
52
52
  def abstract_base_class_count
53
53
  Object.const_defined?("#{self.class}::BASE_CLASSES") ? self.class::BASE_CLASSES : 1
54
54
  end
55
+
55
56
  def no_files?
56
57
  count_of_files_indicates_empty? && files_are_abstract_class? && no_tests?
57
58
  end
@@ -1,3 +1,3 @@
1
1
  module EasyGen
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Stearn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-25 00:00:00.000000000 Z
11
+ date: 2023-04-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple generator for some standard design pattern classes and matching
14
14
  minitests.
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubygems_version: 3.4.8
79
+ rubygems_version: 3.4.10
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Easy Boilerplate Classes with Minitests!