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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b86ba66bac945514f38c68e8de37ae515134c47
4
- data.tar.gz: 7deb794a5a5f24cd0151f241b0536c01f195a700
3
+ metadata.gz: f12e546eaa32b1dae94b03ac0366b0ed44d34137
4
+ data.tar.gz: 43b5a0cac493c94ac8eb443b80386824246aca72
5
5
  SHA512:
6
- metadata.gz: 4bea14bd3e2b62d1585dbd39c100a01334d241ca1d1c1d2e704f0135d97e828df8922c9d0889bd639fa1ab7d466c54e839ad32567c1f6747d9eb1ec790c7e729
7
- data.tar.gz: f63947185223b780296b15513ab413e35504b8f116a2b26e44f2e25aeea27321fed432c78581db52ec13f29d2d8f5aeb959e891c893cccde434865ff1ae5452a
6
+ metadata.gz: 8837c27614ae352987fcf3e57ad2849c3e35c34751562c629a6047f539adece1e46b2f15767b9eea6ad1b3463213b37accf91d92920731151fa7f79d5978e721
7
+ data.tar.gz: 9fd02f93938fef69009f59f673c85648c077cb2c0db7573055f8b561510dbd9e1e8653361bfe3b3c7bfd43c4cfe91ae78f65dd57367ebf8c8514cf156f853cff
data/generic_app.gemspec CHANGED
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'generic_app/version'
@@ -1,3 +1,3 @@
1
1
  module GenericApp
2
- VERSION = '2.0.2'.freeze
2
+ VERSION = '2.1.0'.freeze
3
3
  end
data/lib/generic_app.rb CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
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
- url_template = StringInFile.read("#{DIR_MAIN}/lib/generic_app/git_clone_url.txt")
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
- line1 = 'BEGIN: continuous integration badges'
48
- line2 = 'END: continuous integration badges'
49
- LineContaining.delete_between(line1, line2, path_readme)
50
- LineContaining.delete(line1, path_readme)
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('continuous integration badges', "#{dir_app_1}/README.md")).to eq(false)
32
- expect(StringInFile.present('[CircleCI]', "#{dir_app_1}/README.md")).to eq(false)
33
- expect(StringInFile.present('[Dependency Status]', "#{dir_app_1}/README.md")).to eq(false)
34
- expect(StringInFile.present('[security]', "#{dir_app_1}/README.md")).to eq(false)
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.2
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-02-07 00:00:00.000000000 Z
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.10
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.