Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add static_page rails generator #321

Closed
wants to merge 4 commits into from

Conversation

whatnotery
Copy link

This PR creates the generator requested in #303

Hope this is helpful!

end

it "creates an HTML.ERB page template in the correct location" do
expect(File.exist?("#{destination}/app/views/pages/#{filename}.html.erb")).to be(true)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [90/80]


before do
FileUtils.mkdir_p(destination)
Rails::Generators.invoke('static_page', [filename], destination_root: destination)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Metrics/LineLength: Line is too long. [86/80]

RSpec.describe StaticPageGenerator, type: :generator do
# Define the destination directory for generator output
let(:destination) { Rails.root.join('tmp/generators') }
let(:filename) { 'homepage' }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.


RSpec.describe StaticPageGenerator, type: :generator do
# Define the destination directory for generator output
let(:destination) { Rails.root.join('tmp/generators') }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rails/FilePath: Please use Rails.root.join('path', 'to') instead.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -0,0 +1,22 @@
require 'spec_helper'
require 'rails/generators'
require_relative '../../lib/generators/static_page_generator.rb' # Make sure this path is correct for your project
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Metrics/LineLength: Line is too long. [114/80]

@@ -0,0 +1,22 @@
require 'spec_helper'
require 'rails/generators'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -0,0 +1,22 @@
require 'spec_helper'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@whatnotery
Copy link
Author

Not sure if these hound critiques are valid as I largely tried following convention within the project

@whatnotery
Copy link
Author

failed to see new features weren't being added :(

@whatnotery whatnotery changed the title add static page rails generator add static_page rails generator May 19, 2024
@stefannibrasil
Copy link
Contributor

Hi @whatnotery thank you for contribution but this library is in maintenance mode, which means we will only accept bug fixes/dependencies updates contributions. We have other gems you can contribute to, if you're interested. This post shares some active ones. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants