gem-check 0.2.3 → 0.2.4

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: 74e9d0001aaea88249a55483b082bf387f678e24
4
- data.tar.gz: 35ad1ecac4b96e997bb279eb21403e228a08a1ac
3
+ metadata.gz: d4bb5ed1286dccd168236733020b5a74635d5e63
4
+ data.tar.gz: 4de4f37c285863fe3e938d00d75b40f06aab7408
5
5
  SHA512:
6
- metadata.gz: 61dd0a1f98a72ca2685d03da0682f42dcf12ac3d13fd94bb457ae1ae7cca09cd98bd8118beebfedc04cde5be93a0736c808ecad031c2039e65d5bcc716de063d
7
- data.tar.gz: 3ce99d29cb4eb23cc6527e1d54f709a90aae7cb10a9e695d5a53c419ca5e6a6af22d8ba0246c54d3cf5e9c1df1ffcd133ed5d17c909da1c87f6b8b8651147bff
6
+ metadata.gz: 9aa6538fc3b9b156245731856e2cb7a5bb8904eb733ba41f941195216b24322f4834e28dbb9de23679123280799400c9486d4c2e4bc2b7c6a7843dee1ed8eb81
7
+ data.tar.gz: 070d876c531488b2d01d8f58b6650f4ebe53d6a2c1c9edab280c591d514ca19b01a7bb1565d3734f59f0834a8bce3373f3ca694605ca7e581e53b3e57aa6168c
data/README.md CHANGED
@@ -21,6 +21,7 @@ $ gem-check
21
21
  | :--- | :---: |
22
22
  | -f | Don't save the updated stats for this run. |
23
23
  | -h | Display the help screen. |
24
+ | -u | Update gem-check. |
24
25
 
25
26
  ### Note
26
27
  Gem stats data stored in ~/gem-check.json
@@ -1,8 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
  require_relative '../lib/gem-check'
3
3
  include GemCheck
4
- if ARGV.include?("-h")
4
+
5
+ if Checker.option?(ARGV, ['-h','--help', 'help'])
5
6
  Checker.show_help
7
+ elsif Checker.option?(ARGV, ['-u','--update','update'])
8
+ Checker.update
6
9
  else
7
10
  Checker.new(ARGV).check
8
11
  end
@@ -6,6 +6,19 @@ module GemCheck
6
6
  puts "\n Flags:\n"
7
7
  puts " -f Don't save the updated stats for this run."
8
8
  puts " -h Display this help screen."
9
+ puts " -u Update gem-check."
10
+ puts
11
+ end
12
+
13
+ def self.option?(argv, opts)
14
+ argv.any? { |option| opts.include?(option) }
15
+ end
16
+
17
+ def self.update
18
+ puts "\nThis will install the latest version of gem-check."
19
+ print 'Continue? [Yn] '
20
+ response = STDIN.gets.chomp
21
+ puts "\n" + `gem install gem-check` if response.downcase.include?('y')
9
22
  puts
10
23
  end
11
24
 
@@ -27,7 +27,7 @@ module GemCheck
27
27
  return latest_info if @previous_stats.empty?
28
28
  latest_info.each do |row|
29
29
  prev_info = search_by_column(@previous_stats, COL_NAME, row[COL_NAME])
30
- prev_info = search_by_column(prev_info, COL_VER, row[COL_VER]) unless prev_info.empty?
30
+ prev_info = search_by_column(prev_info, COL_VER, row[COL_VER])
31
31
  prev_info = prev_info.first || new_version_info(row)
32
32
  calc_new_downloads(COL_TDL, row, prev_info)
33
33
  calc_new_downloads(COL_VDL, row, prev_info)
@@ -1,3 +1,3 @@
1
1
  module GemCheck
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meissa Dia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-31 00:00:00.000000000 Z
11
+ date: 2018-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gems