Adds batchfile generation (not integrated with binstub generation yet) #2

Merged
merged 1 commit into from Mar 4, 2014

Projects

None yet

2 participants

@danielsdeleo
Member

Putting this up here for early feedback:

  • Is the batch file code correct?
  • How do we pass paths into the appbundler CLI at the moment? If we want the CLI to accept paths with backslashes, we'll need to translate them on the way in since ruby only deals with '/' separators internally.
@danielsdeleo
Member

/cc @adamedx

@adamedx adamedx commented on the diff Mar 4, 2014
lib/appbundler/app.rb
@@ -45,8 +45,30 @@ def gemfile_lock
File.join(app_root, "Gemfile.lock")
end
+ def ruby
+ Gem.ruby
+ end
+
+ def batchfile_stub
+ ruby_relpath_windows = ruby_relative_path.gsub('/', '\\')
@adamedx
adamedx Mar 4, 2014

Good defense here.

@adamedx
adamedx commented Mar 4, 2014

Looks good -- batch file code is correct. Can you explain more about the issue with passing in "" in cli? Seems like all inputs here are derived from Ruby methods that will give you "/" before you use other Ruby library calls, so I don't see the "" issue.

@danielsdeleo
Member

@adamedx the ruby apps that I've tried don't translate paths that they get as command line arguments. For example, rspec spec/something/my_code_spec.rb works, but rspec spec\something\my_code_spec.rb does not, which can be pretty annoying in powershell. I haven't tried running appbundler on windows yet, but I suspect the same would be true for appbundler's CLI.

@danielsdeleo danielsdeleo merged commit 9122afb into master Mar 4, 2014

1 check passed

default The Travis CI build passed
Details
@danielsdeleo danielsdeleo deleted the windows-batch-stubs branch Mar 4, 2014
@danielsdeleo
Member

I've decided to merge this now even though it's not 100% complete. We still have some work to do to get ChefDK building on windows, so we can't verify that this works correctly until that's done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment