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

Dies at end of conversion if run within submodule #94

Closed
wincent opened this issue Oct 20, 2014 · 0 comments
Closed

Dies at end of conversion if run within submodule #94

wincent opened this issue Oct 20, 2014 · 0 comments

Comments

@wincent
Copy link

wincent commented Oct 20, 2014

Just used transpec for the first time on a small project; nice work... it performed 967 conversions for me; sure beats doing it yourself.

However, it crashed at the end trying to write to a file in a non-existent .git directory; non-existent because I was running inside a submodule, where .git is just a text file with a gitdir link inside of it.

/Users/glh/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/transpec-2.3.7/lib/transpec/git.rb:35:in `write': Not a directory @ rb_sysopen - /Users/glh/code/walrus/src/vendor/walrat/.git/COMMIT_EDITMSG (Errno::ENOTDIR)
        from /Users/glh/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/transpec-2.3.7/lib/transpec/git.rb:35:in `write_commit_message'
        from /Users/glh/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/transpec-2.3.7/lib/transpec/cli.rb:132:in `generate_commit_message'
        from /Users/glh/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/transpec-2.3.7/lib/transpec/cli.rb:41:in `run'
        from /Users/glh/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/transpec-2.3.7/lib/transpec/cli.rb:19:in `run'
        from /Users/glh/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/transpec-2.3.7/bin/transpec:7:in `<top (required)>'
        from bin/transpec:16:in `load'
        from bin/transpec:16:in `<main>'
wincent added a commit to wincent/walrat that referenced this issue Oct 20, 2014
Did this with the help of the transpec gem. Contrary to the README, I
found I did need to add it to the Gemfile (although obviously, I removed
it immediately afterwards).

Additionally it crashed trying to open `.git/COMMIT_EDITMSG` after the
conversion had completed, because I was running it from inside a
submodule; upstream issue for that:

  yujinakayama/transpec#94

Here are the relevant bits of the output:

  Summary:

  415 conversions
    from: obj.should
      to: expect(obj).to
  382 conversions
    from: == expected
      to: eq(expected)
  100 conversions
    from: lambda { }.should
      to: expect { }.to
  35 conversions
    from: obj.should_not
      to: expect(obj).not_to
  32 conversions
    from: lambda { }.should_not
      to: expect { }.not_to
  2 conversions
    from: it { should_not ... }
      to: it { is_expected.not_to ... }
  1 conversion
    from: it { should ... }
      to: it { is_expected.to ... }

  967 conversions, 0 incompletes, 0 warnings, 0 errors

Sure beats doing it by hand, or even with Vim macros...
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

1 participant