rails_plan 0.0.3 → 0.0.4

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: 637cf6bb65b71b6c3d5abb4156d904e10291ac9bedf20155572b287f9a58fba4
4
- data.tar.gz: 18da9973257fb0d88d24e6aa29d93423085f68d04ee1f22a3fb6711721a358e5
3
+ metadata.gz: 2514de50b22779a293ad4455071eb682e829d7343658ec508b6042617fca276b
4
+ data.tar.gz: b7ba5905351dfcb7341c356c51f2fbf6e82957dcba3d2aee165a78db05ef8933
5
5
  SHA512:
6
- metadata.gz: 75beefe685a677aa49ea3858ce9e37cbbdfc892817a797042f8f6018ae8523283a47b417f9cef8bcfc1f1a08086bc14e295be766c096ea10f43aae122f6cd75f
7
- data.tar.gz: 12555f000a2c7430a73e6d2a769798ad7c64924c1f723eadc3a3f8b053bd1a65990b40526ee43835e8034327adda986c21ed53243b6de441619397196248d5e4
6
+ metadata.gz: 9f3a6ae5c736b3b6345760dbee23be420b360798962bade77fde65d349f45b6c06fa0589c0adc47b0646285d2cb2056b55d76e0eba7a2994b3ee288179079157
7
+ data.tar.gz: 6f3d97472e4f309079bde3f40d760e344adfc174f75ea1264caaafe04d4c7ce82d516e2985a254151881cc61411f028951034df83f6245dee274a1fbb5894f8b
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsPlan
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  RAILS_VERSION = '7.1.3.3'
6
6
  end
data/lib/rails_plan.rb CHANGED
@@ -28,11 +28,11 @@ module RailsPlan
28
28
  append_code(template['append_code'])
29
29
  update_files(template['gsub'])
30
30
 
31
- puts 'Time for coding! 🚀'
32
-
33
31
  template['steps'].each do |step|
32
+ puts step['title'] if step['title']
34
33
  run_commands(step['before_commands'])
35
34
  generate_files(step['files'])
35
+ prepend_to_file(step['prepend_code'])
36
36
  run_commands(step['after_commands'])
37
37
  end
38
38
  end
@@ -77,6 +77,16 @@ module RailsPlan
77
77
  end
78
78
  end
79
79
 
80
+ def prepend_to_file(injections)
81
+ return if injections.nil? || injections.empty?
82
+
83
+ thor_app = ::RailsPlan::RailsApp.new
84
+
85
+ injections.each do |injection|
86
+ thor_app.insert_into_file(injection['file_path'], injection['content'], after: injection['after'])
87
+ end
88
+ end
89
+
80
90
  def append_code(appends)
81
91
  return if appends.nil? || appends.empty?
82
92
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_plan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paweł Dąbrowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-06 00:00:00.000000000 Z
11
+ date: 2024-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client