Single version historical analysis

 @return [String] Human readable description of changes
767301
def story
      updates = changes
      return unless tell_story?(updates)

      [preface, (updates unless destroy?)].compact.join("\n")
    end
1315069
def versioned_changes
      modified_changes = {}
      raw_changes = self.changes.select {|k,_| versioned_attribute?(k)}.to_hash

      raw_changes.each do |key, (previous, current)|
        if reflection = self.class.reflect_on_association(key.to_sym)
          if reflection.collection?
            previous = previous.map(&:versioned_attributes)
            current  = current.map(&:versioned_attributes)
          else
            previous = previous ? previous.versioned_attributes : {}

            current  = if current && !current.marked_for_destruction?
              current.versioned_attributes
            else
              {}
            end
          end
        end

        # This really shouldn't need to be here,
        # but there is some confusion if we're destroying
        # an associated object in a save callback on the
        # parent object. We can't know that the callback
        # is going to destroy this object on save,
        # so we just have to add the association normally
        # and then filter it out here.
        if previous != current
          modified_changes[key] = [previous, current]
        end
      end

      modified_changes
    end
192486
def version
      logger.debug "Parsing version from output using #{description}"
      matches = output.match PARSE_VERSION_FROM_OUTPUT
      raise InvalidFormat.new output if matches.nil?
      matches.captures[0]
    end
1045277
def squash_old_versions
      specifiers = map_specifiers_to_versions

      compare_versions = lambda do |x, y|
        v_x = x =~ Lyp::PACKAGE_RE && Lyp.version($2)
        v_y = y =~ Lyp::PACKAGE_RE && Lyp.version($2)
        x <=> y
      end

      specifiers.each do |package, clauses|
        # Remove old versions only if the package is referenced using a single
        # specifier clause
        next unless clauses.size == 1

        specs = clauses.values.first
        specs.each do |s|
          if s.versions.values.uniq.size == 1
            versions = s.versions.keys.sort(&compare_versions)
            latest = versions.last
            s.versions.select! {|k, v| k == latest}
          end
        end
      end
    end
1019742
def version(self):
        
        return [x for x in self.session.query(models.Version).all()]
64316
def parse_version(output):
    
    for x in output.splitlines():
        match = VERSION_PATTERN.match(x)
        if match:
            return match.group('version').strip()
    return None
659624
def versions(runas=None):
    '''
    
    '''
    ret = _pyenv_exec('versions', '--bare', runas=runas)
    return [] if ret is False else ret.splitlines()
954393
def long_description():
    
    changes = latest_changes()
    changes[0] = "`Changes for v{}".format(changes[0][1:])
    changes[1] = '-' * len(changes[0])
    return "\n\n\n".join([
        read_file('README.rst'),
        '\n'.join(changes),
        "`Full changelog <https://{}.readthedocs.io/en/develop/changelog.html"
        "#changelog>`_.".format(PACKAGE_NAME),
    ])
1269794
def history(self):
        
        if self.changeset is None:
            raise NodeError('Unable to get changeset for this FileNode')
        return self.changeset.get_file_history(self.path)
657159
def parse
      rewind
      @changes = nil
      @buffer = []
      @release_log = []
      state = :gathering_current_history
      significance = nil
      each_line do |line|
        if state == :gathering_current_history
          case line
          when /^== ([0-9]+\.[0-9]+\.[0-9]+)(.*)/
            state = :gathering_previous_release_log
            @release_log << line
            @buffer << line
            @current_version = $1
            if $2 =~ %r{ (.*) - [0-9]{4}/[0-9]{2}/[0-9]{2}}
              @current_release_name = $1
            end
          when /^=== (.*)$/
            significance = significance_for $1
          when /^\* (.+)$/
            if significance
              changes[significance] << $1
            else
              raise ParseError.new "no significance preceeding history entry '#{$1}'"
            end
          when /^\s*$/, /^== In Git$/
            #noop
          else
            raise ParseError.new("invalid history format: #{line}")
          end
        elsif state == :gathering_previous_release_log
          if line =~ /^== ([0-9]+\.[0-9]+\.[0-9]+)(.*)/
            state = :gathering_remainder
          else
            @release_log << line
          end
          @buffer << line
        else
          @buffer << line
        end
      end
      @release_log = @release_log.join
      @parsed = true
    end
163122
def version
      logger.info "Determining Vagrant version for #{description}"
      output = execute!("--version").stdout
      Derelict::Parser::Version.new(output).version
    end
374663
def versions_for(gem)
      available = @versions_file.versions_for(gem.name)
      return [available.last] if gem.only_latest?

      versions = available.select do |v|
        gem.requirement.satisfied_by?(v[0])
      end

      versions = [available.last] if versions.empty?

      versions
    end
706073
def _grab_history(self):
        
        default_location = None
        config = self.setup_cfg.config
        if config and config.has_option('zest.releaser', 'history_file'):
            default_location = config.get('zest.releaser', 'history_file')
        history_file = self.vcs.history_file(location=default_location)
        if not history_file:
            logger.warn("No history file found")
            self.data['history_lines'] = None
            self.data['history_file'] = None
            return
        logger.debug("Checking %s", history_file)
        history_lines = open(history_file).read().split('\n')
        # ^^^ TODO: .readlines()?
        headings = utils.extract_headings_from_history(history_lines)
        if not len(headings):
            logger.error("No detectable version heading in the history "
                         "file %s", history_file)
            sys.exit()
        good_heading = self.data['history_header'] % self.data
        # ^^^ history_header is a string with %(abc)s replacements.
        line = headings[0]['line']
        previous = history_lines[line]
        history_lines[line] = good_heading
        logger.debug("Set heading from %r to %r.", previous, good_heading)
        history_lines[line + 1] = utils.fix_rst_heading(
            heading=good_heading,
            below=history_lines[line + 1])
        logger.debug("Set line below heading to %r",
                     history_lines[line + 1])
        self.data['history_lines'] = history_lines
        self.data['history_file'] = history_file
1357559
def updated(self):
        ''
        return dateutil.parser.parse(str(self.f.currentRevision.updated))
167978
def long_description():
    
    changes = latest_changes()
    changes[0] = "`Changes for v{}".format(changes[0][1:])
    changes[1] = '-' * len(changes[0])
    return "\n\n\n".join([
        read_file('README.rst'),
        '\n'.join(changes),
        "`Full changelog <{}/en/develop/changelog.html#changelog>`_.".format(
            DOCUMENTATION_URL)])
1152779
def branch(version = Origen.app.version.prefixed)
      version = VersionString.new(version)
      version = version.prefixed if version.semantic?
      capture = false
      File.readlines("#{Origen.root}/doc/history").each do |line|
        line = line.strip
        if capture
          if capture && line =~ /^#+ .*(Selector|Branch): '(.*)'/
            return Regexp.last_match(2).gsub('\\', '')
          end
        else
          if line =~ /Tag:/
            line = line.gsub('\\', '')
            if line =~ /^#+ Tag: #{version}$/ ||
               line =~ />Tag: #{version}</
              capture = true
            end
          end
        end
      end
      nil
    end
1002200
def updated(self):
        ''
        return dateutil.parser.parse(str(self.f.latestRevision.updated))