lib/cocoapods-core/specification/set/statistics.rb
def github_stats_if_needed(set)
          update_date = get_value(set, :gh_date)
          return if update_date && update_date > (Time.now - cache_expiration)

          spec    = set.specification
          url     = spec.source[:git] || ''
          repo_id = url[/github.com\/([^\/\.]*\/[^\/\.]*)\.*/, 1]
          return unless repo_id

          begin
            repo = Octokit.repo(repo_id)
          rescue
            return
          end

          set_value(set, :gh_watchers, repo['watchers'])
          set_value(set, :gh_forks,    repo['forks'])
          set_value(set, :pushed_at,   repo['pushed_at'])
          set_value(set, :gh_date,     Time.now)
          save_cache
        end
# Retrieved the GitHub information from the API for the given set and
# stores it in the in-memory cache.
#
# @note   If there is a valid cache and it was generated withing the
#         expiration time frame this method does nothing.
#
# @param  [Set] set
#         the set for which the GitHub information is needed.
#
# @return [void]
#
Retrieved the GitHub information from the API for the given set and
stores it in the in-memory cache.
Retrieved the GitHub information from the API for the given set and stores it in the in - memory cache .
def github_stats_if_needed(set)
          update_date = get_value(set, :gh_date)
          return if update_date && update_date > (Time.now - cache_expiration)
          spec    = set.specification
          url     = spec.source[:git] || ''
          repo_id = url[/github.com\/([^\/\.]*\/[^\/\.]*)\.*/, 1]
          return unless repo_id
          begin
            repo = Octokit.repo(repo_id)
          rescue
            return
          end
          set_value(set, :gh_watchers, repo['watchers'])
          set_value(set, :gh_forks,    repo['forks'])
          set_value(set, :pushed_at,   repo['pushed_at'])
          set_value(set, :gh_date,     Time.now)
          save_cache
        end
def github_stats_if_needed ( set ) update_date = get_value ( set , :gh_date ) return if update_date && update_date > ( Time . now - cache_expiration ) spec = set . specification url = spec . source [ :git ] || '' repo_id = url [ / github.com \/ ([^ \/ \. ]* \/ [^ \/ \. ]*) \. * / , 1 ] return unless repo_id begin repo = Octokit . repo ( repo_id ) rescue return end set_value ( set , :gh_watchers , repo [ 'watchers' ] ) set_value ( set , :gh_forks , repo [ 'forks' ] ) set_value ( set , :pushed_at , repo [ 'pushed_at' ] ) set_value ( set , :gh_date , Time . now ) save_cache end
Retrieved the GitHub information from the API for the given set and
stores it in the in-memory cache.
Retrieved the GitHub information from the API for the given set and stores it in the in - memory cache .
None
void
set
set the set for which the GitHub information is needed.
set the set for which the GitHub information is needed .
note
If there is a valid cache and it was generated withing the expiration time frame this method does nothing.
If there is a valid cache and it was generated withing the expiration time frame this method does nothing .