Class: Lono::Jade::Materializer::Source
- Inherits:
-
Object
- Object
- Lono::Jade::Materializer::Source
- Defined in:
- lib/lono/jade/materializer/source.rb
Instance Method Summary collapse
-
#gem_args(jade) ⇒ Object
String provide to gem method in Gemfile.
-
#initialize(lono_settings = nil) ⇒ Source
constructor
A new instance of Source.
- #location ⇒ Object
- #options(jade) ⇒ Object
- #settings ⇒ Object
Constructor Details
Instance Method Details
#gem_args(jade) ⇒ Object
String provide to gem method in Gemfile. Example:
gem "mygem", "v0.1.0", git: "xxx"
11 12 13 14 15 16 17 18 19 |
# File 'lib/lono/jade/materializer/source.rb', line 11 def gem_args(jade) args = jade.registry.args args = args.map { |s| %Q|"#{s}"| }.join(', ') = (jade) = .inject([]) { |r,(k,v)| r << %Q|#{k}: "#{v}"| }.join(', ') "#{args}, #{}" end |
#location ⇒ Object
43 44 45 46 47 48 |
# File 'lib/lono/jade/materializer/source.rb', line 43 def location ENV["LONO_MATERIALIZED_GEMS_SOURCE"] || Lono::Configset::Register::Blueprint.source || settings["source"] || "[email protected]:boltopspro" # default_location end |
#options(jade) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/lono/jade/materializer/source.rb', line 21 def (jade) registry = jade.registry = registry. # Direct source provided as part of configset call # # configset("ssm", git: "https://github.com/owner/ssm") # configset("ssm", path: "/path/to/ssm") # configset("ssm", source: "https://rubygems.org") # if .key?(:git) || .key?(:path) || .key?(:source) return() end # Otherwise use the sources location settings, which does not include the repo name = if location.include?("git@") || location.include?("https") {git: "#{location}/#{jade.repo}"} else {path: "#{location}/#{jade.repo}"} end .merge() end |
#settings ⇒ Object
50 51 52 |
# File 'lib/lono/jade/materializer/source.rb', line 50 def settings @lono_settings.dig("materialized_gems") || {} end |