fanforce-app-factory 2.0.0.rc8 → 2.0.0.rc9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57f9b35c4d0c163bc6c2d1944b48e669629b5e6a
4
- data.tar.gz: bddfb50786585ecb0e5f3363950c6c72637c520a
3
+ metadata.gz: cdaf9a89fc2c57ac7a93bc0a44c9d434ee2c4a53
4
+ data.tar.gz: 450afcc003c3c51985a9498638d20098f60b52a9
5
5
  SHA512:
6
- metadata.gz: 602d15c72477cce9a44fc75d84164a2ae6f32d679955610c54ffeba8298b3966ad5e74aeea8233641de77763c59a65986ae9e97fa7f346ccef4b6277101b27b6
7
- data.tar.gz: 36fd469c61be260c84320dabc0b05b7d944252de3387323bba5783d96155986e34f5a02e63ccfb3d02d0b9469e2bed6de98855bfd9822549c60051c0adfa0479
6
+ metadata.gz: 3255bf8df675f27ac7945695d7b66fc040df6ab3f284b8612f9af8c61a28140e8a68f4b3de99f144fe11652f23c5f20c039faaa09f933cb6ff6b2c0da803f343
7
+ data.tar.gz: 0745b3ac73a6960e69b304d17385b5005bba9f163adee1e71ddd9909381f6e7276ac6a419d9676b1eb1d9b6c7546779151ec2934985d1209212ac0d78ef27e30
data/Rakefile CHANGED
@@ -23,7 +23,7 @@ namespace :scaffolding do
23
23
  end
24
24
 
25
25
  require 'fanforce/app_factory/cli'
26
- require 'fanforce/app_factory/cli/scaffolding_file'
26
+ require 'fanforce/app_factory/cli/lib/scaffolding_file'
27
27
 
28
28
  task :register do
29
29
  scaffolding_dir = File.expand_path('../lib/fanforce/app_factory/scaffolding', __FILE__)
@@ -39,5 +39,5 @@ Gem::Specification.new do |gem|
39
39
 
40
40
  gem.add_runtime_dependency 'fanforce-base', '~> 1.2'
41
41
  gem.add_runtime_dependency 'fanforce-api', '~> 1.0'
42
- gem.add_runtime_dependency 'fanforce-app-worker', '= 1.1.0.rc1'
42
+ gem.add_runtime_dependency 'fanforce-app-worker', '= 1.1.0.rc2'
43
43
  end
@@ -1,5 +1,5 @@
1
1
  require_relative 'version'
2
2
 
3
3
  module Fanforce::AppFactory::CLI
4
- require_relative 'cli/utils'
4
+ require_relative 'cli/lib/utils'
5
5
  end
File without changes
File without changes
File without changes
@@ -1,13 +1,13 @@
1
1
  class Fanforce::AppFactory::CLI::Scripts
2
2
  include Fanforce::AppFactory::CLI::Utils
3
3
 
4
- require_relative '../scaffolding'
5
- require_relative '../bundler'
6
- require_relative '../pow'
7
- require_relative '../git'
8
- require_relative '../bitbucket'
9
- require_relative '../env'
10
- require_relative '../uranium'
4
+ require_relative '../lib/scaffolding'
5
+ require_relative '../lib/bundler'
6
+ require_relative '../lib/pow'
7
+ require_relative '../lib/git'
8
+ require_relative '../lib/bitbucket'
9
+ require_relative '../lib/env'
10
+ require_relative '../lib/uranium'
11
11
 
12
12
  ######################################################################################################################
13
13
 
@@ -1,9 +1,9 @@
1
1
  class Fanforce::AppFactory::CLI::Scripts
2
2
  include Fanforce::AppFactory::CLI::Utils
3
3
 
4
- require_relative '../bitbucket'
5
- require_relative '../uranium'
6
- require_relative '../pow'
4
+ require_relative '../lib/bitbucket'
5
+ require_relative '../lib/uranium'
6
+ require_relative '../lib/pow'
7
7
 
8
8
  ######################################################################################################################
9
9
 
