-
Notifications
You must be signed in to change notification settings - Fork 487
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
radical changes for Dsl, tiny changes to Notifier, changes to most specs, all specs pass except Mac specific ones. #55
Conversation
…uld_send? to allow for stubbing in tests and added #turn_on to allow more flexibility for when things are or are not sent. Notifier Specs changed to make pass, expanded and to use new notify strategies. NOTE mac tests not tested. Guard::Dsl changed massively. overall strategy was to decouple to evaluate_guardfile into "getting the data" and "using the data" parts. this provides the ability to pass a string that contains the contents of a guardfile, or to pass a filename for a guardfile as well as reading the default loc for a guardfile. Dsl specs changed massivly to support new style of Dsl listener/linux_spec changed to add a few :long_running tags and to alter some paths to correct values listener/polling_spec changed to add a few :long_running tags and to alter some paths to correct values
I got this error when launch
Notifier specs are working great (I have handled the merge conflict with the recent modifications). Please can you also update the README to be in sync with your commits. Thanks for your work! PS: Maybe separates smaller pull requests would be easier to handle, don't you think? |
class << self | ||
def evaluate_guardfile(options = {}) | ||
options.is_a?(Hash) or raise ArgumentError.new("evaluate_guardfile not passed a hash") | ||
|
||
@@options = options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you modify the options hash at #L26, you should replace this line with @@options = options.dup
here.
Ok, I've made some comments on some parts of the commit. Also, could you follow the "conventions" of coding already in use in guard? For example, hashes: Anyway, it would be very cool if you could separate this big commit in one for the Notifier and one for the new Guardfile eval feature. We will have to find out why you had to remove "spec/" from here in order to make the specs pass on Linux (since it's the opposite for Mac). Last but not least, I'm not sure of the usefulness of passing "a string that contains the contents of a guardfile" to It would be something like Thanks for all Scott, if you can make the few changes I suggested you, it would be awesome! :) Let me know if you need anything from us. |
2a. I'm pretty sure I have my IDE and testing setup incorrectly. when I
For instance. I use a ~/workspace dir to house all of my vcs based project work. rails sites, gems, etc... what if I could just setup a Guardfile in that directory, that (when told to) automatically includes any Guardfiles it finds in all of the first level subdirectories. You could even get meta, watch the top level directory for new directories and automatically add tehm while its running. Happy to help, planning on banging on this for most of the weekend. |
Ok, that's more clear now, thanks!! :) Have a nice weekend! ;) |
also, while I have done much ruby (and rails) programming, and much perl before that. It's always been as an end-user. This is the first project I've contributed to so I'm still trying to figure out the (in)formalities of contributing. I won't take offense if you tell me I'm doing it wrong, so long as you tell me how to do it right the next time. Like now. I have no idea if I'm supposed to close this pull request or not. I figure erring on the side of failing to do something is better than doing something wrong. |
Hey, no problem! What I would suggest you is to keep this pull request for the "main" feature, i.e. the Dsl changes. Then you create a new branch in your repo for the changes in Notifier (with your branch rebased on guard:master) that you will be able to pull-request against guard:master. Does it seems right to you? I think it will be ok this way. Cheers! |
…luate_guardfile into "getting the data" and "using the data" parts. this provides the ability to pass a string that contains the contents of a guardfile, or to pass a filename for a guardfile as well as reading the default loc for a guardfile. Dsl specs changed massivly to support new style of Dsl
…uld_send? to allow for stubbing in tests and added #turn_on to allow more flexibility for when things are or are not sent. Notifier Specs changed to make pass, expanded and to use new notify strategies. NOTE mac tests not tested. i like the @enable as opposed to @disable, should be easy to reverse if necessary though
ugh, i hope that's something you can use. i thought i had pulled it off, but there are the 3 follow up commits showing up there and I don't understand why. I think you can skip the ones you want to skip with that |
… was passed to it. Except the options hash is actually a Thor::CoreExt::HashWithIndifferentAccess so, i reorganized the internal access and storage to read original data from the passed hash, but stores it into a local hash. No tests changed since no external behavior changed. All tests passed. This fixes the issue when the binary is run and results in a can't modify frozen hash (RuntimeError)
… was passed to it. Except the options hash is actually a Thor::CoreExt::HashWithIndifferentAccess so, i reorganized the internal access and storage to read original data from the passed hash, but stores it into a local hash. No tests changed since no external behavior changed. All tests passed. This fixes the issue when the binary is run and results in a can't modify frozen hash (RuntimeError) small change to fix specs to run and always have @@orig_options be locked.
Conflicts: lib/guard/notifier.rb spec/guard/notifier_spec.rb
Hi, I've merged your changes and improved some things... Thanks, please try it out and keep pull-requesting against master if you need new features! ;) |
I don't have a mac so no idea if the mac tests pass. Someone should be able to easily make them work using the linux branch (and non-working mac branch) as an example.
Made slight alteration to Guard::Notifier. pulled out logic into #should_send? to allow for stubbing in tests and added #turn_on to allow more flexibility for when things are or are not sent.
Notifier Specs changed to make pass, expanded and to use new notify strategies. NOTE mac tests not tested.
Guard::Dsl changed massively. overall strategy was to decouple to evaluate_guardfile into "getting the data" and "using the data" parts. this provides the ability to pass a string that contains the contents of a guardfile, or to pass a filename for a guardfile as well as reading the default loc for a guardfile.
Dsl specs changed massivly to support new style of Dsl and make pass
listener/linux_spec changed to add a few :long_running tags and to alter some paths to correct values
listener/polling_spec changed to add a few :long_running tags and to alter some paths to correct values
I'm going to follow this up with code that decouples the locations of script execution and Guardfile from the location of watch directories. currently all the dirs you have to watch must be below the location of the Guardfile. This is is groundwork for #53