lib/danger/commands/init.rb in danger-0.5.2 vs lib/danger/commands/init.rb in danger-0.6.0

- old
+ new

@@ -73,11 +73,11 @@ ui.say "There's a collection of small, simple ideas in here, but Danger is about being able to easily" ui.say "iterate. The power comes from you have the ability to codify fixes to some of the problems" ui.say "that come up in day to day programming. It can be difficult to try and see those from day 1." ui.say "\nIf you'd like to investigate the file, and make some changes - I'll wait here," - ui.say "press return when you're ready to move on…" + ui.say "press return when you're ready to move on..." ui.wait_for_return end def setup_github_account ui.header 'Step 2: Creating a GitHub account' @@ -94,11 +94,11 @@ ui.link 'https://www.google.com/search?q=robot&tbs=sur:fmc&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwjgy8-f95jLAhWI7hoKHV_UD00QsAQIMQ&biw=1265&bih=1359' ui.say "" note_about_clicking_links ui.pause 1 - ui.say "\nCool, please press return when you have your account ready (and you've verified the email…)" + ui.say "\nCool, please press return when you have your account ready (and you've verified the email...)" ui.wait_for_return end def setup_access_token ui.header 'Step 3: Configuring a GitHub Personal Access Token' @@ -109,25 +109,25 @@ @is_open_source = ui.ask_with_answers("For token access rights, I need to know if this is for an Open Source or Closed Source project\n", ["Open", "Closed"]) if considered_an_oss_repo? ui.say "For Open Source projects, I'd recommend giving the token the smallest scope possible." - ui.say "This means only providing access to " + "public_info".yellow + " in the token.\n\n" + ui.say "This means only providing access to " + "public_repo".yellow + " in the token.\n\n" ui.pause 1 ui.say "This token limits Danger's abilities to just to writing comments on OSS projects. I recommend" ui.say "this because the token can quite easily be extracted from the environment via pull requests." ui.say "#{@bot_name} does not need admin access to your repo. So its ability to cause chaos is minimalized.\n" elsif @is_open_source == "closed" ui.say "For Closed Source projects, I'd recommend giving the token access to the whole repo scope." ui.say "This means only providing access to " + "repo".yellow + ", and its children in the token.\n\n" ui.pause 1 ui.say "It's worth noting that you " + "should not".bold.white + " re-use this token for OSS repos." - ui.say "Make a new one for those repos with just " + "public_info".yellow + "." + ui.say "Make a new one for those repos with just " + "public_repo".yellow + "." end - ui.say "\n👍, please press return when you have your token set up…" + ui.say "\n👍, please press return when you have your token set up..." ui.wait_for_return end def considered_an_oss_repo? @is_open_source == "open" @@ -143,11 +143,11 @@ uses_travis if File.exist? ".travis.yml" uses_circle if File.exist? "circle.yml" unsure_ci unless File.exist?(".travis.yml") || File.exist?(".circle.yml") - ui.say "\nOK, I'll give you a moment to do this…" + ui.say "\nOK, I'll give you a moment to do this..." ui.wait_for_return ui.say "Final step: exposing the GitHub token as an environment build variable." ui.pause 0.4 if considered_an_oss_repo? @@ -159,11 +159,11 @@ travis_token if File.exist? ".travis.yml" circle_token if File.exist? "circle.yml" unsure_token unless File.exist?(".travis.yml") || File.exist?(".circle.yml") ui.pause 0.6 - ui.say "This is the last step, I can give you a second…" + ui.say "This is the last step, I can give you a second..." ui.wait_for_return end def uses_travis danger = "bundle exec danger".yellow @@ -177,11 +177,11 @@ ui.pause 1 ui.say "You shouldn't use " + "after_success, after_failure, after_script".red + " as they cannot fail your builds." end def uses_circle - danger = "bundle exec danger".yellow + danger = "- bundle exec danger".yellow config = YAML.load(File.read("circle.yml")) if config["test"] if config["test"]["post"] ui.say "Add " + danger + " as a new step in the " + "test:post:".yellow + " section of your circle.yml file." @@ -190,11 +190,11 @@ end else ui.say "Add this to the bottom of your circle.yml file:" ui.say "test:".green ui.say " post:".green - ui.say " - bundle exec danger".green + ui.say " #{danger}".green end end def unsure_ci danger = "bundle exec danger".yellow @@ -219,17 +219,17 @@ ui.say "Before we start, it's important to be up-front. CircleCI only really has one option to support running Danger" ui.say "for forks on OSS repos. It is quite a drastic option, and I want to let you know the best place to understand" ui.say "the ramifications of turning on a setting I'm about to advise.\n" ui.link "https://circleci.com/docs/fork-pr-builds" ui.say "TLDR: If you have anything other than Danger config settings in CircleCI, then you should not turn on the setting." - ui.say "I'll give you a minute to read it…" + ui.say "I'll give you a minute to read it..." ui.wait_for_return ui.say "On Danger/Danger we turn on " + "Permissive building of fork pull requests".yellow + " this exposes the token to Danger" ui.say "You can find this setting at:" ui.link "https://circleci.com/gh/#{current_repo_slug}/edit#experimental\n" - ui.say "I'll hold…" + ui.say "I'll hold..." ui.wait_for_return end ui.say "In order to expose an environment variable, go to:" ui.link "https://circleci.com/gh/#{current_repo_slug}/edit#env-vars" @@ -247,10 +247,10 @@ def info ui.header "Useful info" ui.say "- One of the best ways to test out new rules locally is via " + "bundle exec danger local".yellow + "." ui.pause 0.6 - ui.say "- You can have Danger output all of its variables to the console via the " + "--verbose".yellow + "option." + ui.say "- You can have Danger output all of its variables to the console via the " + "--verbose".yellow + " option." ui.pause 0.6 ui.say "- You can look at the following Dangerfiles to get some more ideas:" ui.pause 0.6 ui.link "https://github.com/danger/danger/blob/master/Dangerfile" ui.link "https://github.com/artsy/eigen/blob/master/Dangerfile"