Class: Upper
- Inherits:
-
Object
- Object
- Upper
- Defined in:
- lib/upper.rb
Instance Attribute Summary collapse
-
#bundler ⇒ Object
readonly
Returns the value of attribute bundler.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#migrator ⇒ Object
readonly
Returns the value of attribute migrator.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Class Method Summary collapse
- .install_hooks(options) ⇒ Object
- .needs ⇒ Object
- .no_git(options) ⇒ Object
- .pre_push_hook(git_command, options) ⇒ Object
- .rebase_on_master!(options) ⇒ Object
- .up_master!(options) ⇒ Object
Instance Method Summary collapse
-
#initialize(env) ⇒ Upper
constructor
A new instance of Upper.
- #install_hooks ⇒ Object
- #no_git ⇒ Object
- #pre_push_hook(git_command) ⇒ Object
- #rebase_on_master! ⇒ Object
- #up_master! ⇒ Object
Constructor Details
#initialize(env) ⇒ Upper
Returns a new instance of Upper.
38 39 40 41 42 43 |
# File 'lib/upper.rb', line 38 def initialize(env) @env = env @repo = env[:repo] @bundler = env[:bundler] @migrator = env[:migrator] end |
Instance Attribute Details
#bundler ⇒ Object (readonly)
Returns the value of attribute bundler.
36 37 38 |
# File 'lib/upper.rb', line 36 def bundler @bundler end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
36 37 38 |
# File 'lib/upper.rb', line 36 def env @env end |
#migrator ⇒ Object (readonly)
Returns the value of attribute migrator.
36 37 38 |
# File 'lib/upper.rb', line 36 def migrator @migrator end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
36 37 38 |
# File 'lib/upper.rb', line 36 def repo @repo end |
Class Method Details
.install_hooks(options) ⇒ Object
26 27 28 29 |
# File 'lib/upper.rb', line 26 def self.install_hooks() env = NeedsManager.configure(:up, needs, .merge(repo_type: :lazy)) new(env).install_hooks end |
.needs ⇒ Object
7 8 9 |
# File 'lib/upper.rb', line 7 def self.needs [:shell, :repo, :bundler, :migrator] end |
.no_git(options) ⇒ Object
21 22 23 24 |
# File 'lib/upper.rb', line 21 def self.no_git() env = NeedsManager.configure(:up, needs, .merge(repo_type: :lazy)) new(env).no_git end |
.pre_push_hook(git_command, options) ⇒ Object
31 32 33 34 |
# File 'lib/upper.rb', line 31 def self.pre_push_hook(git_command, ) env = NeedsManager.configure(:up, needs, .merge(repo_type: :lazy)) new(env).pre_push_hook(git_command) end |
.rebase_on_master!(options) ⇒ Object
11 12 13 14 |
# File 'lib/upper.rb', line 11 def self.rebase_on_master!() env = NeedsManager.configure(:up, needs, .merge(repo_type: :active)) new(env).rebase_on_master! end |
.up_master!(options) ⇒ Object
16 17 18 19 |
# File 'lib/upper.rb', line 16 def self.up_master!() env = NeedsManager.configure(:up, needs, .merge(repo_type: :active)) new(env).up_master! end |
Instance Method Details
#install_hooks ⇒ Object
62 63 64 |
# File 'lib/upper.rb', line 62 def install_hooks HookManager.install!(env) end |
#no_git ⇒ Object
57 58 59 60 |
# File 'lib/upper.rb', line 57 def no_git bundler.bundle_where_necessary migrator.migrate_where_necessary end |
#pre_push_hook(git_command) ⇒ Object
66 67 68 |
# File 'lib/upper.rb', line 66 def pre_push_hook(git_command) PrePushHook.check(git_command, env) end |
#rebase_on_master! ⇒ Object
51 52 53 54 55 |
# File 'lib/upper.rb', line 51 def rebase_on_master! repo.rebase_on_master! bundler.bundle_where_necessary migrator.migrate_where_necessary end |
#up_master! ⇒ Object
45 46 47 48 49 |
# File 'lib/upper.rb', line 45 def up_master! repo.up_master! bundler.bundle_where_necessary migrator.migrate_where_necessary end |