Class: Danger::Staging
- Defined in:
- lib/danger/commands/staging.rb
Instance Attribute Summary
Attributes inherited from Runner
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Staging
constructor
A new instance of Staging.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ Staging
Returns a new instance of Staging.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/danger/commands/staging.rb', line 18 def initialize(argv) show_help = true if argv.arguments == ["-h"] # Currently CLAide doesn't support short option like -h https://github.com/CocoaPods/CLAide/pull/60 # when user pass in -h, mimic the behavior of passing in --help. argv = CLAide::ARGV.new ["--help"] if show_help super if argv.flag?("pry", false) @dangerfile_path = PrySetup.new(cork).setup_pry(@dangerfile_path, Staging.command) end end |
Class Method Details
.options ⇒ Object
12 13 14 15 16 |
# File 'lib/danger/commands/staging.rb', line 12 def self. [ ["--pry", "Drop into a Pry shell after evaluating the Dangerfile."] ] end |
Instance Method Details
#run ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/danger/commands/staging.rb', line 39 def run ENV["DANGER_USE_LOCAL_ONLY_GIT"] = "YES" env = EnvironmentManager.new(ENV, cork) dm = Dangerfile.new(env, cork) dm.run( Danger::EnvironmentManager.danger_base_branch, Danger::EnvironmentManager.danger_head_branch, @dangerfile_path, nil, nil, nil ) end |
#validate! ⇒ Object
32 33 34 35 36 37 |
# File 'lib/danger/commands/staging.rb', line 32 def validate! super unless @dangerfile_path help! "Could not find a Dangerfile." end end |