Class: Mundler::Config
- Inherits:
-
Object
- Object
- Mundler::Config
- Defined in:
- lib/mundler/config.rb
Instance Attribute Summary collapse
-
#mruby ⇒ Object
readonly
Returns the value of attribute mruby.
-
#platform_types ⇒ Object
readonly
Returns the value of attribute platform_types.
Instance Method Summary collapse
- #gemboxes ⇒ Object
- #gems ⇒ Object
- #hex ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #platforms ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/mundler/config.rb', line 3 def initialize @mruby = { url: "https://github.com/mruby/mruby", branch: "stable" } @platforms = [] @gemboxes = [] @gems = [] @platform_types = {} end |
Instance Attribute Details
#mruby ⇒ Object (readonly)
Returns the value of attribute mruby.
15 16 17 |
# File 'lib/mundler/config.rb', line 15 def mruby @mruby end |
#platform_types ⇒ Object (readonly)
Returns the value of attribute platform_types.
16 17 18 |
# File 'lib/mundler/config.rb', line 16 def platform_types @platform_types end |
Instance Method Details
#gemboxes ⇒ Object
22 23 24 |
# File 'lib/mundler/config.rb', line 22 def gemboxes @gemboxes.sort! end |
#gems ⇒ Object
26 27 28 |
# File 'lib/mundler/config.rb', line 26 def gems @gems.sort_by! { |platform| platform[:name] } end |
#hex ⇒ Object
18 19 20 |
# File 'lib/mundler/config.rb', line 18 def hex Digest::MD5.hexdigest(to_s) end |
#platforms ⇒ Object
30 31 32 |
# File 'lib/mundler/config.rb', line 30 def platforms @platforms.sort_by! { |platform| platform[:name] } end |
#to_s ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/mundler/config.rb', line 34 def to_s <<~HASHABLE #{mruby.inspect} #{platforms.inspect} #{platform_types.keys.sort.inspect} #{gemboxes.inspect} #{gems.inspect} HASHABLE end |