From eb513d9a58beb7efea5993d489c940675de075de Mon Sep 17 00:00:00 2001 From: Charles Greene Date: Mon, 12 Feb 2018 11:32:40 -0400 Subject: [PATCH] add dev plugin option --- Gemfile | 2 ++ Gemfile.lock | 8 ++++---- lib/roku_builder.rb | 17 +++++++++++++++++ lib/roku_builder/version.rb | 2 +- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index ad81d4a..5cba35f 100644 --- a/Gemfile +++ b/Gemfile @@ -4,3 +4,5 @@ source 'https://rubygems.org' # Specify your gem's dependencies in roku_builder.gemspec gemspec + +# During developemnt you will need to add any gems here that plugins require diff --git a/Gemfile.lock b/Gemfile.lock index 26f5c5a..1673898 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - roku_builder (4.5.1) + roku_builder (4.5.2) faraday (~> 0.13) faraday-digestauth (~> 0.2) git (~> 1.3) @@ -17,7 +17,7 @@ GEM addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) ansi (1.5.0) - ast (2.3.0) + ast (2.4.0) byebug (9.1.0) coderay (1.1.2) coveralls (0.8.21) @@ -29,7 +29,7 @@ GEM crack (0.4.3) safe_yaml (~> 1.0.0) docile (1.1.5) - faraday (0.13.1) + faraday (0.14.0) multipart-post (>= 1.2, < 3) faraday-digestauth (0.2.1) faraday (~> 0.7) @@ -78,7 +78,7 @@ GEM notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) - oga (2.12) + oga (2.14) ast ruby-ll (~> 2.1) pry (0.11.3) diff --git a/lib/roku_builder.rb b/lib/roku_builder.rb index 21b5b25..4ccac5d 100644 --- a/lib/roku_builder.rb +++ b/lib/roku_builder.rb @@ -98,6 +98,23 @@ def self.load_plugins end end end + load_dev_plugin + end + + def self.load_dev_plugin + dev_path = nil + ARGV.each_index do |i| + if ARGV[i] == "--dev-plugin" + dev_path = ARGV[i+1] + 2.times {ARGV.delete_at(i)} + break + end + end + if dev_path + Dir.glob(File.join(dev_path, "lib", "roku_builder", "plugins", "*")).each do |path| + require path + end + end end def self.process_plugins diff --git a/lib/roku_builder/version.rb b/lib/roku_builder/version.rb index baca842..b797bbe 100644 --- a/lib/roku_builder/version.rb +++ b/lib/roku_builder/version.rb @@ -2,5 +2,5 @@ module RokuBuilder # Version of the RokuBuilder Gem - VERSION = "4.5.1" + VERSION = "4.5.2" end