bin_install 0.0.5 → 0.0.6

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: e203c040d0df24296e7d0e2e1070458f2582e513
4
- data.tar.gz: bae7535e9e2627489ff80f08752d904c31621bf2
3
+ metadata.gz: b60f285eadaf3e28288b02505d085339c566b5d5
4
+ data.tar.gz: 3f509887bcc072b5e1048416175bec8185370053
5
5
  SHA512:
6
- metadata.gz: 1e5190d4ea6a4e51359e8ffc231fe950ed6caddaab47f8bdd7830267351a3d0b1f66dcee8059541f3e0e23d6aeadd8f8807125adfaa35e418a4cd182d85c9744
7
- data.tar.gz: 2b3682f8a659c63f9d7abd91e939433f33e536c715ec65444cb67687dd0fd46ba03f89460f66b975890a55a235c89e4024e6ab15a60454e5de82f57705f2f3d9
6
+ metadata.gz: 67e204865a474c81d5eed57e01ac200678bdd9d94e15f38bbaba4559e724e3b454f4570cfee0cdf2f2be9181fdd29bba0431a350b055d6fd9bf3f1f547450e61
7
+ data.tar.gz: 3a8304046f51d80ac8783c0c14de51a0f39efbc9725b9070c2a55e8eca3b718987b38b94df9b9002ef877177ee08a9daa8bb0c18dadbc912c2822a3b590d06e9
data/README.md CHANGED
@@ -54,12 +54,26 @@ Install all [gems](https://rubygems.org/) with:
54
54
 
55
55
  BinInstall::Gem.install # or install!
56
56
 
57
+ ### Git
58
+
59
+ Install [Git](https://git-scm.com/) with:
60
+
61
+ BinInstall::Git.install # or install!
62
+
57
63
  ### Mysql
58
64
 
59
65
  Install [MySQL](https://www.mysql.com/) with:
60
66
 
61
67
  BinInstall::Mysql.install # or install!
62
68
 
69
+ Create root user with blank password:
70
+
71
+ BinInstall::Mysql.create_root # or create_root!
72
+
73
+ Create user with username and password:
74
+
75
+ BinInstall::Mysql.create_user('username', 'password')
76
+
63
77
  ### Node
64
78
 
65
79
  Install [Node.js](https://nodejs.org/en/) and [Yarn](https://yarnpkg.com/en/) with:
@@ -102,6 +116,12 @@ Clear log and tmp files:
102
116
 
103
117
  BinInstall::Rails.clear # or clear!
104
118
 
119
+ ### Redis
120
+
121
+ Install [Redis](https://redis.io/) with:
122
+
123
+ BinInstall::Redis.install # or install!
124
+
105
125
  ### RubyEnvironmentManager
106
126
 
107
127
  Install [rbenv](https://github.com/rbenv/rbenv) unless [RVM](https://rvm.io/) is installed with:
data/bin_install.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ['lib']
23
23
 
24
24
  spec.add_runtime_dependency 'awesome_print', '~> 1.8'
25
- spec.add_runtime_dependency('railties', '>= 4.1.0', '< 6.0')
25
+ spec.add_runtime_dependency('railties', '>= 4.2.0', '< 6.0')
26
26
 
27
27
  spec.add_development_dependency 'bundler', '~> 1.16'
28
28
  spec.add_development_dependency 'pry', '>= 0.10.0'
@@ -0,0 +1,33 @@
1
+ module BinInstall
2
+ module Git
3
+ def self.install
4
+ puts 'Installing Git...'.white
5
+ Brew.install_or_upgrade('git')
6
+ end
7
+
8
+ def self.install!
9
+ puts 'Installing Git...'.white
10
+ Brew.install_or_upgrade!('git')
11
+ end
12
+
13
+ def self.add_remote(name, url)
14
+ if remote?(name)
15
+ puts "Remote #{name} already exists. Skipping.".blue
16
+ else
17
+ system("git remote add #{name} #{url}")
18
+ end
19
+ end
20
+
21
+ def self.add_remote!(name, url)
22
+ if remote?(name)
23
+ puts "Remote #{name} already exists. Skipping.".blue
24
+ else
25
+ BinInstall.system!("git remote add #{name} #{url}")
26
+ end
27
+ end
28
+
29
+ def remote?(name)
30
+ system("git remote get-url #{name}")
31
+ end
32
+ end
33
+ end
@@ -5,11 +5,13 @@ module BinInstall
5
5
  def self.db_setup
6
6
  puts 'Preparing database...'.white
7
7
  rails_or_rake('db:setup')
8
+ rails_or_rake!('db:setup RAILS_ENV=test')
8
9
  end
9
10
 
10
11
  def self.db_setup!
11
12
  puts 'Preparing database...'.white
12
13
  rails_or_rake!('db:setup')
14
+ rails_or_rake!('db:setup RAILS_ENV=test')
13
15
  end
14
16
 
15
17
  def self.db_migrate
@@ -38,7 +40,7 @@ module BinInstall
38
40
  if rails5?
39
41
  system("bin/rails #{command}")
40
42
  else
41
- system("rake #{command}")
43
+ system("bin/rake #{command}")
42
44
  end
43
45
  end
44
46
 
@@ -46,7 +48,7 @@ module BinInstall
46
48
  if rails5?
47
49
  BinInstall.system!("bin/rails #{command}")
48
50
  else
49
- BinInstall.system!("rake #{command}")
51
+ BinInstall.system!("bin/rake #{command}")
50
52
  end
51
53
  end
52
54
 
@@ -0,0 +1,13 @@
1
+ module BinInstall
2
+ module Redis
3
+ def self.install
4
+ puts 'Installing Redis...'.white
5
+ Brew.install_or_upgrade('redis')
6
+ end
7
+
8
+ def self.install!
9
+ puts 'Installing Redis...'.white
10
+ Brew.install_or_upgrade!('redis')
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module BinInstall
2
- VERSION = '0.0.5'.freeze
2
+ VERSION = '0.0.6'.freeze
3
3
  end
data/lib/bin_install.rb CHANGED
@@ -2,6 +2,7 @@ require 'awesome_print'
2
2
 
3
3
  require 'bin_install/brew'
4
4
  require 'bin_install/gem'
5
+ require 'bin_install/git'
5
6
  require 'bin_install/mysql'
6
7
  require 'bin_install/node'
7
8
  require 'bin_install/postgres'
@@ -14,4 +15,8 @@ module BinInstall
14
15
  def self.system!(*args)
15
16
  system(*args) || abort("Command `#{args}` failed!".red)
16
17
  end
18
+
19
+ def app_name
20
+ File.basename(Dir.pwd)
21
+ end
17
22
  end
@@ -6,10 +6,12 @@ APP_ROOT = File.expand_path('..', __dir__)
6
6
  Dir.chdir(APP_ROOT) do
7
7
  BinInstall::Brew.require!
8
8
  BinInstall::Gem.install!
9
+ BinInstall::Git.install
9
10
  BinInstall::RubyEnvironmentManager.install
10
11
  BinInstall::Postgres.install
11
12
  BinInstall::Postgres.create_superuser('postgres')
12
13
  BinInstall::Node.install
14
+ BinInstall::Redis.install
13
15
  BinInstall::Rails.db_setup
14
16
  BinInstall::Rails.clear
15
17
  end
@@ -5,7 +5,7 @@ APP_ROOT = File.expand_path('..', __dir__)
5
5
 
6
6
  Dir.chdir(APP_ROOT) do
7
7
  BinInstall::Gem.install!
8
- BinInstall::Node.yarn_upgrade
8
+ BinInstall::Node.yarn_install
9
9
  BinInstall::Rails.db_migrate
10
10
  BinInstall::Rails.clear
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bin_install
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Singer
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 4.1.0
33
+ version: 4.2.0
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: '6.0'
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 4.1.0
43
+ version: 4.2.0
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '6.0'
@@ -135,10 +135,12 @@ files:
135
135
  - lib/bin_install.rb
136
136
  - lib/bin_install/brew.rb
137
137
  - lib/bin_install/gem.rb
138
+ - lib/bin_install/git.rb
138
139
  - lib/bin_install/mysql.rb
139
140
  - lib/bin_install/node.rb
140
141
  - lib/bin_install/postgres.rb
141
142
  - lib/bin_install/rails.rb
143
+ - lib/bin_install/redis.rb
142
144
  - lib/bin_install/ruby_environment_manager.rb
143
145
  - lib/bin_install/ruby_environment_manager/rbenv.rb
144
146
  - lib/bin_install/ruby_environment_manager/rvm.rb