lib/eco-rake/lib/people/sync_rely.rb in eco-rake-0.2.6 vs lib/eco-rake/lib/people/sync_rely.rb in eco-rake-0.2.7

- old
+ new

@@ -15,10 +15,11 @@ }.freeze option_forwarding(**FORWARD_RULES) attr_const :target_task + attr_const :target_namespace def task(*_args) sh_continue rake_sync_command end @@ -38,13 +39,17 @@ def base_command(task_name = namespaced_task) string_cmd('rake', task_name) end def namespaced_task(task_name = target_task) - ns = self.class.namespace || '' - ns_with_enviro = ns.split(':').any? {|s| s == options[:enviro]} - ns = "#{ns}:#{options[:enviro]}" unless ns_with_enviro - "#{ns}:#{task_name || self.class.task}" + ns = target_namespace + unless ns + ns = self.class.namespace || '' + ns_with_enviro = ns.split(':').any? {|s| s == options[:enviro]} + ns = [ns, options[:enviro]].compact.join(':') unless ns_with_enviro + end + + [ns, task_name || self.class.task].compact.join(':') end end end end end