generic_app 3.0.14 → 3.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/generic_app.gemspec +1 -1
- data/lib/generic_app/version.rb +1 -1
- data/lib/generic_app.rb +20 -7
- data/lib/pg_setup.sh +95 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20955c1b9159af36a483135c9cffb56a23e5eea03ef2a3b2f6d35199541447f3
|
4
|
+
data.tar.gz: 5bc59dd1a8e6e1fc5aabc80b60dbc85fe29044d848e0447ef37b39cc23e88f89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cc0ba06e097faf25652f6c5ba534c157899d0f205e3bda5579a1111e7afcd97a603ab7cd34e94e8ad6658c745fd52ed25a78b2ad38fb0ce9cfdb2d01cacae26
|
7
|
+
data.tar.gz: 68267aad0fc88f6ed48e3780ee2762d0dc16a3d48a0a36cc3b1d7bd5e40a3012fe6777cdcba100a2a9a61d17fa61d4da3e0dacd3faad80482c4cdb5e135e1ccc
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/generic_app.svg)](https://badge.fury.io/rb/generic_app)
|
2
2
|
[![Build Status](https://semaphoreci.com/api/v1/jhsu802701/generic_app/branches/master/badge.svg)](https://semaphoreci.com/jhsu802701/generic_app)
|
3
|
-
[![Dependency Status](https://gemnasium.com/badges/github.com/
|
4
|
-
[![security](https://hakiri.io/github/
|
5
|
-
[![
|
6
|
-
[![Test Coverage](https://codeclimate.com/
|
3
|
+
[![Dependency Status](https://gemnasium.com/badges/github.com/rubyonracetracks/generic_app.svg)](https://gemnasium.com/github.com/rubyonracetracks/generic_app)
|
4
|
+
[![security](https://hakiri.io/github/rubyonracetracks/generic_app/master.svg)](https://hakiri.io/github/rubyonracetracks/generic_app/master)
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/05dde6e4ee3abdf0f5d3/maintainability)](https://codeclimate.com/github/rubyonracetracks/generic_app/maintainability)
|
6
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/05dde6e4ee3abdf0f5d3/test_coverage)](https://codeclimate.com/github/rubyonracetracks/generic_app/test_coverage)
|
7
7
|
|
8
8
|
# GenericApp
|
9
9
|
|
@@ -46,7 +46,7 @@ Or install it yourself as:
|
|
46
46
|
|
47
47
|
## Contributing
|
48
48
|
|
49
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
49
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/rubyonracetracks/generic_app. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
50
50
|
|
51
51
|
## License
|
52
52
|
|
@@ -54,4 +54,4 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
54
54
|
|
55
55
|
## Code of Conduct
|
56
56
|
|
57
|
-
Everyone interacting in the GenericApp project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
57
|
+
Everyone interacting in the GenericApp project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rubyonracetracks/generic_app/blob/master/CODE_OF_CONDUCT.md).
|
data/generic_app.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
|
11
11
|
spec.summary = 'Save time by instantly creating a generic Rails app.'
|
12
12
|
spec.description = 'Instead of creating your Rails app from scratch, start with a prebuilt template.'
|
13
|
-
spec.homepage = 'https://github.com/
|
13
|
+
spec.homepage = 'https://github.com/rubyonracetracks/generic_app'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
data/lib/generic_app/version.rb
CHANGED
data/lib/generic_app.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
URL_TEMPLATE = 'https://github.com/
|
1
|
+
URL_TEMPLATE = 'https://github.com/rubyonracetracks/rails-20180402-041538-763.git'.freeze
|
2
2
|
|
3
3
|
require 'generic_app/version'
|
4
4
|
require 'string_in_file'
|
5
5
|
require 'line_containing'
|
6
6
|
require 'remove_double_blank'
|
7
|
-
require 'open-uri'
|
8
7
|
|
9
8
|
# rubocop:disable Metrics/ModuleLength
|
10
9
|
module GenericApp
|
@@ -19,8 +18,10 @@ module GenericApp
|
|
19
18
|
remove_badges(subdir_name)
|
20
19
|
update_titles(subdir_name, title)
|
21
20
|
update_todo(subdir_name)
|
22
|
-
|
21
|
+
remove_travis(subdir_name)
|
22
|
+
update_origin(subdir_name)
|
23
23
|
print_end_msg(subdir_name)
|
24
|
+
git_init(subdir_name) # Goes last
|
24
25
|
end
|
25
26
|
|
26
27
|
def self.remove_heroku_name(subdir_name)
|
@@ -32,9 +33,8 @@ module GenericApp
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def self.update_pg_setup(subdir_name)
|
35
|
-
File.
|
36
|
-
|
37
|
-
end
|
36
|
+
dir_gem_lib = File.expand_path(File.expand_path(__dir__))
|
37
|
+
FileUtils.cp("#{dir_gem_lib}/pg_setup.sh", subdir_name)
|
38
38
|
end
|
39
39
|
|
40
40
|
def self.git_clone(subdir_name)
|
@@ -64,6 +64,12 @@ module GenericApp
|
|
64
64
|
RemoveDoubleBlank.update(path_readme)
|
65
65
|
end
|
66
66
|
|
67
|
+
def self.update_origin(subdir_name)
|
68
|
+
path_readme = "#{subdir_name}/README.md"
|
69
|
+
StringInFile.replace('[Rails Neutrino]', '[Generic App]', path_readme)
|
70
|
+
StringInFile.replace('(https://github.com/rubyonracetracks/rails_neutrino_5)', '(https://github.com/rubyonracetracks/generic_app)', path_readme)
|
71
|
+
end
|
72
|
+
|
67
73
|
# rubocop:disable Metrics/AbcSize
|
68
74
|
def self.update_titles(subdir_name, title)
|
69
75
|
array_files = []
|
@@ -108,7 +114,7 @@ module GenericApp
|
|
108
114
|
# rubocop:enable Metrics/AbcSize
|
109
115
|
|
110
116
|
def self.update_todo(subdir_name)
|
111
|
-
url_todo = 'https://
|
117
|
+
url_todo = 'https://github.com/rubyonracetracks/cheat_sheets/blob/master/post_generic_app.md'
|
112
118
|
msg_todo = "Go to #{url_todo} for further instructions."
|
113
119
|
StringInFile.write("#{msg_todo}\n", "#{subdir_name}/README-to_do.txt")
|
114
120
|
end
|
@@ -131,5 +137,12 @@ module GenericApp
|
|
131
137
|
puts 'Instructions on how to get started are in the file'
|
132
138
|
puts 'README-to_do.txt within your new app.'
|
133
139
|
end
|
140
|
+
|
141
|
+
def self.remove_travis(subdir_name)
|
142
|
+
puts '------------------------'
|
143
|
+
puts 'Removing Travis CI files'
|
144
|
+
File.delete("#{subdir_name}/.travis.yml")
|
145
|
+
File.delete("#{subdir_name}/config/database.yml.travis")
|
146
|
+
end
|
134
147
|
end
|
135
148
|
# rubocop:enable Metrics/ModuleLength
|
data/lib/pg_setup.sh
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# This is the pg_setup.sh script for Rails apps created with Generic App.
|
4
|
+
# The PostgreSQL database names and environment variables are AUTOMATICALLY decided.
|
5
|
+
# You only need to pick a username and password.
|
6
|
+
|
7
|
+
# Output:
|
8
|
+
# First argument if it is not blank
|
9
|
+
# Second argument if first argument is blank
|
10
|
+
anti_blank () {
|
11
|
+
if [ -z "$1" ]; then
|
12
|
+
echo $2
|
13
|
+
else
|
14
|
+
echo $1
|
15
|
+
fi
|
16
|
+
}
|
17
|
+
|
18
|
+
#######################################################################################
|
19
|
+
# BEGIN: setting PostgreSQL database name parameters (db_root, db_dev, db_test, db_pro)
|
20
|
+
#######################################################################################
|
21
|
+
|
22
|
+
dir_root=${PWD##*/} # This directory
|
23
|
+
db_root_pre="db_$dir_root"
|
24
|
+
db_root=`echo $db_root_pre | sed 's/\-/_/g'`
|
25
|
+
|
26
|
+
db_dev="${db_root}_dev"
|
27
|
+
db_test="${db_root}_test"
|
28
|
+
db_pro="${db_root}_pro"
|
29
|
+
|
30
|
+
#################################################################################
|
31
|
+
# FINISHED: setting PostgreSQL database name parameters (db_dev, db_test, db_pro)
|
32
|
+
#################################################################################
|
33
|
+
|
34
|
+
####################################################################################
|
35
|
+
# BEGIN: setting names of environment variables (env_var_username, env_var_password)
|
36
|
+
####################################################################################
|
37
|
+
|
38
|
+
env_var_root="var_${db_root}"
|
39
|
+
env_var_username="${env_var_root}_username"
|
40
|
+
env_var_password="${env_var_root}_password"
|
41
|
+
|
42
|
+
#######################################################################################
|
43
|
+
# FINISHED: setting names of environment variables (env_var_username, env_var_password)
|
44
|
+
#######################################################################################
|
45
|
+
|
46
|
+
######################################
|
47
|
+
# BEGIN: getting username and password
|
48
|
+
######################################
|
49
|
+
|
50
|
+
db_username_def="username_${db_root}"
|
51
|
+
echo
|
52
|
+
echo "Default username: ${db_username_def}"
|
53
|
+
echo 'Enter the desired username for the database:'
|
54
|
+
read db_username_sel
|
55
|
+
db_username=$(anti_blank $db_username_sel $db_username_def)
|
56
|
+
|
57
|
+
db_password_def="long_way_stinks"
|
58
|
+
echo
|
59
|
+
echo "Default password: ${db_password_def}"
|
60
|
+
echo
|
61
|
+
echo 'Do NOT use spaces or other whitespace characters in your password.'
|
62
|
+
echo 'If you are using this script in the production environment, you are'
|
63
|
+
echo 'advised to use KeePassX or other password management software to'
|
64
|
+
echo 'generate, encrypt, and store your database username and password.'
|
65
|
+
echo
|
66
|
+
echo 'Enter the desired password for the database:'
|
67
|
+
read db_password_sel
|
68
|
+
db_password=$(anti_blank $db_password_sel $db_password_def)
|
69
|
+
|
70
|
+
echo
|
71
|
+
echo "Database name (development): ${db_dev}"
|
72
|
+
echo "Database name (testing): ${db_test}"
|
73
|
+
echo "Database name (production): ${db_pro}"
|
74
|
+
echo
|
75
|
+
echo 'Environmental variable names'
|
76
|
+
echo "Username: ${env_var_username}"
|
77
|
+
echo "Password: ${env_var_password}"
|
78
|
+
echo
|
79
|
+
echo "Username: ${db_username}"
|
80
|
+
echo "Password: ${db_password}"
|
81
|
+
|
82
|
+
#########################################
|
83
|
+
# FINISHED: getting username and password
|
84
|
+
#########################################
|
85
|
+
|
86
|
+
sh pg-start.sh
|
87
|
+
|
88
|
+
echo '--------------'
|
89
|
+
echo 'bundle install'
|
90
|
+
bundle install # Needed to run pg_setup.rb
|
91
|
+
|
92
|
+
ruby pg_setup.rb $db_dev $db_test $db_pro $env_var_username $env_var_password $db_username $db_password
|
93
|
+
|
94
|
+
echo "Enter the command 'sh git_check.sh' to continue."
|
95
|
+
echo ''
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: generic_app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Hsu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -210,8 +210,9 @@ files:
|
|
210
210
|
- git_check.sh
|
211
211
|
- lib/generic_app.rb
|
212
212
|
- lib/generic_app/version.rb
|
213
|
+
- lib/pg_setup.sh
|
213
214
|
- long_test.sh
|
214
|
-
homepage: https://github.com/
|
215
|
+
homepage: https://github.com/rubyonracetracks/generic_app
|
215
216
|
licenses:
|
216
217
|
- MIT
|
217
218
|
metadata: {}
|