keep_up 0.2.0 → 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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/bin/keep_up +6 -1
- data/lib/keep_up/application.rb +19 -2
- data/lib/keep_up/null_filter.rb +8 -0
- data/lib/keep_up/skip_filter.rb +12 -0
- data/lib/keep_up/updater.rb +6 -2
- data/lib/keep_up/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70911a9102c02fe33b82355f5bbf25cd631ae7a9
|
4
|
+
data.tar.gz: 1f7fcd97b471795d3278484384b92c2f6efff2f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee2f377e57c84a9e47d0c58c6585bc86d07c11f1142aa2970ecbec3f015aee0a49904756927cee700f40a4aaacecbaaa1ba95e4d17ea5d3d0edcc472da884a49
|
7
|
+
data.tar.gz: 7a20e839edd119df4f823823a36fef22e05d3a4275122190a05a49bef930bdfa14b1e68e8aa7a4a1d93c9262c481b8dbf96b9eebc927fe3c12ef6c53d4646a70
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -37,7 +37,7 @@ to find any updates that cause problems and remove or fix them.
|
|
37
37
|
supervised use it's best to test everything at once at the end and then go
|
38
38
|
back and fix things. However, for automation it may be helpful to fully check
|
39
39
|
each commit.
|
40
|
-
*
|
40
|
+
* Automatically set up a new branch so you don't have to.
|
41
41
|
* Create a pull request with the created commits.
|
42
42
|
* Re-try with combinations of updates if single updates don't work: Sometimes
|
43
43
|
two or more dependencies need to be updated together due to their
|
data/bin/keep_up
CHANGED
@@ -5,7 +5,8 @@ require_relative '../lib/keep_up'
|
|
5
5
|
|
6
6
|
options = {
|
7
7
|
local: false,
|
8
|
-
test_command: 'bundle exec rake'
|
8
|
+
test_command: 'bundle exec rake',
|
9
|
+
skip: []
|
9
10
|
}
|
10
11
|
OptionParser.new do |parser|
|
11
12
|
parser.on('--[no-]local') do |local|
|
@@ -15,6 +16,10 @@ OptionParser.new do |parser|
|
|
15
16
|
parser.on('--test-command=COMMAND') do |command|
|
16
17
|
options[:test_command] = command
|
17
18
|
end
|
19
|
+
|
20
|
+
parser.on('--skip=SKIPPED_GEM') do |gemname|
|
21
|
+
options[:skip] << gemname
|
22
|
+
end
|
18
23
|
end.parse!
|
19
24
|
|
20
25
|
begin
|
data/lib/keep_up/application.rb
CHANGED
@@ -4,6 +4,8 @@ require_relative 'bundle'
|
|
4
4
|
require_relative 'repository'
|
5
5
|
require_relative 'updater'
|
6
6
|
require_relative 'version_control'
|
7
|
+
require_relative 'null_filter'
|
8
|
+
require_relative 'skip_filter'
|
7
9
|
|
8
10
|
module KeepUp
|
9
11
|
# Error thrown when we can't go any further.
|
@@ -12,9 +14,12 @@ module KeepUp
|
|
12
14
|
|
13
15
|
# Main application
|
14
16
|
class Application
|
15
|
-
|
17
|
+
attr_reader :skip
|
18
|
+
|
19
|
+
def initialize(local:, test_command:, skip:)
|
16
20
|
@test_command = test_command
|
17
21
|
@local = local
|
22
|
+
@skip = skip
|
18
23
|
end
|
19
24
|
|
20
25
|
def run
|
@@ -22,15 +27,27 @@ module KeepUp
|
|
22
27
|
report_up_to_date
|
23
28
|
end
|
24
29
|
|
30
|
+
private
|
31
|
+
|
25
32
|
def update_all_dependencies
|
26
33
|
Updater.new(bundle: Bundle.new,
|
27
34
|
repository: Repository.new,
|
28
|
-
version_control: VersionControl.new
|
35
|
+
version_control: VersionControl.new,
|
36
|
+
filter: filter).run
|
29
37
|
end
|
30
38
|
|
31
39
|
def report_up_to_date
|
32
40
|
puts 'Bundle up to date!'
|
33
41
|
puts 'All done!'
|
34
42
|
end
|
43
|
+
|
44
|
+
def filter
|
45
|
+
@filter ||= if skip.any?
|
46
|
+
SkipFilter.new(skip)
|
47
|
+
else
|
48
|
+
NullFilter.new
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
35
52
|
end
|
36
53
|
end
|
data/lib/keep_up/updater.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
+
require_relative 'null_filter'
|
2
|
+
|
1
3
|
module KeepUp
|
2
4
|
# Apply potential updates to a Gemfile.
|
3
5
|
class Updater
|
4
|
-
attr_reader :bundle, :repository, :version_control
|
6
|
+
attr_reader :bundle, :repository, :version_control, :filter
|
5
7
|
|
6
|
-
def initialize(bundle:, repository:, version_control:)
|
8
|
+
def initialize(bundle:, repository:, version_control:, filter: NullFilter.new)
|
7
9
|
@bundle = bundle
|
8
10
|
@repository = repository
|
9
11
|
@version_control = version_control
|
12
|
+
@filter = filter
|
10
13
|
end
|
11
14
|
|
12
15
|
def run
|
@@ -21,6 +24,7 @@ module KeepUp
|
|
21
24
|
|
22
25
|
def possible_updates
|
23
26
|
bundle.direct_dependencies.
|
27
|
+
select { |dep| filter.call dep }.
|
24
28
|
map { |dep| repository.updated_dependency_for dep }.compact
|
25
29
|
end
|
26
30
|
end
|
data/lib/keep_up/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keep_up
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matijs van Zuijlen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -121,8 +121,10 @@ files:
|
|
121
121
|
- lib/keep_up/dependency.rb
|
122
122
|
- lib/keep_up/gemfile_filter.rb
|
123
123
|
- lib/keep_up/gemspec_filter.rb
|
124
|
+
- lib/keep_up/null_filter.rb
|
124
125
|
- lib/keep_up/remote_index.rb
|
125
126
|
- lib/keep_up/repository.rb
|
127
|
+
- lib/keep_up/skip_filter.rb
|
126
128
|
- lib/keep_up/updater.rb
|
127
129
|
- lib/keep_up/version.rb
|
128
130
|
- lib/keep_up/version_control.rb
|
@@ -146,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
148
|
version: '0'
|
147
149
|
requirements: []
|
148
150
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.
|
151
|
+
rubygems_version: 2.5.2
|
150
152
|
signing_key:
|
151
153
|
specification_version: 4
|
152
154
|
summary: Automatically update your dependencies
|