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

Task to make .travis.yml file automatically #65

Closed
petems opened this issue Sep 21, 2013 · 7 comments
Closed

Task to make .travis.yml file automatically #65

petems opened this issue Sep 21, 2013 · 7 comments
Assignees
Milestone

Comments

@petems
Copy link

petems commented Sep 21, 2013

Hi guys! Awesome gem, really helped me when I was trying to figure out how to test against multiple versions of Puppet 👍

So, my idea for a cool feature is an additional rake task that automatically writes to and/or creates a .travis.yml. file in your repo, adding in the multiple gem versions to the gemfile: parameter there.

Sound good?

@sikachu
Copy link
Contributor

sikachu commented Sep 30, 2013

I think I like the idea. However, I'm not sure how much we can do in case user already have .travis.yml file. Would appending the gemfile: directive be enough, or should we parse the file, and overwrite the old gemfile: directive?

I mean, it's nice if we can tell you on what you need to put in there, and be able to automate that. What do you think would be the best way to do it?

@bf4
Copy link
Contributor

bf4 commented Dec 27, 2013

part of the install task should be to ensure the generated gemfiles are specified in the .travis.yml, and if not, either warn or add them

@sikachu
Copy link
Contributor

sikachu commented Aug 22, 2014

Looking back to this, I like the idea of ensuring that they are specified in .travis.yml. I don't think inserting it to the .travis.yml make sense, since you'll want to sort and format your .yml file to your liking.

I think I'll add this warning in appraisal generate if it finds .travis.yml that doesn't have correct gemfiles: directive.

@petems
Copy link
Author

petems commented Aug 22, 2014

Good compromise 👍

@sikachu sikachu added this to the v1.1.0 milestone Aug 22, 2014
@sikachu sikachu self-assigned this Aug 22, 2014
@maxlinc
Copy link

maxlinc commented Dec 12, 2014

It might not be too difficult to deal with conflicts if you use Thor generators and Actions. That's the same framework used by "bundle gem", "rails g" and many other generators, and appraisal already depends on Thor.

It may depend on the specific action, but based on my experience w/ Thor generators I'd expect:

  • If no file exists Thor will create the file
  • If a file already exists, Thor will either:
    • Display that no changes are necessary if the original and generated file are identical
    • Prompt the user about what action to take if the generated file doesn't match the original

For example, I just ran a Thor generator and it displayed (w/ color):

   identical  dashboard.js
    conflict  matrix.json
Overwrite /Users/Thoughtworker/repos/rackspace/polytrix-openstack/reports/details/identity-authenticate_token-fog.html? (enter "h" for help) [Ynaqdh] h
        Y - yes, overwrite
        n - no, do not overwrite
        a - all, overwrite this and all others
        q - quit, abort
        d - diff, show the differences between the old and the new
        h - help, show this help

Note the "diff" action, which is what I makes this really useful.

@sikachu
Copy link
Contributor

sikachu commented Dec 31, 2014

@maxlinc the problem is that they will never match, as appraisal only knows and cares about gemfiles: specification. However, users would have another configurations that they have, scattered around the file unordered. I think showing the suggestion is the most unobtrusive way to do this.

But if in the future if we could generate the diff while maintaining user's configuration and their positions, I'm all ears.

@sikachu sikachu modified the milestones: v1.1.0, v2.0.0 Mar 9, 2015
sikachu added a commit that referenced this issue Apr 3, 2015
* Add `--travis` flag to `appraisal generate` to display the correct
  gemfiles configuration.
* Warn when users have an incorrect gemfiles configuration in their
  `.travis.yml` file.
* Advise users to run command with `--travis` if they have no `gemfiles`
  configuration in their `.travis.yml` file.

Fix #65
sikachu added a commit that referenced this issue Apr 3, 2015
* Add `--travis` flag to `appraisal generate` to display the correct
  gemfiles configuration.
* Warn when users have an incorrect gemfiles configuration in their
  `.travis.yml` file.
* Advise users to run command with `--travis` if they have no `gemfiles`
  configuration in their `.travis.yml` file.

Fix #65
sikachu added a commit that referenced this issue Apr 10, 2015
* Add `--travis` flag to `appraisal generate` to display the correct
  gemfiles configuration.
* Warn when users have an incorrect gemfiles configuration in their
  `.travis.yml` file.
* Advise users to run command with `--travis` if they have no `gemfiles`
  configuration in their `.travis.yml` file.

Fix #65
@petems
Copy link
Author

petems commented Apr 10, 2015

Woo! 👍 😄

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

No branches or pull requests

4 participants