brewgem 0.0.7 → 0.0.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9777e158044949d398a53dca1497cca994e667a2
4
- data.tar.gz: 4d82542210b80fc4d76ffe48589f545d55bf8b11
3
+ metadata.gz: f41e54a607dcb2da6aab6e00ce10bcde7ae2dbdc
4
+ data.tar.gz: 6ba8542ce8bf65ca4c2bc119716cb0e3b4ef1f72
5
5
  SHA512:
6
- metadata.gz: 9149a85d99c56c0b9fbfc6b159cbb9677e47cfc420d6b78dc9a6c4ba9c08c95f13d2eae54fa6a2fc8e4806572a56606d308e28d51bfd70f7a85ea78ea47cb09a
7
- data.tar.gz: 634d19ec9d5c7f8a9ad082f220aa74e05e868bccdbf62ba8157e1c7644fa99cba22b118e992578cf09570623a341ed236e6c60f2d870b1e9a9f0be5061899862
6
+ metadata.gz: 29f94ffff7462b3c45e6f39595f2984a342d4fa1f6964b0798c8c4cbde7bd0ca726c095049efa5a2b4134c56ff7c3507d4468ce6de348ac532afd10f00a1309a
7
+ data.tar.gz: 00617df965d9d8c2624c9c0735b903e4cd838a8f948842d02f5d67b1835b40678343097ddb03b1762785c1ba24b2d3c5d58c5f94b879c6b0842c68904b48118e
@@ -5,11 +5,7 @@ class RubyGemsDownloadStrategy < AbstractDownloadStrategy
5
5
  def fetch
6
6
  ohai "Fetching #{name} from gem source"
7
7
  HOMEBREW_CACHE.cd do
8
- <% if local_path %>
9
- system "cp", "<%= local_path %>", "."
10
- <% else %>
11
- system "gem", "fetch", name, "--version", resource.version
12
- <% end %>
8
+ system "gem", "fetch", name, "--version", resource.version
13
9
  end
14
10
  end
15
11
 
@@ -22,9 +18,18 @@ class RubyGemsDownloadStrategy < AbstractDownloadStrategy
22
18
  end
23
19
  end
24
20
 
21
+ class LocalGemDownloadStrategy < AbstractDownloadStrategy
22
+ def cached_location
23
+ Pathname.new('<%= local_path %>')
24
+ end
25
+ end
26
+
25
27
  class <%= klass %> < Formula
26
- url "<%= name %>", :using => RubyGemsDownloadStrategy
28
+ url "<%= name %>", :using => <%= local_path ? 'LocalGemDownloadStrategy' : 'RubyGemsDownloadStrategy' %>
27
29
  version "<%= version %>"
30
+ <% if local_path %>
31
+ sha256 '<%= require 'digest'; Digest::SHA256.hexdigest(File.read(local_path)) %>'
32
+ <% end %>
28
33
 
29
34
  def install
30
35
  # Copy user's RubyGems config to temporary build home.
@@ -38,7 +43,7 @@ class <%= klass %> < Formula
38
43
  # they might not be there if, say, we change to a different rvm gemset
39
44
  ENV['GEM_HOME']="#{prefix}"
40
45
  ENV['GEM_PATH']="#{prefix}"
41
- system "gem", "install", "<%= local_path ? local_path : 'cached_download' %>",
46
+ system "gem", "install", cached_download,
42
47
  "--no-ri",
43
48
  "--no-rdoc",
44
49
  "--no-wrapper",
@@ -1,3 +1,3 @@
1
1
  module BrewGem
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brewgem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Peek
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-02-06 00:00:00.000000000 Z
13
+ date: 2016-04-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor