+ if (resource_classes == [Collection] and
+ @object.is_a? Group and
+ @object.group_class == 'project')
+ # In the common case where only collections are copied/moved
+ # into a project, it's polite to land on the collections tab on
+ # the destination project.
+ redirect_to project_url(@object.uuid, anchor: 'Data_collections')
+ else
+ # Otherwise just land on the default (Description) tab.
+ redirect_to @object
+ end
+ end
+
+ def arv_normalize mt, *opts
+ r = ""
+ env = Hash[ENV].
+ merge({'ARVADOS_API_HOST' =>
+ arvados_api_client.arvados_v1_base.
+ sub(/\/arvados\/v1/, '').
+ sub(/^https?:\/\//, ''),
+ 'ARVADOS_API_TOKEN' => 'x',
+ 'ARVADOS_API_HOST_INSECURE' =>
+ Rails.configuration.arvados_insecure_https ? 'true' : 'false'
+ })
+ IO.popen([env, 'arv-normalize'] + opts, 'w+b') do |io|
+ io.write mt
+ io.close_write
+ while buf = io.read(2**16)
+ r += buf
+ end
+ end
+ r