fanforce-app-factory 2.0.0.rc11 → 2.0.0.rc12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb5c3701b65cbf8ad679c5b9f0bdf8d0c3c14ee0
4
- data.tar.gz: b0d1f5431908531f3bf2d25c8e6f95a86ec96d3a
3
+ metadata.gz: a8a880676aa8a792835bac8e5b9c97e435b765ca
4
+ data.tar.gz: c5ac34edeff20804b81b568e9bca7be08ed5c265
5
5
  SHA512:
6
- metadata.gz: 7ed129d6a46f3a9a6f9f4316b58ebc4f4e40114b1ca59d29ef65f2447a4668972f84185389c8595f47238fc52be2b51d841c91ab7b1d052f571e48b8d51d7efe
7
- data.tar.gz: 5cd3fe614c3b2e2f5450a650a90782f3d5402a4374ad4e58122c2cb293d22cdfe0348fb3cf86a5ed1ffa4336379b5f3a97bb4a560f3bfc90a0bc5641f5507cb9
6
+ metadata.gz: caa56a66d1e81d33a0794f58ab92ad75074ebbe4466daaaa55c74ded3b8f6b1d26429b339223c6648585e79b061b3e7ee1b739f4d96618dcbb723b60ecdf54a9
7
+ data.tar.gz: be47bf5322d31854d63d1c1f0a7995c3bd4524f8c23b0cf705707f1f5bd71b0c3da0b49b6135de27aae85c474cb5377f14e296842a8579772ca59faf207c6133
@@ -9,7 +9,7 @@ class Fanforce::AppFactory::CLI::Iron
9
9
  @app = app
10
10
  end
11
11
 
12
- def upload(environment)
12
+ def upload(environment, worker_filename=nil)
13
13
  if !File.directory?("#{app.dir}/workers")
14
14
  return log "#{'Skipped '.format(:bold)} no workers folder was found"
15
15
  end
@@ -30,6 +30,7 @@ class Fanforce::AppFactory::CLI::Iron
30
30
  upload_processes = []
31
31
  FileUtils.cp("#{app.dir}/workers/.env/#{environment}.rb", "#{app.dir}/workers/.env/.#{environment}env.rb")
32
32
  workers.each do |filename|
33
+ next if worker_filename and !filename.include?(worker_filename)
33
34
  code_name = filename.gsub('.worker', '')
34
35
 
35
36
  puts "#{'Uploading'.format(:green,:bold)} #{filename.gsub('.worker', '')} to #{environment.to_s.titleize}..."
@@ -15,7 +15,7 @@ class Fanforce::AppFactory::CLI::Scripts
15
15
  confirm("\nYou are about to push iron works for #{Fanforce::CLI::Apps.total_count} apps in this directory.\n"+
16
16
  'ARE YOU SURE?', true)
17
17
  Fanforce::CLI::Apps.each do |app, processed_count, total_count|
18
- log divider '+-------------------------------------------------------------------------------------------------'
18
+ log divider '+-----------------------------------------------------------------------------------------------'
19
19
  log "#{'APP'.format(:bold)} - #{app._id.upcase.gsub('-',' ').format(:bold)} (#{processed_count} of #{total_count})... "
20
20
  push_app_workers(app, environment)
21
21
  end
@@ -24,11 +24,21 @@ class Fanforce::AppFactory::CLI::Scripts
24
24
  app = Fanforce::CLI::App.load(Fanforce::CLI::DIR)
25
25
  push_app_workers(app, environment)
26
26
  end
27
+ elsif command.to_s.include?('.worker')
28
+ log divider '+---------------------------------------------------------------------------------------------------'
29
+ app = Fanforce::CLI::App.load(Fanforce::CLI::DIR)
30
+ push_app_worker(app, environment, command.to_s)
27
31
  end
28
32
 
29
33
  log divider '----------------------------------------------------------------------------------------------------++'
30
34
  end
31
35
 
36
+ def push_app_worker(app, environment, filename)
37
+ Dir.chdir(app.dir) do
38
+ Fanforce::AppFactory::CLI::Iron.new(app).upload(environment, filename)
39
+ end
40
+ end
41
+
32
42
  def push_app_workers(app, environment)
33
43
  Dir.chdir(app.dir) do
34
44
  Fanforce::AppFactory::CLI::Iron.new(app).upload(environment)
@@ -33,10 +33,11 @@ class Fanforce::AppFactory::CLI::Scripts
33
33
  ########################################################################################################################
34
34
 
35
35
  Fanforce::CLI.register(self, :push,
36
- ['RACK_ENV all/TYPE', 'Push everything to the selected environment'],
37
- # ['RACK_ENV env', 'Setup the correct ENV variables in selected environment'],
38
- # ['RACK_ENV heroku', 'Create heroku app (if needed) and push latest commit'],
39
- ['RACK_ENV iron', 'Upload iron workers to selected environment']
36
+ ['RACK_ENV all/TYPE', 'Push everything to the selected environment'],
37
+ # ['RACK_ENV env', 'Setup the correct ENV variables in selected environment'],
38
+ # ['RACK_ENV heroku', 'Create heroku app (if needed) and push latest commit'],
39
+ ['RACK_ENV iron', 'Upload iron workers to selected environment'],
40
+ ['RACK_ENV FILENAME.worker', 'Upload single iron worker to selected environment']
40
41
  ) { require_relative 'cli/scripts/push' }
41
42
 
42
43
  ########################################################################################################################
@@ -4,5 +4,6 @@ class Fanforce::AppFactory
4
4
  def self.base_dir
5
5
  @@base_dir ||= File.expand_path '../../app_factory', __FILE__
6
6
  end
7
+ end
7
8
 
8
- end
9
+ class Fanforce::App; end
@@ -1,5 +1,5 @@
1
1
  class Fanforce
2
2
  class AppFactory
3
- VERSION = '2.0.0.rc11'
3
+ VERSION = '2.0.0.rc12'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce-app-factory
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc11
4
+ version: 2.0.0.rc12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Clark