update_repo 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73a676a06bff85ea1bee76cbd0fd2233c02d97fc
4
- data.tar.gz: 3ef767efdc89c3ae2ce51de70d6467e4a5d2c6e4
3
+ metadata.gz: 216483b2ac26f98ccf9b4b7712059f8876de2d9d
4
+ data.tar.gz: 5fd33a763737cfb1ad7410bf7703b7650e27ddd7
5
5
  SHA512:
6
- metadata.gz: 13c1225abb3a6ad9b74a172330b0f5757a3556228d67d9e78e0a4b030e841e5aafdeca26a13182e7f5f553d13c6087ac5938b0dfd2b66afc85a92cd689e397ea
7
- data.tar.gz: a5d487d0c3cdb9b08205e84f535a3569565843317607993844716e1bd1463b934d0d5fac73215917c7ed2995416defc526a9e0295f82b5adeaf5794b66b641d5
6
+ metadata.gz: 0d4698880b1584aeab7f6f7fd9400fdfe41953cfa1446a2bafcd70f912b73d66dc5ba598fd1671770a509614ed26b794b12300107ed369a10ac36e7546a1d518
7
+ data.tar.gz: 03fadd911508d1b51dbd3ffa5b8adf5fd6b3bd25d6fc1309c7d69ff55d2105d536d4df6ec636440cd4a74b9f8bc1ac6309f6d627baf7f646dda470094ae9b4ff
data/README.md CHANGED
@@ -41,7 +41,15 @@ $ update_repo
41
41
  To be added.
42
42
 
43
43
  #### Command line switches
44
- To be added.
44
+ Options are not required. If none are specified then the program will read from the standard configuration file (~/.updaterepo) and automatically update the specified Repositories.
45
+
46
+ Enter `update_repo --help` at the command prompt to get a list of available options :
47
+ ```
48
+ Options:
49
+ -c, --color, --no-color Use colored output (default: true)
50
+ -v, --version Print version and exit
51
+ -h, --help Show this message
52
+ ```
45
53
 
46
54
  ## To-Do
47
55
  Not in any specific order :
@@ -60,7 +68,6 @@ Not in any specific order :
60
68
  - Add new repo from the command line that will be cloned to the default repo directory and then updated as usual. Extra flag added for "add only, clone later" for offline use.
61
69
  - Add flag for 'default' repo directory (or another specific directory - if it does not already exist it will be created and added to the standard list) which will be used for new additions.
62
70
  - Option to save log file for each run.
63
- - Option to disable the coloured output
64
71
  - Add option to only display a (text) tree of the discovered git repositories, not updating them; Similar option to just dump a list of the remote git locations.
65
72
  - Add ability to export a text dump of each repo location and then re-import this on a different machine or after reinstall
66
73
  - Document configuration file format and options.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'inch/rake'
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
8
  RuboCop::RakeTask.new do |task|
9
- task.options << 'lib'
9
+ task.options << 'lib' << 'exe'
10
10
  end
11
11
 
12
12
  Inch::Rake::Suggest.new do |suggest|
@@ -2,10 +2,10 @@
2
2
  require 'update_repo'
3
3
 
4
4
  # Catch ctrl-c and abort gracefully without Ruby back trace...
5
- Signal.trap('INT') {
5
+ Signal.trap('INT') do
6
6
  print "\r -> ".red, "Aborting on user request.\n\n"
7
7
  exit
8
- }
8
+ end
9
9
 
10
10
  # create a new instance of the class...
11
11
  walk_repo = UpdateRepo::WalkRepo.new
@@ -12,6 +12,7 @@ module UpdateRepo
12
12
 
13
13
  # An encapsulated class to walk the repo directories and update all Git
14
14
  # repositories found therein.
15
+ # rubocop:disable Metrics/ClassLength
15
16
  class WalkRepo
16
17
  # Class constructor. No parameters required.
17
18
  # @return [void]
@@ -42,6 +43,7 @@ module UpdateRepo
42
43
  # walk_repo = UpdateRepo::WalkRepo.new
43
44
  # walk_repo.start
44
45
  def start
46
+ String.disable_colorization = true unless @config['cmd'][:color]
45
47
  show_header(@config['exceptions'])
46
48
  @config['location'].each do |loc|
47
49
  recurse_dir(loc)
@@ -60,11 +62,12 @@ module UpdateRepo
60
62
  exit 1
61
63
  end
62
64
 
63
- # rubocop:disable Metrics//MethodLength
65
+ # rubocop:disable Metrics/MethodLength
64
66
  def set_options
65
67
  Trollop.options do
66
- version "\nupdate_repo version #{VERSION} (C)2016 G. Ramsay\n"
68
+ version "update_repo version #{VERSION} (C)2016 G. Ramsay\n"
67
69
  banner <<-EOS
70
+
68
71
  Keep multiple local Git-Cloned Repositories up to date with one command.
69
72
 
70
73
  Usage:
@@ -76,13 +79,13 @@ specified Repositories.
76
79
 
77
80
  Options:
78
81
  EOS
79
- # opt :color, 'Use colored output', default: true
82
+ opt :color, 'Use colored output', default: true
80
83
  # opt :quiet, 'Only minimal output to the terminal', default: false
81
84
  # opt :silent, 'Completely silent, no output to terminal at all.',
82
85
  # default: false
83
86
  end
84
87
  end
85
- # rubocop:enable Metrics//MethodLength
88
+ # rubocop:enable Metrics/MethodLength
86
89
 
87
90
  # take each directory contained in the Repo directory, if it is detected as
88
91
  # a Git repository then update it (or as directed by command line)
@@ -1,4 +1,4 @@
1
1
  module UpdateRepo
2
2
  # constant, current version of this Gem
3
- VERSION = '0.4.1'.freeze
3
+ VERSION = '0.5.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: update_repo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Ramsay