wildland_dev_tools 1.0.0 → 1.0.2

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: 40bc73b0ec0d6ce0ebde969eafad7585c8ad0fb7
4
- data.tar.gz: 890e4525c95b5e2f5a8e599bf92ac199dfa2b653
3
+ metadata.gz: 8de6d28a97cdb7086dfbd84528090eaf77c70b36
4
+ data.tar.gz: ee444d8de3cd5af3cdfaf18e9a93c40e0c4b5e00
5
5
  SHA512:
6
- metadata.gz: 14c8616886be729c61623c7eea137073ccfaa73a6de66f517ee2841e66575619ef5dd3945d212badebacc9be527bf9135082028c98067508c498c717d1b66bb5
7
- data.tar.gz: ab0472a04e966b4e30dc46343a36675a6abc1bcbd5c7bd1f041a0c0e91d43a30e25f70fd9f1f968f014ee9d980442b475fa7ca9ed3cba3ed408c30a00913feda
6
+ metadata.gz: b1bff2a26651dc1771fc9a477c5ea81069c5105be4000e2bbfd550fd435fd9e2cece188fbb0b5ece4c7092b7177edb31c22a5441d8cb863c28fc4c4f16728549
7
+ data.tar.gz: 6100ac430ef9ffa4fb080359591c94d5b0fc2a895f3a8bca613aaa2a9497a9785c087ca9c278c7b1b4da69f4e6e7d64c747c079c2bd61061f235eaadde321da4
data/README.md CHANGED
@@ -4,57 +4,67 @@ These are most useful for projects created by [trailhead](https://github.com/wil
4
4
 
5
5
  ## Installation
6
6
 
7
- Add the following to your `Gemfile`:
7
+ - Add the following to your `Gemfile`:
8
8
 
9
- `gem 'wildland_dev_tools', '~>1.0.0'
9
+ `gem 'wildland_dev_tools', '~>1.0'`
10
10
 
11
11
  Typically for wildland projects you will want to put this inside the dev/test block:
12
12
  ```
13
13
  group :development, :test do
14
14
  ...
15
- gem 'wildland_dev_tools', '~>1.0.0'
15
+ gem 'wildland_dev_tools', '~>1.0'
16
16
  ...
17
17
  end
18
18
  ```
19
19
 
20
- ### *[heroku tools](https://github.com/wildland/wildland_dev_tools#heroku-tools) require the following steps*
20
+ - Run `bundle install` to install the gem.
21
21
 
22
- Install the heroku-toolbelt using brew. You can do this by running `brew install heroku`.
23
-
24
- Have your `production` and `staging` git remotes set.
25
- - `heroku git:remote -a <staging-app> -r staging` where `<staging-app>` is your heroku staging app name.
26
- - `heroku git:remote -a <production-app> -r production` where `<production-app>` is your heroku production app name.
22
+ **[Heroku Tasks](https://github.com/wildland/wildland_dev_tools#heroku-tasks) require the following steps**
23
+ - Install the [heroku CLI](https://devcenter.heroku.com/articles/heroku-cli).
24
+ - For OSx users you can do this using brew by running `brew install heroku`.
25
+ - Ensure you have your `production` and `staging` git remotes set.
26
+ - `heroku git:remote -a <staging-app> -r staging` where `<staging-app>` is your heroku staging app name.
27
+ - `heroku git:remote -a <production-app> -r production` where `<production-app>` is your heroku production app name.
28
+
29
+ *Common Install Fixes*
30
+ - If `bundle install` borks on `pg_config` then set the `Pg_config path` with `bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/{YOUR VERSION}/bin/pg_config`
27
31
 
28
32
 
29
33
  ## Usage
30
34
  You will get a new batch of new rake tasks under the wildland namespace. For a full list run `rake -T`.
31
35
 
32
- ### Local Development Tools
33
- *Note that you will need to run `bundle install` before being able to use these.*
34
-
35
- *Double Note: if `bundle install` borks on `pg_config` then set the `Pg_config path` with `bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/{YOUR VERSION}/bin/pg_config`
36
-
37
- - `rake wildland:setup` This will run all of the setup tasks to get your local enviroment ready to go.
36
+ ## Common Development Tasks
37
+ - `rake wildland` or `rake wildland:setup` This will run all of the setup tasks to get your local enviroment ready to go.
38
38
  - `rake wildland:db` This will resetup and seed the local database.
39
39
  - `rake wildland:cache_clear` This will clear the local app-ember package cache.
40
- - `rake wildland:pre_deploy` This will run all of the pre-deploy tasks to get the project ready to deploy.
41
- - `rake wildland:pre_pr` Convenience alias to `rake wildland:pre_pull_request`.
42
- - `rake wildland:pre_pull_request` This will run all of the pre pull request tasks to get the project ready for a pull request.
43
40
 
44
- ### Heroku Tools
41
+ ## Code Quality Tasks
42
+ - `rake wildland:pre_pr` or `rake wildland:pre_pull_request` This will run all pre-pull request checks.
43
+ - `rake wildland:pre_pull_request:fixme_notes` Print only FIXME notes
44
+ - `rake wildland:pre_pull_request:html` Run brakeman & rubocop with html formats and save them to /reports
45
+ - `rake wildland:pre_pull_request:js_debugger` Find js debugger statements
46
+ - `rake wildland:pre_pull_request:notes` Create a report on all notes
47
+ - `rake wildland:pre_pull_request:rubocop_recent` Run rubocop against all created/changed ruby files
48
+ - `rake wildland:pre_pull_request:rubocop_recent[autocorrect]` This perform the deploy as above, but have rubocop attempt to autocorrect issues.
49
+
50
+ ## Heroku Tasks
51
+ ### Deploying
45
52
  - `rake wildland:heroku:deploy_to_staging` This will deploy `master` to `staging`. This will automatically create a release candidate git tag.
46
- - `rake wildland:heroku:deploy_to_staging[verbose]` This perform the deploy as above, but in verbose mode.
47
- - - `rake wildland:heroku:deploy_to_staging[verbose,force]` This perform the deploy as above, but this will `--force` deploy `master` to `staging`.
48
- - - `rake wildland:heroku:deploy_current_branch_to_staging` This will promote your current branch to `staging` as `master`. This will **NOT** automatically create a release candidate git tag.
49
- - - `rake wildland:heroku:deploy_current_branch_to_staging[verbose]` This perform the deploy as above, but in verbose mode.
50
- - - `rake wildland:heroku:deploy_current_branch_to_staging[verbose,force]` This perform the deploy as above, but this will `--force` deploy your current branch to `staging`.
53
+ - `rake wildland:heroku:deploy_to_staging[verbose]` This perform the deploy as above, but in verbose mode.
54
+ - `rake wildland:heroku:deploy_to_staging[verbose,force]` This perform the deploy as above, but this will `--force` deploy `master` to `staging`.
55
+ - `rake wildland:heroku:deploy_current_branch_to_staging` This will promote your current branch to `staging` as `master`. This will **NOT** automatically create a release candidate git tag.
56
+ - `rake wildland:heroku:deploy_current_branch_to_staging[verbose]` This perform the deploy as above, but in verbose mode.
57
+ - `rake wildland:heroku:deploy_current_branch_to_staging[verbose,force]` This perform the deploy as above, but this will `--force` deploy your current branch to `staging`.
51
58
  - `rake wildland:heroku:promote_to_production` This will promote `staging` to `production`. This will automatically create a production git tag.
52
- - `rake wildland:heroku:promote_to_production[verbose]` This perform the deploy as above, but in verbose mode.
59
+ - `rake wildland:heroku:promote_to_production[verbose]` This perform the deploy as above, but in verbose mode.
60
+
61
+ ### Utility
53
62
  - `rake wildland:heroku:maintenance_mode_on` This turns on maintenance mode for `staging` and `production`.
54
63
  - `rake wildland:heroku:maintenance_mode_off` This turns off maintenance mode for `staging` and `production`.
55
- - `rake wildland:heroku:backup_production_database[verbose]` This will create a backup of the `production` database.
56
- - `rake wildland:heroku:import_latest_production_database_backup[verbose]` This will import the latest `production` database backup to your local database.
57
-
64
+ - `rake wildland:heroku:backup_production_database` This will create a backup of the `production` database.
65
+ - `rake wildland:heroku:backup_production_database[verbose]` This perform the deploy as above, but in verbose mode.
66
+ - `rake wildland:heroku:import_latest_production_database_backup` This will import the latest `production` database backup to your local database.
67
+ - `rake wildland:heroku:import_latest_production_database_backup[verbose]` This perform the deploy as above, but in verbose mode.
58
68
 
59
69
  ## Code Of Conduct
60
70
  Wildland Open Source [Code Of Conduct](https://github.com/wildland/code-of-conduct)
@@ -8,6 +8,12 @@ namespace :wildland do
8
8
  Rake::Task['db:migrate'].invoke
9
9
  end
10
10
 
11
+ desc 'Imports the latest staging database backup to local database.'
12
+ task :import_latest_staging_database_backup, [:verbose] => [:check_remotes, :check_heroku] do |_t, args| # rubocop:disable Metrics/LineLength
13
+ WildlandDevTools::Heroku.import_staging_database(args[:verbose])
14
+ Rake::Task['db:migrate'].invoke
15
+ end
16
+
11
17
  desc 'Backups production database'
12
18
  task :backup_production_database, [:verbose] => [:check_remotes, :check_heroku] do |_t, args| # rubocop:disable Metrics/LineLength
13
19
  WildlandDevTools::Heroku.backup_production_database(args[:verbose])
@@ -73,7 +79,7 @@ namespace :wildland do
73
79
  rescue WildlandDevTools::GitSyncException => e
74
80
  puts e
75
81
  end
76
- end
82
+ end
77
83
 
78
84
  desc 'Turns on maintenance mode for both heroku remotes.'
79
85
  task :maintenance_mode_on do
@@ -70,33 +70,12 @@ namespace :wildland do
70
70
  puts 'Running rubocop...'
71
71
  require 'rubocop'
72
72
 
73
- module RuboCop
74
- # :nodoc:
75
- class TargetFinder
76
- def find(_args)
77
- changed_git_files = `git diff --name-only --cached`.split(/\n/)
78
-
79
- rubocop_target_finder = RuboCop::TargetFinder.new(
80
- RuboCop::ConfigStore.new
81
- )
82
- rubocop_config_store = RuboCop::ConfigStore.new
83
- rubocop_base_config = rubocop_config_store.for(
84
- File.expand_path(__dir__)
85
- )
86
-
87
- files_to_check = changed_git_files.select do |file|
88
- rubocop_target_finder.to_inspect?(file, [], rubocop_base_config)
89
- end
90
-
91
- files_to_check
92
- end
93
- end
94
- end
73
+ changed_git_files = `git diff --name-only --cached`.split(/\n/)
95
74
 
96
75
  if args[:autocorrect]
97
- exit RuboCop::CLI.new.run(['-aD'])
76
+ exit RuboCop::CLI.new.run(changed_git_files.concat(['-aD']))
98
77
  else
99
- exit RuboCop::CLI.new.run(['-D'])
78
+ exit RuboCop::CLI.new.run(changed_git_files.concat(['-D']))
100
79
  end
101
80
  end
102
81
  end
@@ -84,6 +84,16 @@ module WildlandDevTools
84
84
  File.delete(scratch_file_name)
85
85
  end
86
86
 
87
+ def import_staging_database(verbose = false)
88
+ puts 'Determining heroku app names.' if verbose
89
+ staging_app_name = get_app_name('staging', verbose)
90
+ scratch_file_name = 'latest.dump'
91
+ database_name = Rails.configuration.database_configuration['development']['database']
92
+ download_database(staging_app_name, scratch_file_name, verbose)
93
+ import_database(database_name, scratch_file_name, verbose)
94
+ File.delete(scratch_file_name)
95
+ end
96
+
87
97
  def copy_production_data_to_staging(verbose = false)
88
98
  puts 'Determining heroku app names.' if verbose
89
99
  staging_app_name = get_app_name('staging', verbose)
@@ -1,3 +1,3 @@
1
1
  module WildlandDevTools
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.2'.freeze
3
3
  end
@@ -19,10 +19,12 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
  spec.add_dependency 'rails', ['>= 4.1', '< 5']
22
- spec.add_runtime_dependency 'rubocop', '>= 0.33'
23
- spec.add_runtime_dependency 'git', '>= 1.3.0'
22
+ spec.add_runtime_dependency 'rubocop', '~> 0.52'
23
+ spec.add_runtime_dependency 'git', '~> 1.3', '>= 1.3.0'
24
+ spec.add_runtime_dependency 'table_print', '~> 1.5', '>= 1.5.6'
25
+ spec.add_runtime_dependency 'brakeman', '~> 4.1'
24
26
 
25
27
  spec.add_development_dependency "bundler", "~> 1.10"
26
28
  spec.add_development_dependency "rake", "~> 10.0"
27
- spec.add_development_dependency "rspec"
29
+ spec.add_development_dependency 'rspec', '~> 0'
28
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wildland_dev_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Weakley
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-07 00:00:00.000000000 Z
11
+ date: 2018-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -34,20 +34,23 @@ dependencies:
34
34
  name: rubocop
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.33'
39
+ version: '0.52'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ">="
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.33'
46
+ version: '0.52'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: git
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.3'
51
54
  - - ">="
52
55
  - !ruby/object:Gem::Version
53
56
  version: 1.3.0
@@ -55,9 +58,46 @@ dependencies:
55
58
  prerelease: false
56
59
  version_requirements: !ruby/object:Gem::Requirement
57
60
  requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '1.3'
58
64
  - - ">="
59
65
  - !ruby/object:Gem::Version
60
66
  version: 1.3.0
67
+ - !ruby/object:Gem::Dependency
68
+ name: table_print
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '1.5'
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: 1.5.6
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '1.5'
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 1.5.6
87
+ - !ruby/object:Gem::Dependency
88
+ name: brakeman
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - "~>"
92
+ - !ruby/object:Gem::Version
93
+ version: '4.1'
94
+ type: :runtime
95
+ prerelease: false
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - "~>"
99
+ - !ruby/object:Gem::Version
100
+ version: '4.1'
61
101
  - !ruby/object:Gem::Dependency
62
102
  name: bundler
63
103
  requirement: !ruby/object:Gem::Requirement
@@ -90,14 +130,14 @@ dependencies:
90
130
  name: rspec
91
131
  requirement: !ruby/object:Gem::Requirement
92
132
  requirements:
93
- - - ">="
133
+ - - "~>"
94
134
  - !ruby/object:Gem::Version
95
135
  version: '0'
96
136
  type: :development
97
137
  prerelease: false
98
138
  version_requirements: !ruby/object:Gem::Requirement
99
139
  requirements:
100
- - - ">="
140
+ - - "~>"
101
141
  - !ruby/object:Gem::Version
102
142
  version: '0'
103
143
  description: Wildland Dev Tools