Determines the file path of the ruby code defining the subscription.
 It's important that this is called from within the initializer to get the
 desired effect.
542693
def _determine_path
      path = File.expand_path('../..', __FILE__)

      # Will be something like:
      # "/path/to/file.rb:47:in `method_name'"
      non_announcer_caller = caller.find { |c| !c.start_with?(path) }

      unless non_announcer_caller
        # This is not expected to occur.
        raise Errors::SubscriptionError, "Could not find non-Announcer caller"
      end

      non_announcer_caller
    end
1132427
def get_file_path(filename, local=True, relative_to_module=None, my_dir=my_dir):
    
    # override my_dir if module is provided
    if relative_to_module is not None:
        my_dir = os.path.dirname(relative_to_module.__file__)
    user_path = result = filename
    if local:
        user_path = os.path.expanduser(filename)
        result = os.path.abspath(user_path)
        if os.path.exists(result):
            return result  # The file was found normally
    # otherwise look relative to the module.
    result = os.path.join(my_dir, filename)
    assert os.path.exists(result), "no such file " + repr((filename, result, user_path))
    return result
904118
def define
      lib_path = @libs.join(File::PATH_SEPARATOR)
      actual_name = Hash === name ? name.keys.first : name
      unless Rake.application.last_comment
        desc "Analyze code coverage with tests" + 
          (@name==:rcov ? "" : " for #{actual_name}")
      end
      task @name do
        run_code = ''
        RakeFileUtils.verbose(@verbose) do
          run_code =
          case rcov_path
          when nil, ''
            "-S rcov"
          else %!"#{rcov_path}"!
          end
          ruby_opts = @ruby_opts.clone
          ruby_opts.push( "-I#{lib_path}" )
          ruby_opts.push run_code
          ruby_opts.push( "-w" ) if @warning
          ruby ruby_opts.join(" ") + " " + option_list +
          %[ -o "#{@output_dir}" ] +
          file_list.collect { |fn| %["#{fn}"] }.join(' ')
        end
      end

      desc "Remove rcov products for #{actual_name}"
      task paste("clobber_", actual_name) do
        rm_r @output_dir rescue nil
      end

      clobber_task = paste("clobber_", actual_name)
      task :clobber => [clobber_task]

      task actual_name => clobber_task
      self
    end
600392
def root_path
      return @root_path if defined?(@root_path)

      root_finder = lambda do |path|
        # Note: To remain compatible with Ruby 1.8, we have to use
        # a `find` here instead of an `each`.
        vf = find_vagrantfile(path, @vagrantfile_name)
        return path if vf
        return nil if path.root? || !File.exist?(path)
        root_finder.call(path.parent)
      end

      @root_path = root_finder.call(cwd)
    end
574915
def find_script(sub_path)
      paths = @script_dirs.map { |dir| File.join(dir,sub_path) }

      return script_paths.first(:path => paths)
    end
629318
def path_exists?(path = @path)
      path = path.split(' ') if path.is_a?(String) && path.include?(' ')
      if path.is_a?(Array)
        path.each do |p|
          unless File.exist?(p)
            puts "#{p} does not exist"
            return false
          end
        end
      else
        path = path.gsub('/**', '').gsub('/*', '').gsub(/\/\.*/, '') if path.include?('*')
        if File.exist?(path)
          return true
        else
          puts "#{path} does not exist"
          return false
        end
      end
    end
300080
def choose_path():
    
    dirs = webview.create_file_dialog(webview.FOLDER_DIALOG)
    if dirs and len(dirs) > 0:
        directory = dirs[0]
        if isinstance(directory, bytes):
            directory = directory.decode("utf-8")

        response = {"status": "ok", "directory": directory}
    else:
        response = {"status": "cancel"}

    return jsonify(response)
463119
def ruby_relative_path
      ruby_pathname = Pathname.new(ruby)
      bindir_pathname = Pathname.new(target_bin_dir)
      ruby_pathname.relative_path_from(bindir_pathname).to_s
    end
1135134
def path(self):
        """"""
        if (self.source_file.startswith('a/') and
                self.target_file.startswith('b/')):
            filepath = self.source_file[2:]
        elif (self.source_file.startswith('a/') and
              self.target_file == '/dev/null'):
            filepath = self.source_file[2:]
        elif (self.target_file.startswith('b/') and
              self.source_file == '/dev/null'):
            filepath = self.target_file[2:]
        else:
            filepath = self.source_file
        return filepath
251535
def code_browse path
      dr = ruby_renderer
      view(path, :close_key => 'q', :title => $0) do |t|
        t.renderer  dr
        t.bind_key([?\\,?\\,?o],'choose file') { 
          str = choose_file "**/*"
          if str and str != ""
            t.add_content str
            t.buffer_last
          else
            alert "nothing chosen"
          end
        }
      end
  end
834828
def subscription_path_for(subscription, params = {})
      options = params.dup
      options.delete(:devise_default_routes) ?
        send("#{routing_scope(options)}subscription_path", subscription, options) :
        send("#{routing_scope(options)}#{subscription.target.to_resource_name}_subscription_path", subscription.target, subscription, options)
    end
375745
def command_file_paths
      abstract_file = File.join(File.dirname(__FILE__), 'command', 'abstract_command.rb')
      Dir[File.join(File.dirname(__FILE__), 'command', '*.rb')] - [abstract_file]
    end
918946
def path(self, which=None):
        
        if which in ('refresh',):
            return '{0}/{1}'.format(
                super(SmartProxy, self).path(which='self'),
                which
            )
        return super(SmartProxy, self).path(which)
1367551
def extract_path(file_path)
      return nil if file_path.nil?
      last_slash = file_path.rindex("/")
      if last_slash
        file_path[0, last_slash]
      end
    end
162440
def _file_path(self, container: Container, fn: str) -> str:
        
        fn = self.resolve(container, fn)
        assert fn[0] == '/'
        fn = fn[1:]
        path = "files/{}/{}".format(container.uid, fn)
        return path
456677
def document path
      rake_yard(store)
      docs = []
      docs.push code_object_at(path) unless code_object_at(path).nil?
      docs
    end
1110661
private String getStoredBundlePath(String bundleName, boolean asGzippedBundle) {
		String tempFileName;

		if (asGzippedBundle)
			tempFileName = gzipDirPath;
		else
			tempFileName = textDirPath;

		return getStoredBundlePath(tempFileName, bundleName);
	}