drg 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/drg/tasks/gemfile.rb +1 -1
- data/lib/drg/tasks/gemfile_line.rb +8 -5
- data/lib/drg/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe5612bbc6b87eaeaf65277c348340bd231deaff
|
4
|
+
data.tar.gz: 4f0d9cf837920d0744514599b193722457ef190c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f8b66f4f06e010c7c509d6c96e0d2fdfc15e46d00ff12bc81d2a81a59962fde398cf460dae28e57f620734ec16115e843f51e6420a74afb441e01a2643c52ff
|
7
|
+
data.tar.gz: 1001cf194ff92cd3469314d96b1abd3e1d043a788dd97a129f2f1a9a99bcfb1dcd7bda05562a1c41ae08c5c39eeba5185b78a6b69255085679a414b969742f42
|
data/lib/drg/tasks/gemfile.rb
CHANGED
@@ -26,7 +26,7 @@ module DRG
|
|
26
26
|
lines.each_with_index.each do |line, index|
|
27
27
|
next if line =~ /^\s*#/
|
28
28
|
next if line =~ /:?path:?\s*(=>)?\s*/
|
29
|
-
next if line =~
|
29
|
+
next if line =~ /(:git(hub)?)|(git(hub)?:)\s*(=>)?\s*/
|
30
30
|
next if line =~ /@drg\s+(frozen|ignore|skip)/
|
31
31
|
return GemfileLine.new line, index, name if line =~ /gem\s*['"]#{name}["']/
|
32
32
|
end
|
@@ -18,7 +18,7 @@ module DRG
|
|
18
18
|
def remove_version
|
19
19
|
swap_version('')
|
20
20
|
end
|
21
|
-
|
21
|
+
require 'byebug'
|
22
22
|
# @description Replaces the gem version with the given one
|
23
23
|
# @example
|
24
24
|
#
|
@@ -32,6 +32,7 @@ module DRG
|
|
32
32
|
def swap_version(full_version)
|
33
33
|
code, *comments = line.split(/#/)
|
34
34
|
parts = code.split(',')
|
35
|
+
end_of_line = code.rstrip.end_with?(',') ? ",#{parts.last}" : ''
|
35
36
|
if parts.size == 1
|
36
37
|
parts[0].chomp!
|
37
38
|
parts << " #{full_version}" unless full_version.empty?
|
@@ -46,15 +47,17 @@ module DRG
|
|
46
47
|
if index = parts.index(version_parts.first)
|
47
48
|
# replace the current gem version (inside quotes)
|
48
49
|
parts[index].sub! /['"].+['"]/, full_version
|
49
|
-
# remove white spaces from this item if we're removing the version
|
50
|
-
parts[index].strip! if full_version.empty?
|
51
50
|
else
|
52
51
|
parts.insert 1, " #{full_version}"
|
53
52
|
end
|
54
|
-
parts.reject!
|
53
|
+
parts.reject! { |x| x.strip.empty? }
|
55
54
|
end
|
55
|
+
space_after_gem = parts.first[/\s+$/].to_s
|
56
|
+
space_after_gem = space_after_gem[0, (space_after_gem.size - full_version.size) - 2] if space_after_gem.size > full_version.size
|
57
|
+
parts.first.rstrip!
|
56
58
|
line.replace parts.join(',')
|
57
|
-
line <<
|
59
|
+
line << end_of_line
|
60
|
+
line << space_after_gem << "#" << comments.join if comments.any?
|
58
61
|
line << "\n" unless line.end_with?("\n")
|
59
62
|
line
|
60
63
|
end
|
data/lib/drg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Buckley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|