mutations_generator 0.2.0 → 0.3.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
  SHA256:
3
- metadata.gz: 1a9177068a2a6b70f86a7bbc67983e1ead0ddb3501723195c96e13c26d445003
4
- data.tar.gz: 6ba46d9198c4b95037cca712fbe442e9b51d7c6ae52438e8c57714e6a3754b1a
3
+ metadata.gz: a6eeb9b546dfdd0fb2e8c7ca4583f6ab356c09a48377279f213877963bdf1424
4
+ data.tar.gz: ebf5c32af1ffaf230905489eb460f6469ee97090b7e876048f5283aefdca5a0e
5
5
  SHA512:
6
- metadata.gz: 3ca1cdf1f75c2c0c522de9e65a1c3b165eec44bdb63a7535c35ff3604cc9fa7fe435f909095f3a11724a906f9ae84585fd5e6ed3a4efeb63699710e4a81eadbc
7
- data.tar.gz: 062b2547fe4f673c9a5d3626cd97edd07b6917eff00e7eda691d4b59664081ba666bf21712c638fe2efaf291a5e157ce5de7a4a035f17c9987b6488fef36abc1
6
+ metadata.gz: 6c5984438772c3a5a8262ba68601965b5fbf954c053e74c03bb608937c29638d74d10516c9405925a0fd7d7dd1963a3cea8ccda5ad8a148908d14b6573605aa7
7
+ data.tar.gz: 344aba532ca87a77ef088f439e3ba75b7a6fb646c02c6ea0753cee9e0522998be48843debe14d8c1a5d264a2c63337617528fe3ca9a0921e57036aa06d029b2f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mutations_generator (0.2.0)
4
+ mutations_generator (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -20,8 +20,11 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ ```
24
+ rails g mutation PumpTheJam technotronic:string:required space_jam:string:optional
24
25
 
26
+ # created app/mutations/pump_the_jam.rb
27
+ ```
25
28
  ## Development
26
29
 
27
30
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -8,3 +8,4 @@ Example:
8
8
 
9
9
  This will create:
10
10
  app/mutations/pump_the_jam.rb
11
+ spec/mutations/pump_the_jam_spec.rb
@@ -16,6 +16,13 @@ class MutationGenerator < Rails::Generators::NamedBase
16
16
  set_local_assigns!
17
17
 
18
18
  template 'mutation.erb', generator_path
19
+
20
+ # Create spec if application uses specs
21
+ spec_mutation_dir_path = 'spec/mutation/'
22
+ spec_generator_path = spec_mutation_dir_path + "/#{file_name}_spec.rb"
23
+
24
+ Dir.mkdir(spec_mutation_dir_path) if Dir.exist?('spec') && !File.exist?(spec_mutation_dir_path)
25
+ template 'mutation_spec.erb', spec_generator_path if Dir.exist?('spec')
19
26
  end
20
27
 
21
28
  def set_local_assigns!
@@ -0,0 +1,15 @@
1
+ describe <%= @klass_name %> do
2
+ subject(:outcome) do
3
+ <%= @klass_name %>.run
4
+ end
5
+
6
+ describe '.validate' do
7
+ context 'when invalid' do
8
+ # TODO your code here
9
+ end
10
+ end
11
+
12
+ describe '.execute' do
13
+ # TODO your code here
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module MutationsGenerator
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutations_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - robertsimoes
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-19 00:00:00.000000000 Z
11
+ date: 2020-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mutations
@@ -58,6 +58,7 @@ files:
58
58
  - lib/generators/mutation/USAGE
59
59
  - lib/generators/mutation/mutation_generator.rb
60
60
  - lib/generators/mutation/templates/mutation.erb
61
+ - lib/generators/mutation/templates/mutation_spec.erb
61
62
  - lib/mutations_generator.rb
62
63
  - lib/mutations_generator/version.rb
63
64
  - mutations_generator.gemspec