autowow 0.14.2 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +14 -14
- data/.rspec +2 -2
- data/.rubocop.yml +118 -118
- data/.travis.yml +11 -11
- data/Gemfile +6 -6
- data/Guardfile +22 -22
- data/LICENSE.txt +21 -21
- data/README.md +7 -1
- data/Rakefile +59 -59
- data/autowow.gemspec +42 -42
- data/bin/autowow +5 -5
- data/bin/aw +5 -5
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/lib/autowow.rb +13 -13
- data/lib/autowow/cli.rb +133 -128
- data/lib/autowow/commands/gem.rb +58 -54
- data/lib/autowow/commands/heroku.rb +23 -23
- data/lib/autowow/commands/os.rb +11 -11
- data/lib/autowow/commands/rbenv.rb +19 -19
- data/lib/autowow/commands/vcs.rb +104 -104
- data/lib/autowow/decorators/string_decorator.rb +11 -11
- data/lib/autowow/executor.rb +100 -100
- data/lib/autowow/features/fs.rb +49 -49
- data/lib/autowow/features/gem.rb +8 -1
- data/lib/autowow/features/heroku.rb +21 -21
- data/lib/autowow/features/os.rb +16 -16
- data/lib/autowow/features/rbenv.rb +50 -50
- data/lib/autowow/features/vcs.rb +0 -0
- data/lib/autowow/log_formatter.rb +25 -25
- data/lib/autowow/time_difference.rb +29 -29
- data/lib/autowow/version.rb +1 -1
- metadata +3 -4
data/autowow.gemspec
CHANGED
@@ -1,42 +1,42 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "autowow/version"
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "autowow"
|
8
|
-
spec.version = Autowow::VERSION
|
9
|
-
spec.authors = ["thisismydesign"]
|
10
|
-
spec.email = ["thisismydesign@users.noreply.github.com"]
|
11
|
-
|
12
|
-
spec.summary = %q{Set of commands to AUTOmate Way Of Working}
|
13
|
-
spec.homepage = "https://github.com/thisismydesign/autowow"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
-
f.match(%r{^(test|spec|features)/})
|
18
|
-
end
|
19
|
-
spec.bindir = "bin"
|
20
|
-
spec.executables << 'autowow'
|
21
|
-
spec.executables << 'aw'
|
22
|
-
spec.require_paths = ["lib"]
|
23
|
-
|
24
|
-
spec.add_dependency "easy_logging", ">= 0.3.0" # Include logger easily, without redundancy
|
25
|
-
spec.add_dependency "thor" # CLI
|
26
|
-
spec.add_dependency "pastel" # Colorize output of own logger
|
27
|
-
spec.add_dependency "time_difference", "= 0.5.0" # Calculate project age. Fixed version because of refinements :(
|
28
|
-
spec.add_dependency "launchy" # Open project in browser
|
29
|
-
spec.add_dependency "tty-command", "~> 0.8" # Execute system commands nicely
|
30
|
-
spec.add_dependency "reflection_utils", ">= 0.3.0" # Invoke module methods without including the module
|
31
|
-
spec.add_dependency "rubocop" # Style check
|
32
|
-
spec.add_dependency "rubocop-rspec" # Style check
|
33
|
-
spec.add_dependency "gem-release" # Bump gem versions
|
34
|
-
|
35
|
-
spec.add_development_dependency "bundler", "~> 1.15"
|
36
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
38
|
-
spec.add_development_dependency "guard"
|
39
|
-
spec.add_development_dependency "guard-bundler"
|
40
|
-
spec.add_development_dependency "guard-rspec"
|
41
|
-
spec.add_development_dependency "coveralls"
|
42
|
-
end
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "autowow/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "autowow"
|
8
|
+
spec.version = Autowow::VERSION
|
9
|
+
spec.authors = ["thisismydesign"]
|
10
|
+
spec.email = ["thisismydesign@users.noreply.github.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Set of commands to AUTOmate Way Of Working}
|
13
|
+
spec.homepage = "https://github.com/thisismydesign/autowow"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
+
f.match(%r{^(test|spec|features)/})
|
18
|
+
end
|
19
|
+
spec.bindir = "bin"
|
20
|
+
spec.executables << 'autowow'
|
21
|
+
spec.executables << 'aw'
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_dependency "easy_logging", ">= 0.3.0" # Include logger easily, without redundancy
|
25
|
+
spec.add_dependency "thor" # CLI
|
26
|
+
spec.add_dependency "pastel" # Colorize output of own logger
|
27
|
+
spec.add_dependency "time_difference", "= 0.5.0" # Calculate project age. Fixed version because of refinements :(
|
28
|
+
spec.add_dependency "launchy" # Open project in browser
|
29
|
+
spec.add_dependency "tty-command", "~> 0.8" # Execute system commands nicely
|
30
|
+
spec.add_dependency "reflection_utils", ">= 0.3.0" # Invoke module methods without including the module
|
31
|
+
spec.add_dependency "rubocop" # Style check
|
32
|
+
spec.add_dependency "rubocop-rspec" # Style check
|
33
|
+
spec.add_dependency "gem-release" # Bump gem versions
|
34
|
+
|
35
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
36
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
38
|
+
spec.add_development_dependency "guard"
|
39
|
+
spec.add_development_dependency "guard-bundler"
|
40
|
+
spec.add_development_dependency "guard-rspec"
|
41
|
+
spec.add_development_dependency "coveralls"
|
42
|
+
end
|
data/bin/autowow
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "autowow"
|
4
|
-
|
5
|
-
Autowow::CLI.start
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "autowow"
|
4
|
+
|
5
|
+
Autowow::CLI.start
|
data/bin/aw
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "autowow"
|
4
|
-
|
5
|
-
Autowow::CLI.start
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "autowow"
|
4
|
+
|
5
|
+
Autowow::CLI.start
|
data/bin/console
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "autowow"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "autowow"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -euo pipefail
|
3
|
-
IFS=$'\n\t'
|
4
|
-
set -vx
|
5
|
-
|
6
|
-
bundle install
|
7
|
-
|
8
|
-
# Do any other automated setup that you need to do here
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -euo pipefail
|
3
|
+
IFS=$'\n\t'
|
4
|
+
set -vx
|
5
|
+
|
6
|
+
bundle install
|
7
|
+
|
8
|
+
# Do any other automated setup that you need to do here
|
data/lib/autowow.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
require "easy_logging"
|
2
|
-
require "reflection_utils"
|
3
|
-
|
4
|
-
require_relative "autowow/log_formatter"
|
5
|
-
|
6
|
-
EasyLogging.level = Logger::DEBUG
|
7
|
-
EasyLogging.formatter = proc do |severity, datetime, progname, msg|
|
8
|
-
Autowow::LogFormatter.beautify(severity, msg)
|
9
|
-
end
|
10
|
-
|
11
|
-
require_relative "autowow/cli"
|
12
|
-
|
13
|
-
module Autowow; end
|
1
|
+
require "easy_logging"
|
2
|
+
require "reflection_utils"
|
3
|
+
|
4
|
+
require_relative "autowow/log_formatter"
|
5
|
+
|
6
|
+
EasyLogging.level = Logger::DEBUG
|
7
|
+
EasyLogging.formatter = proc do |severity, datetime, progname, msg|
|
8
|
+
Autowow::LogFormatter.beautify(severity, msg)
|
9
|
+
end
|
10
|
+
|
11
|
+
require_relative "autowow/cli"
|
12
|
+
|
13
|
+
module Autowow; end
|
data/lib/autowow/cli.rb
CHANGED
@@ -1,128 +1,133 @@
|
|
1
|
-
require "thor"
|
2
|
-
|
3
|
-
require_relative "executor"
|
4
|
-
require_relative "decorators/string_decorator"
|
5
|
-
|
6
|
-
require_relative "features/rbenv"
|
7
|
-
require_relative "features/gem"
|
8
|
-
require_relative "features/vcs"
|
9
|
-
require_relative "features/os"
|
10
|
-
require_relative "features/fs"
|
11
|
-
require_relative "features/heroku"
|
12
|
-
|
13
|
-
require_relative "commands/gem"
|
14
|
-
|
15
|
-
module Autowow
|
16
|
-
class CLI < Thor
|
17
|
-
map %w[bm] => :branch_merged
|
18
|
-
map %w[grls] => :gem_release
|
19
|
-
map %w[up] => :update_projects
|
20
|
-
map %w[cb] => :clear_branches
|
21
|
-
map %w[au] => :add_upstream
|
22
|
-
map %w[gc] => :gem_clean
|
23
|
-
map %w[rv] => :ruby_versions
|
24
|
-
map %w[gr] => :greet
|
25
|
-
map %w[rpa] => :rubocop_parallel_autocorrect
|
26
|
-
map %w[be] => :bundle_exec
|
27
|
-
map %w[dbm] => :db_migrate
|
28
|
-
map %w[dbsch] => :db_schema
|
29
|
-
map %w[dbstr] => :db_structure
|
30
|
-
map %w[fp] => :force_pull
|
31
|
-
map %w[
|
32
|
-
|
33
|
-
desc "branch_merged", "clean working branch and return to master"
|
34
|
-
def branch_merged
|
35
|
-
Autowow::Features::Vcs.branch_merged
|
36
|
-
end
|
37
|
-
|
38
|
-
desc "gem_release", "release gem and return to master"
|
39
|
-
def gem_release(version_bump = nil)
|
40
|
-
Autowow::Features::Gem.gem_release(version_bump)
|
41
|
-
end
|
42
|
-
|
43
|
-
desc "update_projects", "updates idle projects"
|
44
|
-
def update_projects
|
45
|
-
Autowow::Features::Vcs.update_projects
|
46
|
-
end
|
47
|
-
|
48
|
-
desc "clear_branches", "removes unused branches"
|
49
|
-
def clear_branches
|
50
|
-
Autowow::Features::Vcs.clear_branches
|
51
|
-
end
|
52
|
-
|
53
|
-
desc "add_upstream", "adds upstream branch if available"
|
54
|
-
def add_upstream
|
55
|
-
Autowow::Features::Vcs.add_upstream
|
56
|
-
end
|
57
|
-
|
58
|
-
desc "hi", "day starter routine"
|
59
|
-
def hi
|
60
|
-
Autowow::Features::Vcs.hi
|
61
|
-
end
|
62
|
-
|
63
|
-
desc "hi!", "day starter routine for a new start"
|
64
|
-
def hi!
|
65
|
-
Autowow::Features::Vcs.hi!
|
66
|
-
end
|
67
|
-
|
68
|
-
desc "open", "opens project URL in browser"
|
69
|
-
def open
|
70
|
-
Autowow::Features::Vcs.open
|
71
|
-
end
|
72
|
-
|
73
|
-
desc "gem_clean", "cleans unused gems"
|
74
|
-
def gem_clean
|
75
|
-
Autowow::Features::Gem.gem_clean
|
76
|
-
end
|
77
|
-
|
78
|
-
desc "ruby_versions", "shows ruby versions in use"
|
79
|
-
def ruby_versions
|
80
|
-
Autowow::Features::Rbenv.ruby_versions
|
81
|
-
end
|
82
|
-
|
83
|
-
desc "greet", "shows report of repos"
|
84
|
-
def greet
|
85
|
-
Autowow::Features::Vcs.greet
|
86
|
-
end
|
87
|
-
|
88
|
-
desc "rubocop_parallel_autocorrect", "runs rubocop in parallel mode, autocorrects offenses on single thread"
|
89
|
-
def rubocop_parallel_autocorrect
|
90
|
-
Autowow::Features::Gem.rubocop_parallel_autocorrect
|
91
|
-
end
|
92
|
-
|
93
|
-
desc "exec", "runs command"
|
94
|
-
def exec(*cmd)
|
95
|
-
Autowow::Executor.pretty_with_output.run(cmd)
|
96
|
-
end
|
97
|
-
|
98
|
-
desc "bundle_exec", "runs command with `bundle exec` prefixed"
|
99
|
-
def bundle_exec(*cmd)
|
100
|
-
Autowow::Features::Gem.bundle_exec(cmd)
|
101
|
-
end
|
102
|
-
|
103
|
-
desc "db_migrate", "drops and sets up DB via migration"
|
104
|
-
def db_migrate
|
105
|
-
Autowow::Features::Gem.db_migrate
|
106
|
-
end
|
107
|
-
|
108
|
-
desc "db_schema", "drops and sets up DB via loading schema"
|
109
|
-
def db_schema
|
110
|
-
Autowow::Features::Gem.db_schema
|
111
|
-
end
|
112
|
-
|
113
|
-
desc "db_structure", "drops and sets up DB via loading structure"
|
114
|
-
def db_structure
|
115
|
-
Autowow::Features::Gem.db_structure
|
116
|
-
end
|
117
|
-
|
118
|
-
desc "force_pull", "pulls branch from origin discarding local changes (including commits)"
|
119
|
-
def force_pull
|
120
|
-
Autowow::Features::Vcs.force_pull
|
121
|
-
end
|
122
|
-
|
123
|
-
desc "heroku_db_migrate", "drops and sets up DB via migration"
|
124
|
-
def heroku_db_migrate
|
125
|
-
Autowow::Features::Heroku.db_migrate
|
126
|
-
end
|
127
|
-
|
128
|
-
|
1
|
+
require "thor"
|
2
|
+
|
3
|
+
require_relative "executor"
|
4
|
+
require_relative "decorators/string_decorator"
|
5
|
+
|
6
|
+
require_relative "features/rbenv"
|
7
|
+
require_relative "features/gem"
|
8
|
+
require_relative "features/vcs"
|
9
|
+
require_relative "features/os"
|
10
|
+
require_relative "features/fs"
|
11
|
+
require_relative "features/heroku"
|
12
|
+
|
13
|
+
require_relative "commands/gem"
|
14
|
+
|
15
|
+
module Autowow
|
16
|
+
class CLI < Thor
|
17
|
+
map %w[bm] => :branch_merged
|
18
|
+
map %w[grls] => :gem_release
|
19
|
+
map %w[up] => :update_projects
|
20
|
+
map %w[cb] => :clear_branches
|
21
|
+
map %w[au] => :add_upstream
|
22
|
+
map %w[gc] => :gem_clean
|
23
|
+
map %w[rv] => :ruby_versions
|
24
|
+
map %w[gr] => :greet
|
25
|
+
map %w[rpa] => :rubocop_parallel_autocorrect
|
26
|
+
map %w[be] => :bundle_exec
|
27
|
+
map %w[dbm] => :db_migrate
|
28
|
+
map %w[dbsch] => :db_schema
|
29
|
+
map %w[dbstr] => :db_structure
|
30
|
+
map %w[fp] => :force_pull
|
31
|
+
map %w[rc] => :ruby_check
|
32
|
+
|
33
|
+
desc "branch_merged", "clean working branch and return to master"
|
34
|
+
def branch_merged
|
35
|
+
Autowow::Features::Vcs.branch_merged
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "gem_release", "release gem and return to master"
|
39
|
+
def gem_release(version_bump = nil)
|
40
|
+
Autowow::Features::Gem.gem_release(version_bump)
|
41
|
+
end
|
42
|
+
|
43
|
+
desc "update_projects", "updates idle projects"
|
44
|
+
def update_projects
|
45
|
+
Autowow::Features::Vcs.update_projects
|
46
|
+
end
|
47
|
+
|
48
|
+
desc "clear_branches", "removes unused branches"
|
49
|
+
def clear_branches
|
50
|
+
Autowow::Features::Vcs.clear_branches
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "add_upstream", "adds upstream branch if available"
|
54
|
+
def add_upstream
|
55
|
+
Autowow::Features::Vcs.add_upstream
|
56
|
+
end
|
57
|
+
|
58
|
+
desc "hi", "day starter routine"
|
59
|
+
def hi
|
60
|
+
Autowow::Features::Vcs.hi
|
61
|
+
end
|
62
|
+
|
63
|
+
desc "hi!", "day starter routine for a new start"
|
64
|
+
def hi!
|
65
|
+
Autowow::Features::Vcs.hi!
|
66
|
+
end
|
67
|
+
|
68
|
+
desc "open", "opens project URL in browser"
|
69
|
+
def open
|
70
|
+
Autowow::Features::Vcs.open
|
71
|
+
end
|
72
|
+
|
73
|
+
desc "gem_clean", "cleans unused gems"
|
74
|
+
def gem_clean
|
75
|
+
Autowow::Features::Gem.gem_clean
|
76
|
+
end
|
77
|
+
|
78
|
+
desc "ruby_versions", "shows ruby versions in use"
|
79
|
+
def ruby_versions
|
80
|
+
Autowow::Features::Rbenv.ruby_versions
|
81
|
+
end
|
82
|
+
|
83
|
+
desc "greet", "shows report of repos"
|
84
|
+
def greet
|
85
|
+
Autowow::Features::Vcs.greet
|
86
|
+
end
|
87
|
+
|
88
|
+
desc "rubocop_parallel_autocorrect", "runs rubocop in parallel mode, autocorrects offenses on single thread"
|
89
|
+
def rubocop_parallel_autocorrect
|
90
|
+
Autowow::Features::Gem.rubocop_parallel_autocorrect
|
91
|
+
end
|
92
|
+
|
93
|
+
desc "exec", "runs command"
|
94
|
+
def exec(*cmd)
|
95
|
+
Autowow::Executor.pretty_with_output.run(cmd)
|
96
|
+
end
|
97
|
+
|
98
|
+
desc "bundle_exec", "runs command with `bundle exec` prefixed"
|
99
|
+
def bundle_exec(*cmd)
|
100
|
+
Autowow::Features::Gem.bundle_exec(cmd)
|
101
|
+
end
|
102
|
+
|
103
|
+
desc "db_migrate", "drops and sets up DB via migration"
|
104
|
+
def db_migrate
|
105
|
+
Autowow::Features::Gem.db_migrate
|
106
|
+
end
|
107
|
+
|
108
|
+
desc "db_schema", "drops and sets up DB via loading schema"
|
109
|
+
def db_schema
|
110
|
+
Autowow::Features::Gem.db_schema
|
111
|
+
end
|
112
|
+
|
113
|
+
desc "db_structure", "drops and sets up DB via loading structure"
|
114
|
+
def db_structure
|
115
|
+
Autowow::Features::Gem.db_structure
|
116
|
+
end
|
117
|
+
|
118
|
+
desc "force_pull", "pulls branch from origin discarding local changes (including commits)"
|
119
|
+
def force_pull
|
120
|
+
Autowow::Features::Vcs.force_pull
|
121
|
+
end
|
122
|
+
|
123
|
+
desc "heroku_db_migrate", "drops and sets up DB via migration"
|
124
|
+
def heroku_db_migrate
|
125
|
+
Autowow::Features::Heroku.db_migrate
|
126
|
+
end
|
127
|
+
|
128
|
+
desc "ruby_check", "rpa && be rspec && git status"
|
129
|
+
def ruby_check
|
130
|
+
Autowow::Features::Gem.ruby_check
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
data/lib/autowow/commands/gem.rb
CHANGED
@@ -1,54 +1,58 @@
|
|
1
|
-
module Autowow
|
2
|
-
module Commands
|
3
|
-
module Gem
|
4
|
-
def release
|
5
|
-
be + ["rake", "release"]
|
6
|
-
end
|
7
|
-
|
8
|
-
def clean
|
9
|
-
["gem", "clean"]
|
10
|
-
end
|
11
|
-
|
12
|
-
def
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
def
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
def
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
def
|
40
|
-
|
41
|
-
end
|
42
|
-
|
43
|
-
def
|
44
|
-
["DISABLE_DATABASE_ENVIRONMENT_CHECK=1"] + rake + ["db:drop", "db:create", "db:
|
45
|
-
end
|
46
|
-
|
47
|
-
def
|
48
|
-
["DISABLE_DATABASE_ENVIRONMENT_CHECK=1"] + rake + ["db:drop", "db:create", "db:
|
49
|
-
end
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
1
|
+
module Autowow
|
2
|
+
module Commands
|
3
|
+
module Gem
|
4
|
+
def release
|
5
|
+
be + ["rake", "release"]
|
6
|
+
end
|
7
|
+
|
8
|
+
def clean
|
9
|
+
["gem", "clean"]
|
10
|
+
end
|
11
|
+
|
12
|
+
def bundle_install
|
13
|
+
["bundle", "install"]
|
14
|
+
end
|
15
|
+
|
16
|
+
def rubocop_parallel
|
17
|
+
be + ["rubocop", "--parallel"]
|
18
|
+
end
|
19
|
+
|
20
|
+
def bump(version = nil)
|
21
|
+
command = ["gem", "bump", "--no-commit", "--no-color"]
|
22
|
+
return command unless version
|
23
|
+
command + ["--version", version]
|
24
|
+
end
|
25
|
+
|
26
|
+
def rubocop_autocorrect(files)
|
27
|
+
cmd = be + ["rubocop", "--auto-correct"]
|
28
|
+
if files.kind_of?(Array)
|
29
|
+
cmd + files
|
30
|
+
else
|
31
|
+
cmd + files.split(" ")
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def be
|
36
|
+
["bundle", "exec"]
|
37
|
+
end
|
38
|
+
|
39
|
+
def rake
|
40
|
+
be + ["rake"]
|
41
|
+
end
|
42
|
+
|
43
|
+
def rake_db_migrate
|
44
|
+
["DISABLE_DATABASE_ENVIRONMENT_CHECK=1"] + rake + ["db:drop", "db:create", "db:migrate"]
|
45
|
+
end
|
46
|
+
|
47
|
+
def rake_db_schema
|
48
|
+
["DISABLE_DATABASE_ENVIRONMENT_CHECK=1"] + rake + ["db:drop", "db:create", "db:schema:load"]
|
49
|
+
end
|
50
|
+
|
51
|
+
def rake_db_structure
|
52
|
+
["DISABLE_DATABASE_ENVIRONMENT_CHECK=1"] + rake + ["db:drop", "db:create", "db:structure:load"]
|
53
|
+
end
|
54
|
+
|
55
|
+
include ReflectionUtils::CreateModuleFunctions
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|