Sha256: 19c52ecbb700b01af722e3a9fe05550a9a9dc3e249e0496a15dbbd0b177c2dc1
Contents?: true
Size: 990 Bytes
Versions: 107
Compression:
Stored size: 990 Bytes
Contents
# desc 'Explaining what the task does' # task :avo do # # Task goes here # end desc "Installs Avo assets and bundles them for when you want to use the GitHub repo in your app" task "avo:build-assets" do spec = get_gem_spec "avo" # Uncomment to enable only when the source is github.com # enabled = spec.source.to_s.include?('https://github.com/avo-hq/avo') enabled = true if enabled puts "Starting avo:build-assets" path = spec.full_gem_path Dir.chdir(path) do system "yarn" system "yarn prod:build" end puts "Done" else puts "Not starting avo:build-assets" end end # From # https://stackoverflow.com/questions/9322078/programmatically-determine-gems-path-using-bundler def get_gem_spec(name) spec = Bundler.load.specs.find { |s| s.name == name } raise GemNotFound, "Could not find gem '#{name}' in the current bundle." unless spec if spec.name == "bundler" return File.expand_path("../../../", __FILE__) end spec end
Version data entries
107 entries across 107 versions & 1 rubygems