Class: JRuby::Lint::Libraries::CExtensions
- Inherits:
-
Object
- Object
- JRuby::Lint::Libraries::CExtensions
- Defined in:
- lib/jruby/lint/libraries.rb
Instance Attribute Summary collapse
-
#gems ⇒ Object
readonly
Returns the value of attribute gems.
Instance Method Summary collapse
-
#initialize(cache) ⇒ CExtensions
constructor
A new instance of CExtensions.
- #load ⇒ Object
Constructor Details
#initialize(cache) ⇒ CExtensions
Returns a new instance of CExtensions.
69 70 71 |
# File 'lib/jruby/lint/libraries.rb', line 69 def initialize(cache) @cache = cache end |
Instance Attribute Details
#gems ⇒ Object (readonly)
Returns the value of attribute gems.
67 68 69 |
# File 'lib/jruby/lint/libraries.rb', line 67 def gems @gems end |
Instance Method Details
#load ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/jruby/lint/libraries.rb', line 73 def load @gems = {} content = @cache.fetch('C-Extension-Alternatives') doc = Nokogiri::HTML(content) doc.css('#wiki-body ul li').each do |li| key, = li.text.split(/[ -]+/, 2) @gems[key.downcase] = end rescue => e @error = "Unable to load C Extension alternatives list: #{e.}" end |