autowow 0.14.2 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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[fp] => :force_pull
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
- end
128
- end
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
@@ -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 rubocop_parallel
13
- be + ["rubocop", "--parallel"]
14
- end
15
-
16
- def bump(version = nil)
17
- command = ["gem", "bump", "--no-commit"]
18
- return command unless version
19
- command + ["--version", version]
20
- end
21
-
22
- def rubocop_autocorrect(files)
23
- cmd = be + ["rubocop", "--auto-correct"]
24
- if files.kind_of?(Array)
25
- cmd + files
26
- else
27
- cmd + files.split(" ")
28
- end
29
- end
30
-
31
- def be
32
- ["bundle", "exec"]
33
- end
34
-
35
- def rake
36
- be + ["rake"]
37
- end
38
-
39
- def rake_db_migrate
40
- ["DISABLE_DATABASE_ENVIRONMENT_CHECK=1"] + rake + ["db:drop", "db:create", "db:migrate"]
41
- end
42
-
43
- def rake_db_schema
44
- ["DISABLE_DATABASE_ENVIRONMENT_CHECK=1"] + rake + ["db:drop", "db:create", "db:schema:load"]
45
- end
46
-
47
- def rake_db_structure
48
- ["DISABLE_DATABASE_ENVIRONMENT_CHECK=1"] + rake + ["db:drop", "db:create", "db:structure:load"]
49
- end
50
-
51
- include ReflectionUtils::CreateModuleFunctions
52
- end
53
- end
54
- end
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