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

Separating assignments to code_script and guard_script as they should… #293

Merged
merged 4 commits into from
Nov 17, 2015
Merged

Conversation

ruicovelo
Copy link
Contributor

Separating assignments to code_script and guard_script as they should be different scripts and not hold the same reference.

… be different scripts and not hold the same reference.
@chef-supermarket
Copy link

Hi. I am an automated pull request bot named Curry. There are commits in this pull request whose authors are not yet authorized to contribute to Chef Software, Inc. projects or are using a non-GitHub verified email address. To become authorized to contribute, you will need to sign the Contributor License Agreement (CLA) as an individual or on behalf of your company. You can read more on Chef's blog.

GitHub Users Who Are Not Authorized To Contribute

The following GitHub users do not appear to have signed a CLA:

Please sign the CLA here.

@mwrock
Copy link
Contributor

mwrock commented Nov 3, 2015

I believe this PR is inspired by #291. I think your concern there was that the concatenation of the guard_script and code_script.

Here you are referring to a assignment by reference issue. So if they are unrelated thats fine but I don't think the reference issue exits here. cert_script just returns a string and both guard_script and code_script are assigned to that string. Later changing guard_script will not impact code_script.

However, I might be totally missing the issue here. Can you shed more detail?

@ruicovelo
Copy link
Contributor Author

Sure. The assignment is by reference if you do it like this: code_script=guard_script=

Here is an example. Notice the object_id:

ruby --version
ruby 2.0.0p645 (2015-04-13) [i386-mingw32]

irb --version
irb 0.9.6(09/06/30)

irb
irb(main):001:0> code_script=guard_script=''
=> ""
irb(main):002:0> code_script.object_id
=> 23843244
irb(main):003:0> guard_script.object_id
=> 23843244
irb(main):004:0> code_script << 'something'
=> "something"
irb(main):005:0> guard_script
=> "something"
irb(main):006:0> guard_script << 'some other thing'
=> "somethingsome other thing"
irb(main):007:0> code_script
=> "somethingsome other thing"
irb(main):008:0>

@chef-supermarket
Copy link

Hi. Your friendly Curry bot here. Just letting you know that all commit authors have become authorized to contribute. I have added the "Signed CLA" label to this issue so it can easily be found in the future.

@mwrock
Copy link
Contributor

mwrock commented Nov 4, 2015

ah duh. of course. I was thinking of reassignments and forgot about the concatenation.

Auto correct rubocop warnings and disable others
@mwrock
Copy link
Contributor

mwrock commented Nov 7, 2015

You think you can rebase master? I think that will get this to green.

@ruicovelo
Copy link
Contributor Author

Done!

@mwrock
Copy link
Contributor

mwrock commented Nov 7, 2015

👍

Cc @chef/windows-client

@smurawski
Copy link
Contributor

👍 LGTM

mwrock added a commit that referenced this pull request Nov 17, 2015
Separating assignments to code_script and guard_script as they should…
@mwrock mwrock merged commit e7dfa42 into chef-boneyard:master Nov 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants