diff --git a/lib/docker/container.rb b/lib/docker/container.rb index aaf2c98a8..6774578b1 100644 --- a/lib/docker/container.rb +++ b/lib/docker/container.rb @@ -132,7 +132,7 @@ def commit(options = {}) # Based on the link, the config passed as run, needs to be passed as the # body of the post so capture it, remove from the options, and pass it via # the post body - config = options.delete('run') + config = options.delete('run') || options.delete(:run) hash = Docker::Util.parse_json(connection.post('/commit', options, :body => config.to_json)) @@ -163,7 +163,7 @@ def rename(new_name) end def streaming_logs(opts = {}, &block) - stack_size = opts.delete('stack_size') || -1 + stack_size = opts.delete('stack_size') || opts.delete(:stack_size) || -1 tty = opts.delete('tty') || opts.delete(:tty) || false msgs = Docker::MessagesStack.new(stack_size) excon_params = {response_block: Docker::Util.attach_for(block, msgs, tty)} @@ -196,7 +196,7 @@ def kill!(opts = {}) # but rescue from ServerErrors. [:stop, :restart].each do |method| define_method(:"#{method}!") do |opts = {}| - timeout = opts.delete('timeout') + timeout = opts.delete('timeout') || opts.delete(:timeout) query = {} query['t'] = timeout if timeout connection.post(path_for(method), query, :body => opts.to_json) @@ -271,7 +271,7 @@ def archive_in_stream(output_path, opts = {}, &block) # Create a new Container. def self.create(opts = {}, conn = Docker.connection) - name = opts.delete('name') + name = opts.delete('name') || opts.delete(:name) query = {} query['name'] = name if name resp = conn.post('/containers/create', query, :body => opts.to_json) diff --git a/lib/docker/image.rb b/lib/docker/image.rb index 3112ef747..3d4bece58 100644 --- a/lib/docker/image.rb +++ b/lib/docker/image.rb @@ -49,8 +49,8 @@ def tag(opts = {}) # Given a path of a local file and the path it should be inserted, creates # a new Image that has that file. def insert_local(opts = {}) - local_paths = opts.delete('localPath') - output_path = opts.delete('outputPath') + local_paths = opts.delete('localPath') || opts.delete(:localPath) + output_path = opts.delete('outputPath') || opts.delete(:outputPath) local_paths = [ local_paths ] unless local_paths.is_a?(Array)