keep_up 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dockerignore +3 -0
- data/.rubocop.yml +4 -0
- data/.travis.yml +15 -2
- data/CHANGELOG.md +7 -0
- data/Dockerfile +21 -0
- data/LICENSE.txt +1 -1
- data/README.md +0 -1
- data/keep_up.gemspec +1 -1
- data/lib/keep_up/application.rb +2 -3
- data/lib/keep_up/bundle.rb +23 -5
- data/lib/keep_up/updater.rb +3 -2
- data/lib/keep_up/version.rb +1 -1
- data/lib/keep_up/version_control.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdd0e57a8da8920532f77628e540e1cd7bb49487
|
4
|
+
data.tar.gz: 71996aa853b7fd964acd0526e675f50d6dd16c3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56c60b68a732b8a7c1735ba745e59ab2b9a3652affd68ab80c4e803424b13958e1f30a5305b0223e27dd165ab6c3effd7e1565270f5c62d6a2a7e2cec4486677
|
7
|
+
data.tar.gz: bf9091e21a08aab213bf091d789196a3375f6aa796f461073798df6c84350f45f260715d9198719baac6a5f06c8067965f4b9ec2a8738c7b0dcd67bfe0b5e551
|
data/.dockerignore
ADDED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
3
|
rvm:
|
4
|
-
- 2.
|
5
|
-
|
4
|
+
- 2.2.6
|
5
|
+
- 2.3.3
|
6
|
+
- 2.4.0
|
7
|
+
|
8
|
+
before_install:
|
9
|
+
- rvm use @global
|
10
|
+
- gem uninstall bundler -x
|
11
|
+
- gem install bundler --version=1.13.7
|
12
|
+
- bundler --version
|
13
|
+
- git config --global user.email "you@example.com"
|
14
|
+
- git config --global user.name "Your Name"
|
15
|
+
|
16
|
+
branches:
|
17
|
+
only:
|
18
|
+
- master
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.6.0 / 2017-02-04
|
4
|
+
|
5
|
+
* Show actual resulting new version for each update
|
6
|
+
* Fail if only dependencies were updated
|
7
|
+
* Fail if Bundler downgrades the selected dependency
|
8
|
+
* Replace use of custom 'ci' git alias with 'commit'
|
9
|
+
|
3
10
|
## 0.5.1 / 2016-12-17
|
4
11
|
|
5
12
|
* Handle extra and unusual whitespace when updating Gemfile and gemspec
|
data/Dockerfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
FROM ruby:2.4.0
|
2
|
+
|
3
|
+
RUN mkdir /keep_up
|
4
|
+
WORKDIR /keep_up
|
5
|
+
|
6
|
+
# Set up minimum files to run bundler
|
7
|
+
ADD Gemfile /keep_up
|
8
|
+
ADD keep_up.gemspec /keep_up
|
9
|
+
RUN mkdir -p /keep_up/lib/keep_up
|
10
|
+
ADD lib/keep_up/version.rb /keep_up/lib/keep_up
|
11
|
+
ADD .git /keep_up
|
12
|
+
|
13
|
+
RUN bundle install
|
14
|
+
|
15
|
+
RUN gem uninstall bunder -xa
|
16
|
+
RUN gem install bundler --version=1.13.7
|
17
|
+
RUN git config --global user.email "you@example.com"
|
18
|
+
RUN git config --global user.name "Your Name"
|
19
|
+
|
20
|
+
ADD . /keep_up
|
21
|
+
RUN bundle exec rake
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2016 Matijs van Zuijlen
|
3
|
+
Copyright (c) 2016-2017 Matijs van Zuijlen
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -69,7 +69,6 @@ https://github.com/mvz/keep_up. This project is intended to be a safe,
|
|
69
69
|
welcoming space for collaboration, and contributors are expected to adhere to
|
70
70
|
the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
71
71
|
|
72
|
-
|
73
72
|
## License
|
74
73
|
|
75
74
|
The gem is available as open source under the terms of the
|
data/keep_up.gemspec
CHANGED
@@ -28,6 +28,6 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency 'rake', '~> 12.0'
|
29
29
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
30
30
|
spec.add_development_dependency 'aruba', '~> 0.14.2'
|
31
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
31
|
+
spec.add_development_dependency 'rubocop', '~> 0.47.1'
|
32
32
|
spec.add_development_dependency 'pry'
|
33
33
|
end
|
data/lib/keep_up/application.rb
CHANGED
@@ -25,7 +25,7 @@ module KeepUp
|
|
25
25
|
def run
|
26
26
|
sanity_check
|
27
27
|
update_all_dependencies
|
28
|
-
|
28
|
+
report_done
|
29
29
|
end
|
30
30
|
|
31
31
|
private
|
@@ -54,8 +54,7 @@ module KeepUp
|
|
54
54
|
@bundle ||= Bundle.new(definition_builder: definition_builder)
|
55
55
|
end
|
56
56
|
|
57
|
-
def
|
58
|
-
puts 'Bundle up to date!'
|
57
|
+
def report_done
|
59
58
|
puts 'All done!'
|
60
59
|
end
|
61
60
|
|
data/lib/keep_up/bundle.rb
CHANGED
@@ -15,10 +15,12 @@ module KeepUp
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def apply_updated_dependency(dependency)
|
18
|
-
|
18
|
+
report_intent dependency
|
19
19
|
update_gemfile_contents(dependency)
|
20
20
|
update_gemspec_contents(dependency)
|
21
|
-
update_lockfile(dependency)
|
21
|
+
result = update_lockfile(dependency)
|
22
|
+
report_result dependency, result
|
23
|
+
result
|
22
24
|
end
|
23
25
|
|
24
26
|
def check?
|
@@ -29,6 +31,19 @@ module KeepUp
|
|
29
31
|
|
30
32
|
attr_reader :definition_builder
|
31
33
|
|
34
|
+
def report_intent(dependency)
|
35
|
+
print "Updating #{dependency.name}"
|
36
|
+
end
|
37
|
+
|
38
|
+
def report_result(dependency, result)
|
39
|
+
if result
|
40
|
+
puts " to #{result.version}"
|
41
|
+
else
|
42
|
+
puts " to #{dependency.version}"
|
43
|
+
puts 'Update failed'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
32
47
|
def gemfile_dependencies
|
33
48
|
build_dependencies bundler_lockfile.dependencies
|
34
49
|
end
|
@@ -98,12 +113,15 @@ module KeepUp
|
|
98
113
|
end
|
99
114
|
end
|
100
115
|
|
116
|
+
# Update lockfile and return resulting spec, or false in case of failure
|
101
117
|
def update_lockfile(update)
|
102
118
|
Bundler.clear_gemspec_cache
|
103
|
-
definition_builder.build(gems: [update.name])
|
104
|
-
|
119
|
+
definition = definition_builder.build(gems: [update.name])
|
120
|
+
definition.lock('Gemfile.lock')
|
121
|
+
current = locked_spec(update)
|
122
|
+
result = definition.specs.find { |it| it.name == update.name }
|
123
|
+
result if result.version > current.version
|
105
124
|
rescue Bundler::VersionConflict
|
106
|
-
puts 'Update failed'
|
107
125
|
false
|
108
126
|
end
|
109
127
|
end
|
data/lib/keep_up/updater.rb
CHANGED
@@ -14,8 +14,9 @@ module KeepUp
|
|
14
14
|
|
15
15
|
def run
|
16
16
|
possible_updates.each do |update|
|
17
|
-
|
18
|
-
|
17
|
+
result = bundle.apply_updated_dependency update
|
18
|
+
if result
|
19
|
+
version_control.commit_changes result
|
19
20
|
else
|
20
21
|
version_control.revert_changes
|
21
22
|
end
|
data/lib/keep_up/version.rb
CHANGED
@@ -2,7 +2,7 @@ module KeepUp
|
|
2
2
|
# Interface to the version control system (only Git is supported).
|
3
3
|
class VersionControl
|
4
4
|
def commit_changes(dependency)
|
5
|
-
`git
|
5
|
+
`git commit -am "Auto-update #{dependency.name} to #{dependency.version}"`
|
6
6
|
end
|
7
7
|
|
8
8
|
def revert_changes
|
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.6.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:
|
11
|
+
date: 2017-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.47.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.47.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: pry
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,12 +103,14 @@ executables:
|
|
103
103
|
extensions: []
|
104
104
|
extra_rdoc_files: []
|
105
105
|
files:
|
106
|
+
- ".dockerignore"
|
106
107
|
- ".gitignore"
|
107
108
|
- ".rspec"
|
108
109
|
- ".rubocop.yml"
|
109
110
|
- ".travis.yml"
|
110
111
|
- CHANGELOG.md
|
111
112
|
- CODE_OF_CONDUCT.md
|
113
|
+
- Dockerfile
|
112
114
|
- Gemfile
|
113
115
|
- LICENSE.txt
|
114
116
|
- README.md
|