From a21ffcd5747d3abe8a552fd6462ee50b33044be5 Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Wed, 5 Aug 2020 00:16:03 -0600 Subject: [PATCH] runtime fixes --- fish/gender-swap | 4 ++-- text/gender-swap | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fish/gender-swap b/fish/gender-swap index 1855192..77786a1 100644 --- a/fish/gender-swap +++ b/fish/gender-swap @@ -1,7 +1,7 @@ #!/usr/bin/env fish -function gender-swap -d 'Swaps gender' - "$_agw_dir_rc"/text/gender-swap $args +function gender-swap -d 'Swaps gender' -a pro pre ali + "$_agw_dir_rc"/text/gender-swap $pro $pre $ali end ## EOF diff --git a/text/gender-swap b/text/gender-swap index 6c43a23..d81f048 100755 --- a/text/gender-swap +++ b/text/gender-swap @@ -13,11 +13,11 @@ require 'cgi' def url_params param, key, output = {} case when param.is_a?(Array) - param.map.with_index do |v, k| + param.each.with_index do |v, k| url_params(v, key + "[" + k.to_s + "]", output) end when param.is_a?(Hash) - param.map do |k, v| + param.each do |k, v| url_params(v, key + "[" + k.to_s + "]", output) end else @@ -30,9 +30,9 @@ CLIENT_KEY = ENV["_agw_secret_gender_swap_client_key"] CLIENT_SECRET = ENV["_agw_secret_gender_swap_client_secret"] ACCESS_TOKEN = ENV["_agw_secret_gender_swap_access_token"] -ALIGNMENT = ARGV.pop -PRESENTATION = ARGV.pop -PRONOUNS = ARGV.pop.split("/").map do |pro| +ALIGNMENT = ARGV[2] +PRESENTATION = ARGV[1] +PRONOUNS = ARGV[0].split("/").map do |pro| path = if pro == "they" then "they/.../themself" else pro end %(#{pro}) end