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

Ensure stylesheet_base generator runs with a clean bundle #790

Merged
merged 1 commit into from
Jul 21, 2016

Conversation

tute
Copy link
Contributor

@tute tute commented Jul 20, 2016

Static and Stylesheet suspenders' generators add gems to the Gemfile,
but don't run bundle install after the fact, making installations with
clean gem sets fail with errors like:

 gemfile  high_voltage
generate  suspenders:stylesheet_base
Could not find gem 'high_voltage' in any of the gem sources listed in
your Gemfile or available on this machine.
Run `bundle install` to install missing gems.
     run  bundle install
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies...
Using rake 11.2.2

By adding bundle install calls after modifying the Gemfile we ensure
each step will have the necessary dependencies for application code to
run.

[fixes #568]
[fixes #787]

@tute tute mentioned this pull request Jul 20, 2016
@id4ho
Copy link

id4ho commented Jul 20, 2016

LGTM

Though if bundle needs to be run after any generate maybe we could overwrite it here like:

def generate(cmd)
  super
  bundle_command "install"
end

@tute
Copy link
Contributor Author

tute commented Jul 20, 2016

Thanks for your review. Indeed. Or run on steps that modify the Gemfile.

@tute
Copy link
Contributor Author

tute commented Jul 20, 2016

Added a commit which would render one of the bundle installs unnecessary.

@id4ho
Copy link

id4ho commented Jul 20, 2016

Nice work, looks really good! I'm not familiar with rails generators though, does every instance var get run automatically inside StylesheetBaseGenerator?

@tute
Copy link
Contributor Author

tute commented Jul 20, 2016

What instance variables do you mean?

@tute tute force-pushed the tc-bugfix-787 branch 2 times, most recently from 0b176cd to 63b1775 Compare July 20, 2016 02:58
Static and Stylesheet suspenders' generators add gems to the `Gemfile`,
but don't run `bundle install` after the fact, making installations with
clean gem sets fail with errors like:

```
     gemfile  high_voltage
    generate  suspenders:stylesheet_base
Could not find gem 'high_voltage' in any of the gem sources listed in
your Gemfile or available on this machine.
Run `bundle install` to install missing gems.
         run  bundle install
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies...
Using rake 11.2.2
```

By adding `bundle install` calls after modifying the `Gemfile` we ensure
each step will have the necessary dependencies for application code to
run.

[fixes #568]
[fixes #787]
@mike-burns
Copy link
Contributor

LGTM.

@id4ho
Copy link

id4ho commented Jul 20, 2016

Ah sorry @tute, I meant instance methods (:install_refills, :install_bitters). Was getting late over here last night, I don't know how you do it ;)

I'm gonna assume it's a meta thing.

@tute
Copy link
Contributor Author

tute commented Jul 21, 2016

Does every instance method run automatically?

Yes, public methods defined in the class execute when the generator is run.

@tute tute merged commit 63b1775 into master Jul 21, 2016
@tute tute deleted the tc-bugfix-787 branch July 21, 2016 13:42
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.

Default scss setup for Bitters Sass::SyntaxError: File to import not found or unreadable: refills/flashes.
3 participants