Created
July 3, 2014 10:02
-
-
Save kwatch/0066d83cc4992a7882b1 to your computer and use it in GitHub Desktop.
CDNJS: latest version of twitter-bootstrap is expected as 3.2.0, but got 3.1.1 with API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
## | |
## latest version of twitter-bootstrap is expected as 3.2.0 but got 3.1.1 with API. | |
## | |
require 'open-uri' | |
require 'json' | |
libname = 'twitter-bootstrap' | |
url = "http://api.cdnjs.com/libraries?search=#{libname}&fields=assets" | |
jstr = open(url) {|f| f.read } | |
jdata = JSON.parse(jstr) | |
jdata['results'].each do |entry| | |
puts "- name: #{entry['name']}" | |
puts " latest: #{entry['latest']}" | |
end | |
### result: | |
# | |
# $ ruby run-cdnjs.rb | |
# - name: twitter-bootstrap-wizard | |
# latest: http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap-wizard/1.0.0/js/bootstrap.min.js | |
# - name: twitter-bootstrap | |
# latest: http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/js/bootstrap.min.js | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment