foobara-domain-mapper-generator 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad87f7659590c4159187db82559ccde60f5405549b5848621801054dc9b598f5
4
- data.tar.gz: d21c48d31b7ac1bfcda91d65e42f13ebd45254dbd83959690091c4bea15faa00
3
+ metadata.gz: 99cda9488ef0d2374fced6da9b91858851fd4384ddd9cd602a769d284c724178
4
+ data.tar.gz: cfd04a80b439b85128d64d1e75d7dea548f57d0e1dfd466a53ee28277e1b6c61
5
5
  SHA512:
6
- metadata.gz: 5efaea382b23fb7dc2886a98ddf87a276dfa5970a555860b8427eab9d7c742db52a5cc45c0c7a44da8da24d4483afea4b30da4a231353072734a4726823d5443
7
- data.tar.gz: d8bd62c3a15ed87c29e4aded229859e422e6db4b6783c130302008da043ad46ef50f75cfb933a1e5d35b8d43ccca05455ec6f87b67a3f4558707d121404656c1
6
+ metadata.gz: ef49d726e58e008a1dfbb07f9521f89866e4adab98ae7180d3c71c8cf5a11375ea0ceba15a722285a5f07bbfb7a5c1429137b9e89942d2ad5aea924b47f50267
7
+ data.tar.gz: 597a58a2c1a59d8cb85660cc1e64df646f8d3267da15ed0d8f983bf7d5b1480fe1b7f0418481fe59848cdf3d0647259aa777729fbbe7e62858a77f7d5368febd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.0.3] - 2024-08-14
2
+
3
+ - Do not add generator gem to Gemfile
4
+
5
+ ## [0.0.2] - 2024-06-22
6
+
7
+ - Include templates in gem
8
+
1
9
  ## [0.0.1] - 2024-06-17
2
10
 
3
11
  - Add Apache-2.0 license
@@ -8,8 +8,7 @@ module Foobara
8
8
  case manifest
9
9
  when DomainMapperConfig
10
10
  [
11
- Generators::DomainMapperGenerator,
12
- Generators::GemfileGenerator
11
+ Generators::DomainMapperGenerator
13
12
  ]
14
13
  else
15
14
  # :nocov:
@@ -0,0 +1,15 @@
1
+ <% module_path[..-2].each do |part| %>
2
+ module <%= part %>
3
+ <% end %>
4
+ class <%= module_path.last %> < Foobara::DomainMapper
5
+ from :integer
6
+ to :string
7
+
8
+ def map(from_value)
9
+ from_value.to_s
10
+ end
11
+ end
12
+
13
+ <% (module_path.size - 1).times do %>
14
+ end
15
+ <% end %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-domain-mapper-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-17 00:00:00.000000000 Z
11
+ date: 2024-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foobara
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description:
41
+ description:
42
42
  email:
43
43
  - azimux@gmail.com
44
44
  executables: []
@@ -54,8 +54,8 @@ files:
54
54
  - src/domain_mapper_config.rb
55
55
  - src/generate_domain_mapper.rb
56
56
  - src/generators/domain_mapper_generator.rb
57
- - src/generators/gemfile_generator.rb
58
57
  - src/write_domain_mapper_to_disk.rb
58
+ - templates/src/domain_mapper.rb.erb
59
59
  homepage: https://github.com/foobara/generators-domain-mapper-generator
60
60
  licenses:
61
61
  - Apache-2.0
@@ -65,7 +65,7 @@ metadata:
65
65
  source_code_uri: https://github.com/foobara/generators-domain-mapper-generator
66
66
  changelog_uri: https://github.com/foobara/generators-domain-mapper-generator/blob/main/CHANGELOG.md
67
67
  rubygems_mfa_required: 'true'
68
- post_install_message:
68
+ post_install_message:
69
69
  rdoc_options: []
70
70
  require_paths:
71
71
  - lib
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  version: '0'
82
82
  requirements: []
83
83
  rubygems_version: 3.4.10
84
- signing_key:
84
+ signing_key:
85
85
  specification_version: 4
86
86
  summary: Generates Foobara domain mappers
87
87
  test_files: []
@@ -1,39 +0,0 @@
1
- module Foobara
2
- module Generators
3
- module DomainMapperGenerator
4
- module Generators
5
- class GemfileGenerator < DomainMapperGenerator
6
- def applicable?
7
- gemfile_contents !~ /^\s*gem\s*["']foobara-domain-mapper-generator\b/
8
- end
9
-
10
- def template_path
11
- "Gemfile"
12
- end
13
-
14
- def target_path
15
- "Gemfile"
16
- end
17
-
18
- def generate(_elements_to_generate)
19
- match = gemfile_contents.match(/^gem /)
20
-
21
- if match
22
- new_entry = 'gem "foobara-domain-mapper-generator", github: "foobara/domain-mapper-generator"'
23
- "#{match.pre_match}\n#{new_entry}\n#{match}#{match.post_match}"
24
- else
25
- # TODO: maybe print a warning and return the original Gemfile
26
- # :nocov:
27
- raise "Not sure how to inject foobara-domain-mapper-generator into the Gemfile"
28
- # :nocov:
29
- end
30
- end
31
-
32
- def gemfile_contents
33
- File.read(template_path)
34
- end
35
- end
36
- end
37
- end
38
- end
39
- end