@@ -1,8 +1,8 @@
1
1
  class Fanforce::AppFactory::CLI::Scripts
2
2
  include Fanforce::AppFactory::CLI::Utils
3
3
 
4
- require_relative '../env'
5
- require_relative '../iron'
4
+ require_relative '../lib/env'
5
+ require_relative '../lib/iron'
6
6
 
7
7
  ######################################################################################################################
8
8
 
@@ -5,36 +5,37 @@ class Fanforce::AppFactory::CLI::Scripts
5
5
 
6
6
  def restart(environment=:development)
7
7
  environment = environment.to_sym
8
- app = Fanforce::CLI::App.load(Fanforce::CLI::DIR)
9
- puts "---------------------------------------------------------------------------------------------------------------"
10
- Dir.chdir(app.dir) do
11
- if [:all, :development].include?(environment)
12
- puts "#{'Restarted'.format(:bold,:green)} #{app.dir_name} (development)" if restart_app(app, :development)
13
- end
14
- if [:all, :staging].include?(environment)
15
- puts "#{'Restarted'.format(:bold,:green)} #{app.dir_name} (staging)" if restart_app(app, :staging)
16
- end
17
- if [:all, :production].include?(environment)
18
- puts "#{'Restarted'.format(:bold,:green)} #{app.dir_name} (production)" if restart_app(app, :production)
8
+
9
+ if Fanforce::CLI::TYPE == :directory_of_apps
10
+ Fanforce::CLI::Apps.each do |app, current_count, total|
11
+ restart_app(app, environment)
19
12
  end
13
+ else
14
+ restart_app(Fanforce::CLI::App.load(Fanforce::CLI::DIR), environment)
20
15
  end
21
- puts ''
16
+ log divider '----------------------------------------------------------------------------------------------------++'
22
17
  end
23
18
 
24
19
  def restart_app(app, environment)
25
- if environment == :development
26
- File.mkdir("#{app.dir}/tmp") if !File.directory?("#{app.dir}/tmp")
27
- FileUtils.touch("#{app.dir}/tmp/restart.txt")
28
- elsif [:production, :staging].include?(environment)
29
- error 'Production and Staging are not working'
30
- if config[:heroku].blank? or config[:heroku][environment].blank?
31
- puts "#{'OOPS...'.format(:red,:bold)} #{environment} has not been setup on heroku"
32
- return false
20
+ log divider '------------------------------------------------------------------------------------------------------'
21
+ environments = environment==:all ? [:development,:staging,:production] : [environment]
22
+ Dir.chdir(app.dir) do
23
+ environments.each do |environment|
24
+ if environment == :development
25
+ FileUtils.mkdir("#{app.dir}/tmp") if !File.directory?("#{app.dir}/tmp")
26
+ FileUtils.touch("#{app.dir}/tmp/restart.txt")
27
+ elsif [:production, :staging].include?(environment)
28
+ error 'Production and Staging are not working'
29
+ if config[:heroku].blank? or config[:heroku][environment].blank?
30
+ puts "#{'OOPS...'.format(:red,:bold)} #{environment} has not been setup on heroku"
31
+ next
32
+ end
33
+ heroku = auth_heroku(environment)
34
+ heroku.post_ps_restart get_heroku_app_name(app, environment)
35
+ end
36
+ log "#{"Restarted #{environment}".format(:bold,:green)} #{app.dir_name}"
33
37
  end
34
- heroku = auth_heroku(environment)
35
- heroku.post_ps_restart get_heroku_app_name(app, environment)
36
38
  end
37
- return true
38
39
  end
39
40
 
40
41
  end
@@ -1,12 +1,12 @@
1
1
  class Fanforce::AppFactory::CLI::Scripts
2
2
  include Fanforce::AppFactory::CLI::Utils
3
3
 
4
- require_relative '../bundler'
5
- require_relative '../pow'
6
- require_relative '../git'
7
- require_relative '../bitbucket'
8
- require_relative '../env'
9
- require_relative '../uranium'
4
+ require_relative '../lib/bundler'
5
+ require_relative '../lib/pow'
6
+ require_relative '../lib/git'
7
+ require_relative '../lib/bitbucket'
8
+ require_relative '../lib/env'
9
+ require_relative '../lib/uranium'
10
10
 
