runtime fixes
parent
ca775aff0d
commit
a21ffcd574
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env fish
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
function gender-swap -d 'Swaps gender'
|
function gender-swap -d 'Swaps gender' -a pro pre ali
|
||||||
"$_agw_dir_rc"/text/gender-swap $args
|
"$_agw_dir_rc"/text/gender-swap $pro $pre $ali
|
||||||
end
|
end
|
||||||
|
|
||||||
## EOF
|
## EOF
|
||||||
|
|
|
@ -13,11 +13,11 @@ require 'cgi'
|
||||||
def url_params param, key, output = {}
|
def url_params param, key, output = {}
|
||||||
case
|
case
|
||||||
when param.is_a?(Array)
|
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)
|
url_params(v, key + "[" + k.to_s + "]", output)
|
||||||
end
|
end
|
||||||
when param.is_a?(Hash)
|
when param.is_a?(Hash)
|
||||||
param.map do |k, v|
|
param.each do |k, v|
|
||||||
url_params(v, key + "[" + k.to_s + "]", output)
|
url_params(v, key + "[" + k.to_s + "]", output)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -30,9 +30,9 @@ CLIENT_KEY = ENV["_agw_secret_gender_swap_client_key"]
|
||||||
CLIENT_SECRET = ENV["_agw_secret_gender_swap_client_secret"]
|
CLIENT_SECRET = ENV["_agw_secret_gender_swap_client_secret"]
|
||||||
ACCESS_TOKEN = ENV["_agw_secret_gender_swap_access_token"]
|
ACCESS_TOKEN = ENV["_agw_secret_gender_swap_access_token"]
|
||||||
|
|
||||||
ALIGNMENT = ARGV.pop
|
ALIGNMENT = ARGV[2]
|
||||||
PRESENTATION = ARGV.pop
|
PRESENTATION = ARGV[1]
|
||||||
PRONOUNS = ARGV.pop.split("/").map do |pro|
|
PRONOUNS = ARGV[0].split("/").map do |pro|
|
||||||
path = if pro == "they" then "they/.../themself" else pro end
|
path = if pro == "they" then "they/.../themself" else pro end
|
||||||
%(<a href="http://pronoun.is/#{path}">#{pro}</a>)
|
%(<a href="http://pronoun.is/#{path}">#{pro}</a>)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue