Class: Shards::Repo
- Inherits:
-
Object
- Object
- Shards::Repo
- Defined in:
- lib/shards/repo.rb
Constant Summary collapse
- @@times =
0
Instance Attribute Summary collapse
-
#git ⇒ Object
Returns the value of attribute git.
-
#message ⇒ Object
Returns the value of attribute message.
-
#root ⇒ Object
Returns the value of attribute root.
Instance Method Summary collapse
- #autocommit ⇒ Object
- #autocommit_message ⇒ Object
- #clean ⇒ Object
- #diff ⇒ Object
-
#initialize ⇒ Repo
constructor
A new instance of Repo.
- #live_branch ⇒ Object
Constructor Details
Instance Attribute Details
#git ⇒ Object
Returns the value of attribute git.
8 9 10 |
# File 'lib/shards/repo.rb', line 8 def git @git end |
#message ⇒ Object
Returns the value of attribute message.
8 9 10 |
# File 'lib/shards/repo.rb', line 8 def @message end |
#root ⇒ Object
Returns the value of attribute root.
8 9 10 |
# File 'lib/shards/repo.rb', line 8 def root @root end |
Instance Method Details
#autocommit ⇒ Object
28 29 30 31 32 |
# File 'lib/shards/repo.rb', line 28 def autocommit git.add all: true git.commit git.push 'origin', live_branch end |
#autocommit_message ⇒ Object
34 35 36 |
# File 'lib/shards/repo.rb', line 34 def "[AUTOCOMMIT] #{}" end |
#clean ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/shards/repo.rb', line 20 def clean @@times+=1 git.reset_hard git.clean(force: true, d: true) git.branch(live_branch).checkout git.pull('origin',live_branch) end |
#diff ⇒ Object
38 39 40 41 |
# File 'lib/shards/repo.rb', line 38 def diff git.add all: true git.diff end |
#live_branch ⇒ Object
16 17 18 |
# File 'lib/shards/repo.rb', line 16 def live_branch ENV['LIVE_BRANCH'] || 'v5' end |