Skip to content

Commit 04a5d73

Browse files
authored
Fix a Bug with webpacker generator (#1106)
* intial commit * Fix missing newline at end of webpacker_assets_generator.rb Add missing newline at end of file for consistency.
1 parent ad1edae commit 04a5d73

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Application < Rails::Application
1414
# Please, add to the `ignore` list any other `lib` subdirectories that do
1515
# not contain `.rb` files, or that should not be reloaded or eager loaded.
1616
# Common ones are `templates`, `generators`, or `middleware`, for example.
17-
config.autoload_lib(ignore: %w[assets tasks generators])
17+
config.autoload_lib(ignore: %w[assets tasks])
1818

1919
# Configuration for the application, engines, and railties goes here.
2020
#
Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
module Rails
2-
class WebpackerAssetsGenerator < Rails::Generators::NamedBase
3-
def create_assets_file
4-
create_file "app/javascript/packs/#{file_name}.js", <<-FILE
5-
your content
6-
FILE
7-
create_file "app/assets/stylesheets/#{file_name}.scss", <<-FILE
8-
your content
9-
FILE
1+
require 'rails/generators'
2+
3+
module Generators
4+
module Rails
5+
module WebpackerAssets
6+
class WebpackerAssetsGenerator < ::Rails::Generators::NamedBase
7+
def create_assets_file
8+
create_file "app/javascript/packs/#{file_name}.js", <<-FILE
9+
// your content
10+
FILE
11+
create_file "app/assets/stylesheets/#{file_name}.scss", <<-FILE
12+
// your content
13+
FILE
14+
end
15+
end
1016
end
1117
end
1218
end

0 commit comments

Comments
 (0)