Class: BuPr::Runner
- Inherits:
-
Object
- Object
- BuPr::Runner
- Defined in:
- lib/bu_pr/runner.rb
Instance Attribute Summary collapse
- #config ⇒ BuPr::Configuration readonly
- #git ⇒ BuPr::Git readonly
Class Method Summary collapse
Instance Method Summary collapse
- #bundle_update ⇒ Boolean
- #call ⇒ Object
-
#initialize(opts = {}) ⇒ Runner
constructor
A new instance of Runner.
- #valid? ⇒ Boolean
Constructor Details
#initialize(opts = {}) ⇒ Runner
Returns a new instance of Runner.
22 23 24 25 |
# File 'lib/bu_pr/runner.rb', line 22 def initialize opts = {} @git = Git.new @config = Configuration.new opts end |
Instance Attribute Details
#config ⇒ BuPr::Configuration (readonly)
18 19 20 |
# File 'lib/bu_pr/runner.rb', line 18 def config @config end |
Class Method Details
.call(opts = {}) ⇒ Object
12 13 14 |
# File 'lib/bu_pr/runner.rb', line 12 def call opts = {} new(opts).call end |
Instance Method Details
#bundle_update ⇒ Boolean
41 42 43 |
# File 'lib/bu_pr/runner.rb', line 41 def bundle_update valid? && _bundle_update end |
#call ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/bu_pr/runner.rb', line 27 def call if bundle_update && !git.diff? puts "no update" return end git.push Handlers::Github.call \ config: config, current_branch: git.current_branch end |
#valid? ⇒ Boolean
48 49 50 |
# File 'lib/bu_pr/runner.rb', line 48 def valid? check_config! && check_git! end |