11
11
  ######################################################################################################################
12
12
 
@@ -1,8 +1,8 @@
1
1
  class Fanforce::AppFactory::CLI::Scripts
2
2
  include Fanforce::AppFactory::CLI::Utils
3
3
 
4
- require_relative '../git'
5
- require_relative '../scaffolding'
4
+ require_relative '../lib/git'
5
+ require_relative '../lib/scaffolding'
6
6
 
7
7
  ######################################################################################################################
8
8
 
@@ -12,40 +12,27 @@ class Fanforce::AppFactory::CLI::Scripts
12
12
 
13
13
  if [:all,:files].include?(type)
14
14
  if Fanforce::CLI::TYPE == :directory_of_apps
15
- files_overview
15
+ if detail_level == :diff
16
+ directory_file_details(detail_level)
17
+ else
18
+ directory_file_overview
19
+ end
16
20
  elsif Fanforce::CLI::TYPE == :single_app
17
21
  app = Fanforce::CLI::App.load(Fanforce::CLI::DIR)
18
- files_details(app, detail_level)
22
+ app_file_details(app, detail_level)
19
23
  end
20
24
  end
21
25
 
22
26
  if [:all,:git].include?(type)
23
27
  if Fanforce::CLI::TYPE == :directory_of_apps
24
- status_git_overview
28
+ git_overview
25
29
  elsif Fanforce::CLI::TYPE == :single_app
26
- status_git
30
+ git_details
27
31
  end
28
32
  end
29
-
30
- end
31
-
32
- def status_git_overview
33
- app_column_width = Fanforce::CLI::Apps.dir_names.inject(0){|l,d| d.length>l ? d.length : l}
34
- log Fanforce::AppFactory::CLI::Git.status_table_header(app_column_width)
35
- log divider '======================================================================================================'
36
- Fanforce::CLI::Apps.each do |app, current_count, total|
37
- log Fanforce::AppFactory::CLI::Git.new(app).status_row(app_column_width)
38
- log divider '---------------------------------------------------------------------------------------------------+'
39
- end
40
- log ''
41
33
  end
42
34
 
43
- def status_git
44
- exec 'git status'
45
- log ''
46
- end
47
-
48
- def files_overview
35
+ def directory_file_overview
49
36
  log ''
50
37
  log sprintf('%-12s %-50s %85s', 'FILE STATUS', 'APP NAME', 'STATS OVERVIEW').format(:bold)
51
38
  log divider '======================================================================================================'
@@ -87,21 +74,54 @@ class Fanforce::AppFactory::CLI::Scripts
87
74
  puts ''
88
75
  end
89
76
 
90
- def files_details(app, detail_level)
77
+ def directory_file_details(detail_level)
78
+ Fanforce::CLI::Apps.each do |app, current_count, total|
79
+ log divider '+==================================================================================================='
80
+ has_files_to_update = false
81
+ Fanforce::AppFactory::CLI::Scaffolding.new(app).metadata.each do |filepath, metadata|
82
+ next if ![:previous,:diverged,:missing,:corrupted].include?(metadata[:status])
83
+ has_files_to_update = true
84
+ filepath = filepath.gsub(Fanforce::CLI::DIR, '')
85
+ log sprintf "%s%-8s#{fmt_end} %-95s %22s %22s\n",
86
+ fmt_start([:previous,:diverged,:missing,:corrupted].include?(metadata[:status]) ? :red : :green),
87
+ metadata[:status].to_s.titleize,
88
+ filepath,
89
+ ("#{metadata[:insertions]} insertions(+)" if metadata[:insertions].to_i > 0),
90
+ ("#{metadata[:deletions]} deletions(-)" if metadata[:insertions].to_i > 0)
91
+ if detail_level == :diff and metadata[:diff]
92
+ lines = ''
93
+ metadata[:diff].lines do |line|
94
+ line = line.format(:red) if line[0] == '-'
95
+ line = line.format(:green) if line[0] == '+'
96
+ line = (' '*3) + line
97
+ lines += line
98
+ end
99
+ log divider ' -----------------------------------------------------------------------------------------------'
100
+ log ' THE FOLLOWING CHANGES WILL OCCUR DURING UPDATE:'
101
+ log ' -----------------------------------------------'
102
+ log "\n" + lines + "\n"
103
+ end
104
+ log divider '---------------------------------------------------------------------------------------------------+'
105
+ end
106
+ log 'NO FILES TO UPDATE' if !has_files_to_update
107
+ end
108
+ end
109
+
110
+ def app_file_details(app, detail_level)
91
111
  log ''
