Class: Neetob::CLI::Github::MakePr::Script
- Defined in:
- lib/neetob/cli/github/make_pr/script.rb
Constant Summary
Constants inherited from Base
Base::BRANCH_NAME, Base::PR_TITLE
Constants inherited from Base
Instance Attribute Summary collapse
-
#apps ⇒ Object
Returns the value of attribute apps.
-
#path_to_the_script_file ⇒ Object
Returns the value of attribute path_to_the_script_file.
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
Attributes inherited from Base
Attributes inherited from Base
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(apps, path_to_the_script_file, pr_title, branch_name, sandbox = false) ⇒ Script
constructor
A new instance of Script.
- #run ⇒ Object
Methods inherited from Base
#check_for_apps_and_all_neeto_repos_option
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize(apps, path_to_the_script_file, pr_title, branch_name, sandbox = false) ⇒ Script
Returns a new instance of Script.
14 15 16 17 18 19 |
# File 'lib/neetob/cli/github/make_pr/script.rb', line 14 def initialize(apps, path_to_the_script_file, pr_title, branch_name, sandbox = false) super(pr_title, branch_name) @apps = apps @sandbox = sandbox @path_to_the_script_file = path_to_the_script_file end |
Instance Attribute Details
#apps ⇒ Object
Returns the value of attribute apps.
12 13 14 |
# File 'lib/neetob/cli/github/make_pr/script.rb', line 12 def apps @apps end |
#path_to_the_script_file ⇒ Object
Returns the value of attribute path_to_the_script_file.
12 13 14 |
# File 'lib/neetob/cli/github/make_pr/script.rb', line 12 def path_to_the_script_file @path_to_the_script_file end |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
12 13 14 |
# File 'lib/neetob/cli/github/make_pr/script.rb', line 12 def sandbox @sandbox end |
Instance Method Details
#run ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/neetob/cli/github/make_pr/script.rb', line 21 def run matching_apps = find_all_matching_apps(apps, :github, sandbox) delete_and_create_temp_neetob_dir matching_apps.each do |app| ui.info("\n Working on #{app} \n") begin clone_app_in_tmp_dir(app) check_and_delete_remote_branch(app) execute_script(app) ui.info(add_commmit_and_push_changes(app)) delete_local_feature_branch(app) res = client.create_pull_request(app, "main", branch_name, pr_title) ui.success("PR created in \"#{app}\" project successfully.") rescue StandardError => e ExceptionHandler.new(e).process end end `rm -rf /tmp/neetob` end |