autowow 0.13.2 → 0.14.0

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
  SHA256:
3
- metadata.gz: a1a6ccd72df2ce542966d7b2a766da1321c4f397987184502d9a7b567b65b755
4
- data.tar.gz: 59e90d091887b3a82aad4b2e8abfe27da4a7706f7e93e139172c01acb20b1487
3
+ metadata.gz: c5b1466ed841f82dc29a35cdea18bfbaa675320325b5034244bb05c3558f5eaf
4
+ data.tar.gz: 1310f72716022a8c462ac0809c7c8d14ada27330c9063cc4aa58a5d81cacc604
5
5
  SHA512:
6
- metadata.gz: 9feee817631d88fde1b1a2525a99ef6aca90e88fd7373c71a2f7abcf3572db248fc2eaf0cd0eb6a7896d36a5d5171e635c214640c9c464c7c63ebb20ebdd682c
7
- data.tar.gz: 7acd185539b4db1ad5ad9f4740ea4dbfcd23c820540c56deab38517c61c69f3765de0f0498f2d65b44c3f42888bf10f1516713470fda2b0dba4379396ba1c64a
6
+ metadata.gz: c59bfd0b7db00df39310b45173a0ddf6aba7e026b81893d1a36f1c4a09780609c2343c02b2631b3287ae7c5a367d81e69e27947e0798e7242791ca90e475b51d
7
+ data.tar.gz: 3a69adeb981853ff32bef7efbcb0c7e2dcf49e97e69dd720503b026d3a8e37e3638bcee5b9f36faf9b6c4971b4753767c64de028e7a65c0994a64eb62310a4ed
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  #### Set of commands to [auto]mate [w]ay [o]f [w]orking
4
4
 
5
5
  <!--- Version informartion -->
6
- *You are viewing the README of version [v0.13.2](https://github.com/thisismydesign/autowow/releases/tag/v0.13.2). You can find other releases [here](https://github.com/thisismydesign/autowow/releases).*
6
+ *You are viewing the README of version [v0.14.0](https://github.com/thisismydesign/autowow/releases/tag/v0.14.0). You can find other releases [here](https://github.com/thisismydesign/autowow/releases).*
7
7
  <!--- Version informartion end -->
8
8
 
9
9
  | Branch | Status |
@@ -8,6 +8,7 @@ require_relative "features/gem"
8
8
  require_relative "features/vcs"
9
9
  require_relative "features/os"
10
10
  require_relative "features/fs"
11
+ require_relative "features/heroku"
11
12
 
12
13
  require_relative "commands/gem"
13
14
 
@@ -27,6 +28,7 @@ module Autowow
27
28
  map %w[dbsch] => :db_schema
28
29
  map %w[dbstr] => :db_structure
29
30
  map %w[fp] => :force_pull
31
+ map %w[fp] => :force_pull
30
32
 
31
33
  desc "branch_merged", "clean working branch and return to master"
32
34
  def branch_merged
@@ -98,17 +100,17 @@ module Autowow
98
100
  Autowow::Features::Gem.bundle_exec(cmd)
99
101
  end
100
102
 
101
- desc "db_migrate", "sets up DB via migration"
103
+ desc "db_migrate", "drops and sets up DB via migration"
102
104
  def db_migrate
103
105
  Autowow::Features::Gem.db_migrate
104
106
  end
105
107
 
106
- desc "db_schema", "sets up DB via loading schema"
108
+ desc "db_schema", "drops and sets up DB via loading schema"
107
109
  def db_schema
108
110
  Autowow::Features::Gem.db_schema
109
111
  end
110
112
 
111
- desc "db_structure", "sets up DB via loading structure"
113
+ desc "db_structure", "drops and sets up DB via loading structure"
112
114
  def db_structure
113
115
  Autowow::Features::Gem.db_structure
114
116
  end
@@ -117,5 +119,10 @@ module Autowow
117
119
  def force_pull
118
120
  Autowow::Features::Vcs.force_pull
119
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
120
127
  end
121
128
  end
@@ -0,0 +1,23 @@
1
+ module Autowow
2
+ module Commands
3
+ module Heroku
4
+ def cmd
5
+ ["heroku"]
6
+ end
7
+
8
+ def info
9
+ cmd + ["info"]
10
+ end
11
+
12
+ def pb_reset(app_name)
13
+ cmd + ["pg:reset", "DATABASE_URL", "--app", app_name, "--confirm", app_name]
14
+ end
15
+
16
+ def migrate(app_name)
17
+ cmd + ["run", "rake", "db:migrate", "--app", app_name]
18
+ end
19
+
20
+ include ReflectionUtils::CreateModuleFunctions
21
+ end
22
+ end
23
+ end
@@ -12,7 +12,7 @@ module Autowow
12
12
  include Executor
13
13
 
14
14
  def gem_release(version_bump = nil)
15
- if quiet.run!("gem push").out.clean_lines.select { |line| line.match(/Enter your RubyGems.org credentials/) }.any?
15
+ unless rubygems_credentials_set?
16
16
  logger.error("Set RubyGems credentials first via `gem push`")
17
17
  return
18
18
  end
@@ -48,6 +48,10 @@ module Autowow
48
48
  pretty_with_output.run(git_status)
49
49
  end
50
50
 
51
+ def rubygems_credentials_set?
52
+ !quiet.run!("gem push --silent").err.clean_lines.blank?
53
+ end
54
+
51
55
  def gem_clean
52
56
  pretty_with_output.run(clean)
53
57
  end
@@ -0,0 +1,21 @@
1
+ require_relative "../commands/heroku"
2
+
3
+ module Autowow
4
+ module Features
5
+ module Gem
6
+ include Commands::Heroku
7
+ include Executor
8
+
9
+ def app_name
10
+ quiet.run(info).out.clean_lines.select { |line| line.start_with?("===") }.first.split(" ").last
11
+ end
12
+
13
+ def db_migrate
14
+ current_app_name = app_name
15
+
16
+ pretty_with_output.run(pb_reset(current_app_name))
17
+ pretty_with_output.run(migrate(current_app_name))
18
+ end
19
+ end
20
+ end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module Autowow
2
- VERSION = "0.13.2"
2
+ VERSION = "0.14.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autowow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.2
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thisismydesign
@@ -274,6 +274,7 @@ files:
274
274
  - lib/autowow.rb
275
275
  - lib/autowow/cli.rb
276
276
  - lib/autowow/commands/gem.rb
277
+ - lib/autowow/commands/heroku.rb
277
278
  - lib/autowow/commands/os.rb
278
279
  - lib/autowow/commands/rbenv.rb
279
280
  - lib/autowow/commands/vcs.rb
@@ -281,6 +282,7 @@ files:
281
282
  - lib/autowow/executor.rb
282
283
  - lib/autowow/features/fs.rb
283
284
  - lib/autowow/features/gem.rb
285
+ - lib/autowow/features/heroku.rb
284
286
  - lib/autowow/features/os.rb
285
287
  - lib/autowow/features/rbenv.rb
286
288
  - lib/autowow/features/vcs.rb