92
112
  log sprintf "%-30s %119s\n", "FILES (#{app.dir_name})", 'changes needed during update'
93
113
  log divider '======================================================================================================'
94
- Fanforce::AppFactory::CLI::Scaffolding.new(app).metadata.each do |filepath, change|
114
+ Fanforce::AppFactory::CLI::Scaffolding.new(app).metadata.each do |filepath, metadata|
95
115
  filepath = filepath.gsub(Fanforce::CLI::DIR, '')
96
116
  log sprintf "%s%-8s#{fmt_end} %-95s %22s %22s\n",
97
- fmt_start([:previous,:diverged,:missing,:corrupted].include?(change[:status]) ? :red : :green),
98
- change[:status].to_s.titleize,
117
+ fmt_start([:previous,:diverged,:missing,:corrupted].include?(metadata[:status]) ? :red : :green),
118
+ metadata[:status].to_s.titleize,
99
119
  filepath,
100
- ("#{change[:insertions]} insertions(+)" if change[:insertions].to_i > 0),
101
- ("#{change[:deletions]} deletions(-)" if change[:insertions].to_i > 0)
102
- if detail_level == :diff and change[:diff]
120
+ ("#{metadata[:insertions]} insertions(+)" if metadata[:insertions].to_i > 0),
121
+ ("#{metadata[:deletions]} deletions(-)" if metadata[:insertions].to_i > 0)
122
+ if detail_level == :diff and metadata[:diff]
103
123
  lines = ''
104
- change[:diff].lines do |line|
124
+ metadata[:diff].lines do |line|
105
125
  line = line.format(:red) if line[0] == '-'
106
126
  line = line.format(:green) if line[0] == '+'
107
127
  line = (' '*3) + line
@@ -117,4 +137,20 @@ class Fanforce::AppFactory::CLI::Scripts
117
137
  puts ''
118
138
  end
119
139
 
140
+ def git_overview
141
+ app_column_width = Fanforce::CLI::Apps.dir_names.inject(0){|l,d| d.length>l ? d.length : l}
142
+ log Fanforce::AppFactory::CLI::Git.status_table_header(app_column_width)
143
+ log divider '======================================================================================================'
144
+ Fanforce::CLI::Apps.each do |app, current_count, total|
145
+ log Fanforce::AppFactory::CLI::Git.new(app).status_row(app_column_width)
146
+ log divider '---------------------------------------------------------------------------------------------------+'
147
+ end
148
+ log ''
149
+ end
150
+
151
+ def git_details
152
+ exec 'git status'
153
+ log ''
154
+ end
155
+
120
156
  end
@@ -1,8 +1,8 @@
1
1
  class Fanforce::AppFactory::CLI::Scripts
2
2
  include Fanforce::AppFactory::CLI::Utils
3
3
 
4
- require_relative '../env'
5
- require_relative '../scaffolding'
4
+ require_relative '../lib/env'
5
+ require_relative '../lib/scaffolding'
6
6
 
7
7
  ######################################################################################################################
8
8
 
@@ -17,10 +17,10 @@ class Fanforce::AppFactory::CLI::Scripts
17
17
  ########################################################################################################################
18
18
 
