-
-
Notifications
You must be signed in to change notification settings - Fork 632
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
Fix Windows compatibility #666
Fix Windows compatibility #666
Conversation
1 similar comment
Thanks for this! We need a CHANGELOG.md entry per the instructions in https://github.com/shakacode/react_on_rails/blob/master/CONTRIBUTING.md and need travis to be passing. Reviewed 1 of 1 files at r1. lib/generators/react_on_rails/install_generator.rb, line 68 at r1 (raw file):
Let's dry up this check in for a windows ruby platform by creating a utility method in https://github.com/shakacode/react_on_rails/blob/master/lib/react_on_rails/utils.rb Let's add a unit test for this utility method that will compare the result against a different way of figuring out the value, as suggested by the answers here. http://stackoverflow.com/a/171011/1009332 Comments from Reviewable |
da203cc
to
13cff3f
Compare
@GeorgeGorbanev Why did you close this PR? |
@justin808 My bad, it was not expected. Will fix it soon. |
@justin808 Added few lines in changelog and separated checking method to utils module. But have some troubles with tests. Practically I never did it before and don't know how to do it. I tried to do it using this tips and on command:
get error
Log file is attached. npm-debug.txt Can you help me? |
@GeorgeGorbanev You'll have to yak shave that one. Possibly there's issues with Windows? Maybe downgrade the version of node to the latest 6.x version? |
Please rebase on top of master and try again. |
Remove the last commit and please try the rebase again. You should ONLY see the changes that you've made. @GeorgeGorbanev |
20b015f
to
779fa51
Compare
@GeorgeGorbanev Any progress? |
@justin808 Yes, some kind of progress. I configured system to run tests and ready to write rspec. Also, did I rebased branch right way this time? |
almost there. Yes, tests and pass CI. did you lint? Reviewed 2 of 3 files at r2, 1 of 1 files at r3. Comments from Reviewable |
@justin808 Guess no, don't know how to do it. |
@justin808 Thank you. It will be done. |
27b4894
to
b368777
Compare
1 similar comment
c19a744
to
2085aa2
Compare
2 similar comments
@justin808 How it looks now? |
some more comments Reviewed 5 of 5 files at r5. CHANGELOG.md, line 19 at r5 (raw file):
Please double check that your formatting matches all other entries. get rid of the ====== and add the PR number and your github info! lib/react_on_rails/utils.rb, line 43 at r5 (raw file):
Why do we care if mac or unix? spec/react_on_rails/generators/install_generator_spec.rb, line 168 at r5 (raw file):
Comments from Reviewable |
@justin808 Thanks for review and sorry for really dirty code. I will follow all your comments. |
I've never seen the def `(where) syntax I don't see why you will call the wrong command on the wrong OS. That's the point of your fix. And yes, no need to detect Mac. |
@justin808 This syntax described by Hal Fulton for example. Hope it is not bad style.
Actually it turns wrong command to correct, so we can test method behavior as it would be correct OS. Now it defined in wrong place and "node_missing?" can't use it, but I'll fix it, when find how. Better do another way? |
@justin808 Besides a RUBY_PLATFORM constant method I found method using shell command "uname -s" and method using rbconfig. But all of them require the same regexp-matching. Did you mean one of them? |
2 similar comments
3 similar comments
67a7f02
to
e7d068c
Compare
e7d068c
to
13cff3f
Compare
… unit-tests for it.
e17671e
to
463ddb6
Compare
3 similar comments
@justin808 Fixed all. It works and tests without weird syntax. Also changelog and commits history was cleared. Can I do something else to make it better? |
Big improvement! Reviewed 4 of 4 files at r6. Comments from Reviewable |
system call for Windows and unit-tests for it. (#666)
'install_generator.rb' uses *nix instruction 'which' to find Node and npm path.
Now it use 'where' if detect running on Windows and 'which' in other case.
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)