lib/generic_app.rb in generic_app-3.0.13 vs lib/generic_app.rb in generic_app-3.0.14

- old
+ new

@@ -1,14 +1,14 @@ -URL_TEMPLATE = 'https://github.com/jhsu802701/rails-20180126-180222-775.git'.freeze +URL_TEMPLATE = 'https://github.com/jhsu802701/rails-20180313-173135-247.git'.freeze require 'generic_app/version' require 'string_in_file' require 'line_containing' require 'remove_double_blank' require 'open-uri' -# +# rubocop:disable Metrics/ModuleLength module GenericApp # Create app, stick with SQLite database in development def self.create_new(subdir_name, email, title) t1 = Thread.new { git_clone(subdir_name) } t1.join @@ -30,11 +30,11 @@ def self.remove_neutrino(subdir_name) File.delete("#{subdir_name}/neutrino.sh") end def self.update_pg_setup(subdir_name) - open("#{subdir_name}/pg_setup.sh", 'w') do |f| + File.open("#{subdir_name}/pg_setup.sh", 'w') do |f| f.write open('https://gist.githubusercontent.com/jhsu802701/e4d60a972893f78da0f6906a0beeac06/raw/293bd0e74adbfa6b47c81332aa81b84d89770518/pg_setup.sh').read end end def self.git_clone(subdir_name) @@ -54,17 +54,19 @@ end def self.remove_badges(subdir_name) path_readme = "#{subdir_name}/README.md" LineContaining.delete('[![CircleCI](https://circleci.com', path_readme) + LineContaining.delete('[![Build Status](https://travis-ci.org', path_readme) LineContaining.delete('[![Dependency Status](https://gemnasium.com', path_readme) LineContaining.delete('[![security](https://hakiri.io', path_readme) LineContaining.delete('[![Code Climate](https://codeclimate.com', path_readme) LineContaining.delete('[![Maintainability](https://api.codeclimate.com', path_readme) RemoveDoubleBlank.update(path_readme) end + # rubocop:disable Metrics/AbcSize def self.update_titles(subdir_name, title) array_files = [] array_files << "#{subdir_name}/README.md" array_files << "#{subdir_name}/app/helpers/application_helper.rb" array_files << "#{subdir_name}/app/views/layouts/_header.html.erb" @@ -96,16 +98,16 @@ array_files << "#{subdir_name}/test/integration/admin_resend_conf_test.rb" array_files << "#{subdir_name}/test/integration/admin_password_reset_test.rb" array_files << "#{subdir_name}/test/integration/admin_lock_test.rb" array_files << "#{subdir_name}/test/integration/admin_edit_test.rb" - array_files.each do |f| StringInFile.replace('Generic App Template', title, f) StringInFile.replace('GENERIC APP TEMPLATE', title, f) end end + # rubocop:enable Metrics/AbcSize def self.update_todo(subdir_name) url_todo = 'https://gist.github.com/jhsu802701/fdfd6e0732773b379413625463f2d2c0' msg_todo = "Go to #{url_todo} for further instructions." StringInFile.write("#{msg_todo}\n", "#{subdir_name}/README-to_do.txt") @@ -128,5 +130,6 @@ puts '' puts 'Instructions on how to get started are in the file' puts 'README-to_do.txt within your new app.' end end +# rubocop:enable Metrics/ModuleLength