19
19
  Fanforce::CLI.register(self, :status,
20
- ['all/TYPE', 'Check the status of files, git, and gems'],
21
- ['files', 'Check for file diffs between app_factory scaffolding'],
22
- ['git', 'Check the status of git commit'],
23
- ['gems', 'Check the gem versions being used across apps']
20
+ ['all/TYPE', 'Check the status of files, git, and gems'],
21
+ ['files *overview/diff','Check for file diffs between app_factory scaffolding'],
22
+ ['git', 'Check the status of git commit'],
23
+ ['gems', 'Check the gem versions being used across apps']
24
24
  ) { require_relative 'cli/scripts/status' }
25
25
 
26
26
  ########################################################################################################################
@@ -1,5 +1,5 @@
1
1
  class Fanforce
2
2
  class AppFactory
3
- VERSION = '2.0.0.rc8'
3
+ VERSION = '2.0.0.rc9'
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.rc8
4
+ version: 2.0.0.rc9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Clark
@@ -282,14 +282,14 @@ dependencies:
282
282
  requirements:
283
283
  - - '='
284
284
  - !ruby/object:Gem::Version
285
- version: 1.1.0.rc1
285
+ version: 1.1.0.rc2
286
286
  type: :runtime
287
287
  prerelease: false
288
288
  version_requirements: !ruby/object:Gem::Requirement
289
289
  requirements:
290
290
  - - '='
291
291
  - !ruby/object:Gem::Version
292
- version: 1.1.0.rc1
292
+ version: 1.1.0.rc2
293
293
  description:
294
294
  email:
295
295
  - cclark@fanforce.com
@@ -362,14 +362,16 @@ files:
362
362
  - lib/fanforce/app_factory/asset_framework/app_factory/ui-select/select_override.scss
363
363
  - lib/fanforce/app_factory/asset_framework/app_factory/ui-select/selectize.default.css
364
364
  - lib/fanforce/app_factory/cli.rb
365
- - lib/fanforce/app_factory/cli/bitbucket.rb
366
- - lib/fanforce/app_factory/cli/bundler.rb
367
- - lib/fanforce/app_factory/cli/env.rb
368
- - lib/fanforce/app_factory/cli/git.rb
369
- - lib/fanforce/app_factory/cli/iron.rb
370
- - lib/fanforce/app_factory/cli/pow.rb
371
- - lib/fanforce/app_factory/cli/scaffolding.rb
372
- - lib/fanforce/app_factory/cli/scaffolding_file.rb
365
+ - lib/fanforce/app_factory/cli/lib/bitbucket.rb
366
+ - lib/fanforce/app_factory/cli/lib/bundler.rb
367
+ - lib/fanforce/app_factory/cli/lib/env.rb
368
+ - lib/fanforce/app_factory/cli/lib/git.rb
369
+ - lib/fanforce/app_factory/cli/lib/iron.rb
370
+ - lib/fanforce/app_factory/cli/lib/pow.rb
371
+ - lib/fanforce/app_factory/cli/lib/scaffolding.rb
372
+ - lib/fanforce/app_factory/cli/lib/scaffolding_file.rb
373
+ - lib/fanforce/app_factory/cli/lib/uranium.rb
374
+ - lib/fanforce/app_factory/cli/lib/utils.rb
373
375
  - lib/fanforce/app_factory/cli/scripts/config.rb
374
376
  - lib/fanforce/app_factory/cli/scripts/create.rb
375
377
  - lib/fanforce/app_factory/cli/scripts/destroy.rb
@@ -378,8 +380,6 @@ files:
378
380
  - lib/fanforce/app_factory/cli/scripts/setup.rb
379
381
  - lib/fanforce/app_factory/cli/scripts/status.rb
380
382
  - lib/fanforce/app_factory/cli/scripts/update.rb
381
- - lib/fanforce/app_factory/cli/uranium.rb
382
- - lib/fanforce/app_factory/cli/utils.rb
383
383
  - lib/fanforce/app_factory/cli_directory_of_apps.rb
384
384
  - lib/fanforce/app_factory/cli_single_app.rb
385
385
  - lib/fanforce/app_factory/controllers/base_controller.rb