Class: Mundler::Config
- Inherits:
-
Object
- Object
- Mundler::Config
- Defined in:
- lib/mundler/config.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#libraries ⇒ Object
readonly
Returns the value of attribute libraries.
-
#library_types ⇒ Object
readonly
Returns the value of attribute library_types.
-
#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 14 15 16 |
# File 'lib/mundler/config.rb', line 3 def initialize @mruby = { url: "https://github.com/mruby/mruby", branch: "stable" } @platforms = [] @gemboxes = [] @gems = [] @platform_types = {} @library_types = {} @env = {} @libraries = {} end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
22 23 24 |
# File 'lib/mundler/config.rb', line 22 def env @env end |
#libraries ⇒ Object (readonly)
Returns the value of attribute libraries.
21 22 23 |
# File 'lib/mundler/config.rb', line 21 def libraries @libraries end |
#library_types ⇒ Object (readonly)
Returns the value of attribute library_types.
20 21 22 |
# File 'lib/mundler/config.rb', line 20 def library_types @library_types end |
#mruby ⇒ Object (readonly)
Returns the value of attribute mruby.
18 19 20 |
# File 'lib/mundler/config.rb', line 18 def mruby @mruby end |
#platform_types ⇒ Object (readonly)
Returns the value of attribute platform_types.
19 20 21 |
# File 'lib/mundler/config.rb', line 19 def platform_types @platform_types end |
Instance Method Details
#gemboxes ⇒ Object
28 29 30 |
# File 'lib/mundler/config.rb', line 28 def gemboxes @gemboxes.sort! end |
#gems ⇒ Object
32 33 34 |
# File 'lib/mundler/config.rb', line 32 def gems @gems.sort_by! { |platform| platform[:name] } end |
#hex ⇒ Object
24 25 26 |
# File 'lib/mundler/config.rb', line 24 def hex Digest::MD5.hexdigest(to_s) end |
#platforms ⇒ Object
36 37 38 |
# File 'lib/mundler/config.rb', line 36 def platforms @platforms.sort_by! { |platform| platform[:name] } end |
#to_s ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mundler/config.rb', line 40 def to_s <<~HASHABLE #{mruby.inspect} #{platforms.inspect} #{platform_types.keys.sort.inspect} #{library_types.keys.sort.inspect} #{hashable_string_for_hash(env)} #{gemboxes.inspect} #{gems.inspect} #{hashable_string_for_hash(libraries)} HASHABLE end |