lgit 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78a058ba7e5a9502ddb1cfca3a8d73e35bd8433b11110c972fdabe934107f424
4
- data.tar.gz: cdcf157eb6c5371c68ba543953457b2cf15ebf39b50db30db402e546002ee578
3
+ metadata.gz: d29e963fe6d26aa9b8de93d7ec5509a3daa9efc4499233fe0d9e0e358b192c95
4
+ data.tar.gz: ccc2fbdbcc21196e970249cf6197c44e803c2faa21a7f9b3f0985ec6e76cd8cf
5
5
  SHA512:
6
- metadata.gz: 07d4446027ffbe1f53c2f4fbeaa2a8e4e023b1514cd95db8ad5dffb5b0a8937e723f4a1872ee5c877fe568b2fe3d5524ef17fa00281d904d184b4e23c20f9a4d
7
- data.tar.gz: e920fbfae441cb993a4d8f0a9841df184d44e71dd23eeeb9aeb1507a0a2a692d6046f447acb718378ac431dec2d590d2519390d9e94b1fec09f151bfe121830e
6
+ metadata.gz: d7238657b5b65fa0918e676090c9c058c2eac04f7b522adece8bf3bf3542541adfc7a500f75363289e9eaa4b43b085770dcc2560038efee4eb89fd443c63f40c
7
+ data.tar.gz: 6c5bf22694a0df071acf6ece731f91ace66c407b4ec35ed8af58262b286114b0e51f2537af4dcf755cbc563a9eed1ec4d676af5d9cc1c5ecfa0ba9a39c1ddfcf
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  /.idea
10
+ *.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lgit (0.1.0)
4
+ lgit (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -10,6 +10,7 @@ GEM
10
10
  rake (10.5.0)
11
11
 
12
12
  PLATFORMS
13
+ ruby
13
14
  x64-mingw32
14
15
 
15
16
  DEPENDENCIES
@@ -19,4 +20,4 @@ DEPENDENCIES
19
20
  rake (~> 10.0)
20
21
 
21
22
  BUNDLED WITH
22
- 1.16.5
23
+ 1.16.6
data/README.md CHANGED
@@ -48,7 +48,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
48
48
 
49
49
  ## Contributing
50
50
 
51
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lgit. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
51
+ Bug reports and pull requests are welcome on GitHub at https://github.com/luladjiev/lgit. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
52
52
 
53
53
  ## License
54
54
 
data/exe/lgit CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "lgit"
4
+ require 'lgit'
4
5
 
5
6
  if ARGV.size.zero?
6
7
  puts 'Specify command'
@@ -14,10 +15,10 @@ when 'branch'
14
15
  git.create_branch ARGV[1]
15
16
  when 'rebase'
16
17
  if git.get_branch == 'master'
17
- puts "Error: Cannot rebase master!"
18
+ puts 'Error: Cannot rebase master!'
18
19
  exit 2
19
20
  end
20
- git.rebase
21
+ git.rebase ARGV[1]
21
22
  when 'delete-branches'
22
23
  git.delete_branches
23
24
  else
data/lib/lgit/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lgit
2
- VERSION = "0.2.1"
2
+ VERSION = '0.3.0'.freeze
3
3
  end
data/lib/lgit.rb CHANGED
@@ -1,9 +1,11 @@
1
- require "lgit/version"
1
+ require 'lgit/version'
2
2
 
3
3
  module Lgit
4
+ ###
5
+ # Git related class
4
6
  class Git
5
- def refresh_master
6
- `git checkout master`
7
+ def refresh_base(base = 'master')
8
+ `git checkout #{base}`
7
9
  `git pull`
8
10
  end
9
11
 
@@ -12,16 +14,16 @@ module Lgit
12
14
  end
13
15
 
14
16
  def create_branch(name)
15
- if name
16
- refresh_master
17
- `git checkout -b #{name}`
18
- end
17
+ return unless name
18
+
19
+ refresh_base
20
+ `git checkout -b #{name}`
19
21
  end
20
22
 
21
- def rebase
22
- refresh_master
23
+ def rebase(base = 'master')
24
+ refresh_base base
23
25
  `git checkout - `
24
- `git rebase master`
26
+ `git rebase #{base}`
25
27
  end
26
28
 
27
29
  def delete_branches
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lgit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Luladjiev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-07 00:00:00.000000000 Z
11
+ date: 2019-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubyforge_project:
98
- rubygems_version: 2.7.3
98
+ rubygems_version: 2.7.8
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Git on steroids