generic_app 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/generic_app.gemspec +1 -0
- data/lib/generic_app/version.rb +1 -1
- data/lib/generic_app.rb +23 -8
- data/spec/lib/generic_app_spec.rb +8 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f12e546eaa32b1dae94b03ac0366b0ed44d34137
|
4
|
+
data.tar.gz: 43b5a0cac493c94ac8eb443b80386824246aca72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8837c27614ae352987fcf3e57ad2849c3e35c34751562c629a6047f539adece1e46b2f15767b9eea6ad1b3463213b37accf91d92920731151fa7f79d5978e721
|
7
|
+
data.tar.gz: 9fd02f93938fef69009f59f673c85648c077cb2c0db7573055f8b561510dbd9e1e8653361bfe3b3c7bfd43c4cfe91ae78f65dd57367ebf8c8514cf156f853cff
|
data/generic_app.gemspec
CHANGED
data/lib/generic_app/version.rb
CHANGED
data/lib/generic_app.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
URL_TEMPLATE = 'https://github.com/jhsu802701/rails-20170811-165620-143.git'.freeze
|
2
2
|
|
3
3
|
require 'generic_app/version'
|
4
4
|
require 'string_in_file'
|
@@ -14,22 +14,27 @@ module GenericApp
|
|
14
14
|
def self.create_new(subdir_name, email, title)
|
15
15
|
t1 = Thread.new { self.git_clone(subdir_name) }
|
16
16
|
t1.join
|
17
|
+
self.remove_neutrino(subdir_name)
|
17
18
|
self.remove_heroku_name(subdir_name)
|
18
19
|
self.email_update(subdir_name, email)
|
19
20
|
self.remove_badges(subdir_name)
|
20
21
|
self.update_titles(subdir_name, title)
|
21
22
|
self.git_init(subdir_name)
|
23
|
+
self.print_end_msg(subdir_name)
|
22
24
|
end
|
23
25
|
|
24
26
|
def self.remove_heroku_name(subdir_name)
|
25
27
|
File.delete("#{subdir_name}/config/heroku_name.txt")
|
26
28
|
end
|
27
29
|
|
30
|
+
def self.remove_neutrino(subdir_name)
|
31
|
+
File.delete("#{subdir_name}/neutrino.sh")
|
32
|
+
end
|
33
|
+
|
28
34
|
def self.git_clone(subdir_name)
|
29
35
|
puts '------------------------------------'
|
30
36
|
puts 'Downloading the Generic App Template'
|
31
|
-
|
32
|
-
system("git clone #{url_template} #{subdir_name}")
|
37
|
+
system("git clone #{URL_TEMPLATE} #{subdir_name}")
|
33
38
|
end
|
34
39
|
|
35
40
|
def self.email_update(subdir_name, email)
|
@@ -44,11 +49,10 @@ module GenericApp
|
|
44
49
|
|
45
50
|
def self.remove_badges(subdir_name)
|
46
51
|
path_readme = "#{subdir_name}/README.md"
|
47
|
-
|
48
|
-
|
49
|
-
LineContaining.
|
50
|
-
LineContaining.delete(
|
51
|
-
LineContaining.delete(line2, path_readme)
|
52
|
+
LineContaining.delete('[![CircleCI](https://circleci.com', path_readme)
|
53
|
+
LineContaining.delete('[![Dependency Status](https://gemnasium.com', path_readme)
|
54
|
+
LineContaining.delete('[![security](https://hakiri.io', path_readme)
|
55
|
+
LineContaining.delete('[![Code Climate](https://codeclimate.com', path_readme)
|
52
56
|
RemoveDoubleBlank.update(path_readme)
|
53
57
|
end
|
54
58
|
|
@@ -75,4 +79,15 @@ module GenericApp
|
|
75
79
|
system("cd #{subdir_name} && git init")
|
76
80
|
system("cd #{subdir_name} && git add .")
|
77
81
|
end
|
82
|
+
|
83
|
+
def self.print_end_msg(subdir_name)
|
84
|
+
puts '-------------------------'
|
85
|
+
puts 'Rails Neutrino timestamp:'
|
86
|
+
system("cd #{subdir_name} && cat config/rails_neutrino_timestamp.txt")
|
87
|
+
puts ''
|
88
|
+
puts "Your new app is at #{subdir_name}"
|
89
|
+
puts ''
|
90
|
+
puts 'Instructions on how to get started are in the file'
|
91
|
+
puts 'README-to_do.txt within your new app.'
|
92
|
+
end
|
78
93
|
end
|
@@ -17,6 +17,10 @@ describe GenericApp do
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
it 'The neutrino.sh script should be removed' do
|
21
|
+
expect(File.exist?("#{dir_app_1}/neutrino.sh")).to eq(false)
|
22
|
+
end
|
23
|
+
|
20
24
|
it 'config/heroku_name.txt should be removed' do
|
21
25
|
expect(File.exist?("#{dir_app_1}/config/heroku_name.txt")).to eq(false)
|
22
26
|
end
|
@@ -28,11 +32,10 @@ describe GenericApp do
|
|
28
32
|
end
|
29
33
|
|
30
34
|
it 'Badges should be removed from README.md' do
|
31
|
-
expect(StringInFile.present('
|
32
|
-
expect(StringInFile.present('[
|
33
|
-
expect(StringInFile.present('[
|
34
|
-
expect(StringInFile.present('[
|
35
|
-
expect(StringInFile.present('[Code Climate]', "#{dir_app_1}/README.md")).to eq(false)
|
35
|
+
expect(StringInFile.present('[![CircleCI](https://circleci.com', "#{dir_app_1}/README.md")).to eq(false)
|
36
|
+
expect(StringInFile.present('[![Dependency Status](https://gemnasium.com', "#{dir_app_1}/README.md")).to eq(false)
|
37
|
+
expect(StringInFile.present('[![security](https://hakiri.io', "#{dir_app_1}/README.md")).to eq(false)
|
38
|
+
expect(StringInFile.present('[![Code Climate](https://codeclimate.com', "#{dir_app_1}/README.md")).to eq(false)
|
36
39
|
end
|
37
40
|
|
38
41
|
it 'The specified app title should be provided in place of "Generic App Template"' do
|
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: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Hsu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
187
|
version: '0'
|
188
188
|
requirements: []
|
189
189
|
rubyforge_project:
|
190
|
-
rubygems_version: 2.6.
|
190
|
+
rubygems_version: 2.6.12
|
191
191
|
signing_key:
|
192
192
|
specification_version: 4
|
193
193
|
summary: Save time by instantly create a generic Rails app.
|