Class: Pantograph::Action
- Inherits:
-
Object
- Object
- Pantograph::Action
- Extended by:
- Forwardable
- Defined in:
- pantograph/lib/pantograph/action.rb
Direct Known Subclasses
Pantograph::Actions::ArtifactoryAction, Pantograph::Actions::BundleInstallAction, Pantograph::Actions::ChangelogFromGitCommitsAction, Pantograph::Actions::ClocAction, Pantograph::Actions::CreatePullRequestAction, Pantograph::Actions::DangerAction, Pantograph::Actions::DebugAction, Pantograph::Actions::DefaultPlatformAction, Pantograph::Actions::DownloadAction, Pantograph::Actions::EnsureBundleExecAction, Pantograph::Actions::EnsureEnvVarsAction, Pantograph::Actions::EnsureGitBranchAction, Pantograph::Actions::EnsureGitStatusCleanAction, Pantograph::Actions::EnsureNoDebugCodeAction, Pantograph::Actions::ErbAction, Pantograph::Actions::GetGithubReleaseAction, Pantograph::Actions::GitBranchAction, Pantograph::Actions::GitCommitAction, Pantograph::Actions::GitPullAction, Pantograph::Actions::GitPullTagsAction, Pantograph::Actions::GitSubmoduleUpdateAction, Pantograph::Actions::GitTagExistsAction, Pantograph::Actions::GithubApiAction, Pantograph::Actions::GradleAction, Pantograph::Actions::ImportAction, Pantograph::Actions::ImportFromGitAction, Pantograph::Actions::IsCiAction, Pantograph::Actions::IsVerboseAction, Pantograph::Actions::JiraAction, Pantograph::Actions::LaneContextAction, Pantograph::Actions::LastGitCommitAction, Pantograph::Actions::MinPantographVersionAction, Pantograph::Actions::NumberOfCommitsAction, Pantograph::Actions::OptOutUsageAction, Pantograph::Actions::PromptAction, Pantograph::Actions::PromptSecureAction, Pantograph::Actions::PushGitTagsAction, Pantograph::Actions::PushToGitRemoteAction, Pantograph::Actions::PutsAction, Pantograph::Actions::ResetGitRepoAction, Pantograph::Actions::RocketAction, Pantograph::Actions::RsyncAction, Pantograph::Actions::RubyVersionAction, Pantograph::Actions::SayAction, Pantograph::Actions::SetGithubReleaseAction, Pantograph::Actions::ShAction, Pantograph::Actions::SkipDocsAction, Pantograph::Actions::SlackAction, Pantograph::Actions::SonarAction, Pantograph::Actions::SshAction, Pantograph::Actions::TwitterAction, Pantograph::Actions::UpdatePantographAction, Pantograph::Actions::ZipAction
Constant Summary collapse
- AVAILABLE_CATEGORIES =
[ :testing, :building, :documentation, :beta, :push, :production, :source_control, :notifications, :misc, :deprecated # This should be the last item ]
- RETURN_TYPES =
[ :string, :array_of_strings, :hash_of_strings, :hash, :bool, :int ]
Class Attribute Summary collapse
-
.runner ⇒ Object
Returns the value of attribute runner.
Class Method Summary collapse
-
.action_name ⇒ Object
instead of “AddGitAction”, this will return “add_git” to print it to the user.
- .author ⇒ Object
- .authors ⇒ Object
- .available_options ⇒ Object
-
.category ⇒ Object
Documentation category, available values defined in AVAILABLE_CATEGORIES.
-
.deprecated_notes ⇒ Object
Describes how the user should handle deprecated an action if its deprecated Returns a string (or nil).
-
.description ⇒ Object
Implement in subclasses.
- .details ⇒ Object
-
.example_code ⇒ Object
Returns an array of string of sample usage of this action.
- .is_supported?(platform) ⇒ Boolean
- .lane_context ⇒ Object
-
.method_missing(method_sym, *arguments, &_block) ⇒ Object
Allows the user to call an action from an action.
-
.other_action ⇒ Object
Return a new instance of the OtherAction action We need to do this, since it has to have access to the runner object.
- .output ⇒ Object
- .return_type ⇒ Object
- .return_value ⇒ Object
- .run(params) ⇒ Object
- .sample_return_value ⇒ Object
-
.shell_out_should_use_bundle_exec? ⇒ Boolean
When shelling out from the actoin, should we use ‘bundle exec`?.
-
.step_text ⇒ Object
Is printed out in the Steps: output in the terminal Return nil if you don’t want any logging in the terminal/JUnit Report.
Class Attribute Details
.runner ⇒ Object
Returns the value of attribute runner.
29 30 31 |
# File 'pantograph/lib/pantograph/action.rb', line 29 def runner @runner end |
Class Method Details
.action_name ⇒ Object
instead of “AddGitAction”, this will return “add_git” to print it to the user
119 120 121 |
# File 'pantograph/lib/pantograph/action.rb', line 119 def self.action_name self.name.split('::').last.gsub('Action', '').pantograph_underscore end |
.author ⇒ Object
83 84 85 |
# File 'pantograph/lib/pantograph/action.rb', line 83 def self. nil end |
.authors ⇒ Object
87 88 89 |
# File 'pantograph/lib/pantograph/action.rb', line 87 def self. nil end |
.available_options ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'pantograph/lib/pantograph/action.rb', line 49 def self. # [ # PantographCore::ConfigItem.new(key: :ipa_path, # env_name: "CRASHLYTICS_IPA_PATH", # description: "Value Description") # ] nil end |
.category ⇒ Object
Documentation category, available values defined in AVAILABLE_CATEGORIES
114 115 116 |
# File 'pantograph/lib/pantograph/action.rb', line 114 def self.category :misc end |
.deprecated_notes ⇒ Object
Describes how the user should handle deprecated an action if its deprecated Returns a string (or nil)
147 148 149 |
# File 'pantograph/lib/pantograph/action.rb', line 147 def self.deprecated_notes nil end |
.description ⇒ Object
Implement in subclasses
41 42 43 |
# File 'pantograph/lib/pantograph/action.rb', line 41 def self.description "No description provided".red end |
.details ⇒ Object
45 46 47 |
# File 'pantograph/lib/pantograph/action.rb', line 45 def self.details nil # this is your chance to provide a more detailed description of this action end |
.example_code ⇒ Object
Returns an array of string of sample usage of this action
103 104 105 |
# File 'pantograph/lib/pantograph/action.rb', line 103 def self.example_code nil end |
.is_supported?(platform) ⇒ Boolean
91 92 93 94 95 96 97 98 99 100 |
# File 'pantograph/lib/pantograph/action.rb', line 91 def self.is_supported?(platform) # you can do things like # true # # platform == :linux # # [:linux, :mac].include?(platform) # UI.crash!("Implementing `is_supported?` for all actions is mandatory. Please update #{self}") end |
.lane_context ⇒ Object
123 124 125 |
# File 'pantograph/lib/pantograph/action.rb', line 123 def self.lane_context Actions.lane_context end |
.method_missing(method_sym, *arguments, &_block) ⇒ Object
Allows the user to call an action from an action
128 129 130 131 |
# File 'pantograph/lib/pantograph/action.rb', line 128 def self.method_missing(method_sym, *arguments, &_block) UI.error("Unknown method '#{method_sym}'") UI.user_error!("To call another action from an action use `other_action.#{method_sym}` instead") end |
.other_action ⇒ Object
Return a new instance of the OtherAction action We need to do this, since it has to have access to the runner object
141 142 143 |
# File 'pantograph/lib/pantograph/action.rb', line 141 def self.other_action return OtherAction.new(self.runner) end |
.output ⇒ Object
58 59 60 61 62 63 64 |
# File 'pantograph/lib/pantograph/action.rb', line 58 def self.output # Return the keys you provide on the shared area # [ # ['NUMBER_OF_COMMITS', 'The path to the newly generated ipa file'] # ] nil end |
.return_type ⇒ Object
66 67 68 69 |
# File 'pantograph/lib/pantograph/action.rb', line 66 def self.return_type # Describes what type of data is expected to be returned, see RETURN_TYPES nil end |
.return_value ⇒ Object
71 72 73 74 |
# File 'pantograph/lib/pantograph/action.rb', line 71 def self.return_value # Describes what this method returns nil end |
.run(params) ⇒ Object
37 38 |
# File 'pantograph/lib/pantograph/action.rb', line 37 def self.run(params) end |
.sample_return_value ⇒ Object
76 77 78 79 80 81 |
# File 'pantograph/lib/pantograph/action.rb', line 76 def self.sample_return_value # Very optional # You can return a sample return value, that might be returned by the actual action # This is currently only used when generating the documentation and running its tests nil end |
.shell_out_should_use_bundle_exec? ⇒ Boolean
When shelling out from the actoin, should we use ‘bundle exec`?
134 135 136 |
# File 'pantograph/lib/pantograph/action.rb', line 134 def self.shell_out_should_use_bundle_exec? return File.exist?('Gemfile') && !Helper.contained_pantograph? end |
.step_text ⇒ Object
Is printed out in the Steps: output in the terminal Return nil if you don’t want any logging in the terminal/JUnit Report
109 110 111 |
# File 'pantograph/lib/pantograph/action.rb', line 109 def self.step_text self.action_name end |