bundleup 0.1.0 → 0.2.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: 865cab477561de59cdd1c114ffa36195af57e18b
4
- data.tar.gz: 71f4619cc728bcf78006f7fdb60348aa6a482756
3
+ metadata.gz: d61632914c5c1ca565a988a58d9afe3eb87b20b8
4
+ data.tar.gz: 5acef44c5c76ba56f4b45f8691440b3d5b821a8e
5
5
  SHA512:
6
- metadata.gz: 3e6ebb3f257b644fa58e4b8da2644fc9a2e5c86618a18389a6812372d8c9d483e26f4bde6e9f4ae39acc11f53a54b18bb31341dc9f5d64e744b5d29a497ea390
7
- data.tar.gz: 3c8247f33348a73606f922dd3de4c876226b5ccfe6c9f6f570597b0a0a99fd1167d3792c976a2b531dfeac01b49c4cf4a6bec0a1944ba7cea00ff63cfc4565de
6
+ metadata.gz: f760e4e30738338457bb265e70a8019e24b72495fdc0a40931598b58f4504cbdf7c557d1a87f078836ab93124d37ccdaab8cbcb9c86a5cf9add431175cd3a59e
7
+ data.tar.gz: 9c0fcc6014120a5bbf4a844ff58b61816a81dc19b6927d6e0e41d5188af9da329481c454f85a804925e8413c364d2e7c1feaebeebfe59507450e30e3027c9411
@@ -8,9 +8,17 @@ bundleup is in a pre-1.0 state. This means that its APIs and behavior are subjec
8
8
 
9
9
  * Your contribution here!
10
10
 
11
+ ## [0.2.0][] (2015-12-26)
12
+
13
+ * Animated spinner during long-running bundler commands
14
+ * Rather than run `bundle` in a temp directory, run within the current
15
+ directory, making a backup copy of Gemfile.lock. This ensures that relative
16
+ paths and `.bundle/config` are honored.
17
+
11
18
  ## 0.1.0 (2015-12-24)
12
19
 
13
20
  * Initial release
14
21
 
15
22
  [Semver]: http://semver.org
16
- [Unreleased]: https://github.com/mattbrictson/bundleup/compare/v0.1.0...HEAD
23
+ [Unreleased]: https://github.com/mattbrictson/bundleup/compare/v0.2.0...HEAD
24
+ [0.2.0]: https://github.com/mattbrictson/bundleup/compare/v0.1.0...v0.2.0
data/README.md CHANGED
@@ -36,11 +36,11 @@ That’s it!
36
36
 
37
37
  ## How it works
38
38
 
39
- bundleup starts by making a copy of your Gemfile and Gemfile.lock into a temporary working directory. Within that directory, it runs `bundle show`, then `bundle update` and `bundle show` again to find what gems versions are being used before and after Bundler does its updating magic. (Since gems are actually being installed into your Ruby environment during these steps, the process may take a few moments to complete, especially if gems with native extensions need to be compiled.)
39
+ bundleup starts by making a backup copy of your Gemfile.lock. Next it runs `bundle show`, then `bundle update` and `bundle show` again to find what gems versions are being used before and after Bundler does its updating magic. (Since gems are actually being installed into your Ruby environment during these steps, the process may take a few moments to complete, especially if gems with native extensions need to be compiled.)
40
40
 
41
- Finally, bundleup runs `bundle outdated` to see the gems that were *not* updated due to Gemfile restrictions.
41
+ Finally, bundleup runs `bundle outdated` to see the gems that were *not* updated due to Gemfile restrictions. It then restores your original Gemfile.lock from the backup, leaving your project as it started.
42
42
 
43
- Since all this takes place in a temporary directory, your project’s actual Gemfile.lock is not affected. After displaying its findings, bundleup gives you the option of running `bundle update` once more against your project. This time your Gemfile.lock *will* be changed. You can skip this step if you want.
43
+ After displaying its findings, bundleup gives you the option of running `bundle update` once more against your project. This time your Gemfile.lock *will* be changed. You can skip this step if you want.
44
44
 
45
45
 
46
46
  ## Roadmap
@@ -27,11 +27,16 @@ module Bundleup
27
27
  gets =~ /^($|y)/i
28
28
  end
29
29
 
30
- def progress(message)
31
- print "\e[90m#{message}...\e[0m"
32
- result = yield
30
+ def progress(message, &block)
31
+ print "\e[90m#{message}... \e[0m"
32
+ thread = Thread.new(&block)
33
+ thread.join(0.5)
34
+ %w(/ - \\ |).cycle do |char|
35
+ break if thread.join(0.1)
36
+ print "\r\e[90m#{message}... #{char} \e[0m"
37
+ end
33
38
  puts "\r\e[90m#{message}... OK\e[0m"
34
- result
39
+ thread.value
35
40
  end
36
41
 
37
42
  # Given a two-dimensional Array of strings representing a table of data,
@@ -22,7 +22,7 @@ module Bundleup
22
22
  attr_reader :commands
23
23
 
24
24
  def load
25
- in_temp_dir do
25
+ with_copy_of_lockfile do
26
26
  find_versions(:old)
27
27
  commands.update
28
28
  find_versions(:new)
@@ -30,14 +30,12 @@ module Bundleup
30
30
  end
31
31
  end
32
32
 
33
- def in_temp_dir(&block)
34
- Dir.mktmpdir do |dir|
35
- FileUtils.cp("Gemfile", dir)
36
- FileUtils.cp("Gemfile.lock", dir)
37
- FileUtils.cp(Dir["*.gemspec"], dir) if Dir["*.gemspec"].any?
38
- FileUtils.cp_r("lib", dir) if File.directory?("lib")
39
- Dir.chdir(dir, &block)
40
- end
33
+ def with_copy_of_lockfile
34
+ backup = ".Gemfile.lock.#{rand(1_000_000_000).to_s(36)}"
35
+ FileUtils.cp("Gemfile.lock", backup)
36
+ yield
37
+ ensure
38
+ FileUtils.mv(backup, "Gemfile.lock")
41
39
  end
42
40
 
43
41
  def find_pinned_versions
@@ -1,3 +1,3 @@
1
1
  module Bundleup
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundleup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-24 00:00:00.000000000 Z
11
+ date: 2015-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 2.4.5.1
161
+ rubygems_version: 2.5.1
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: A friendlier command-line interface for Bundler’s `update` and `outdated`