git_on 0.2.0 → 0.2.1

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: 87c6dd9f782ee1b33527129a1cc51ded9a62f37621bf4dcc8c5cd73190307006
4
- data.tar.gz: 71e5eed08c4e58f3f84ce33811ca62ec7b92c79b8e1bb7ddc8b1934f84b70cba
3
+ metadata.gz: e225f61e476a42cedaf2684e82e5e796a062ba2d5e28bae8a875988442f25624
4
+ data.tar.gz: 84b8f30351ebc2c22d6679c3a40d1198d6d686de147f52c2e03019a7fba52ec5
5
5
  SHA512:
6
- metadata.gz: a6c0906be89d1ed3c5012339ce1ed5e9ca766fd1e320f68eb6f3f91a8276134d8dad8f4e5db06dea0341b9be4480ab6db9e943523a2d1b9008faaf51da73f816
7
- data.tar.gz: d4ec0b92ade50843231334afc83783a908c5588d3c91d0186f56b8dc6b97e180b669c65ca71819962e3932696ce44ad50edd81f0731861410147acde2aff70af
6
+ metadata.gz: 1ec8eef208fcf4d4ada79378f2975a835fed4a0b5bd519e9a36ded4acb9ba4334ca0412db1d85eeb941513657f19475f348b6f33afc48c0588c05b4cb1b2954f
7
+ data.tar.gz: 2e1abec5824dec2f03edbef315015759ed7aedc8d88b8a83809f78f6d8d79c0f7cba14f7057e4114276fcf56430776fd20658b3e6070bdee20944048dd5e3235
data/exe/git_on CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative '../lib/git_on'
4
4
 
5
- status = GitOn.status
5
+ status = GitOn.status(`pwd`.chomp)
6
6
  status_text = "Git is #{status[:git]}"
7
7
  if status[:git] == :active
8
8
  if status[:branch]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitOn
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
data/lib/git_on.rb CHANGED
@@ -3,9 +3,9 @@
3
3
  require_relative "git_on/version"
4
4
 
5
5
  module GitOn
6
- def self.status
6
+ def self.status(directory: nil)
7
7
  return {git: :uninstalled} unless system("git -v &> /dev/null")
8
- dir = File.dirname(caller_locations[0].path)
8
+ directory ||= File.dirname(caller_locations[0].path)
9
9
  status_result = `cd '#{dir}' &> /dev/null; git status 2> /dev/null`
10
10
  return {git: :inactive} unless $?.success?
11
11
  return {git: :active, branch: nil} unless status_result =~ /On\s+branch\s+(\w+)/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_on
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard LeBer