gem-wrappers 0.9.0 → 0.9.1

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: 98aaf8bdf23a01b308bc8baf137d52b5c17dff41
4
- data.tar.gz: 2a83e18c650959c196b43f543fc8a0677b798ff5
3
+ metadata.gz: f4b7a3de7a69888ea3ab65dbed724ca6ef070f27
4
+ data.tar.gz: 688894fb36fe28be24030fd006f62e658e43bd25
5
5
  SHA512:
6
- metadata.gz: 8401c8ac96d066a0e8fba01293ebbb5ec91d7bdbf7b859db3c2da21bb4a21ecd407767bf218ec49a6e449c3bc2122f6eea979922185944394e2f0954f67c1277
7
- data.tar.gz: fca23f20bae605b5cf795dbb5d67b26858e1c7e16e4812d95fdca394504ee8ea5b5dadd8879e0f24e52e3100f00b78e0f25981d451f330939cb9c5caa2c4fab5
6
+ metadata.gz: ae428b831abdf7f0a45646bc619a0946137d870b76fd1f9b606f3b0e7cfcacc582264c5c61896e63359b990c900a14043710f754f72cd5d487c39195d9b62b09
7
+ data.tar.gz: 08f978347b9c1d34c38f91ce6d1e30320d4a480ffa39bf17a3c16fb269bb8f979e552eb72c669aa7a7738ce859adb649347bd37d7e59738bc7dd7bac73f0f2db
@@ -12,6 +12,7 @@ File.open('nmake.bat', 'w') { |f| }
12
12
  $: << File.expand_path("../../../lib", __FILE__)
13
13
 
14
14
  # load the command
15
+ require 'rubygems'
15
16
  require 'gem-wrappers/command'
16
17
 
17
18
  # call the actions
data/gem-wrappers.gemspec CHANGED
@@ -14,7 +14,6 @@ Gem::Specification.new do |s|
14
14
  s.extensions = %w( ext/wrapper_generator/extconf.rb )
15
15
  s.files = `git ls-files`.split("\n")
16
16
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
- s.required_ruby_version = ">= 2.0.0"
18
17
  %w{rake minitest simplecov coveralls redcarpet}.each do |name|
19
18
  s.add_development_dependency(name)
20
19
  end
data/lib/gem-wrappers.rb CHANGED
@@ -6,7 +6,7 @@ module GemWrappers
6
6
  def self.install(executables)
7
7
  environment = GemWrappers::Environment.new
8
8
  environment.ensure
9
- wrappers = GemWrappers::Installer.new(environment.file)
9
+ wrappers = GemWrappers::Installer.new(environment.file_name)
10
10
  wrappers.ensure
11
11
 
12
12
  # gem executables
@@ -25,7 +25,7 @@ module GemWrappers
25
25
  end
26
26
 
27
27
  def self.environment_file
28
- GemWrappers::Environment.file
28
+ GemWrappers::Environment.file_name
29
29
  end
30
30
 
31
31
  end
@@ -3,7 +3,7 @@ require 'erb'
3
3
  module GemWrappers
4
4
  class Environment
5
5
 
6
- def self.file
6
+ def self.file_name
7
7
  path = Gem.configuration && Gem.configuration[:wrappers_environment_file]
8
8
  if path.nil? || path == ""
9
9
  path = File.join(Gem.dir, 'environment')
@@ -11,8 +11,8 @@ module GemWrappers
11
11
  path
12
12
  end
13
13
 
14
- def file
15
- @file ||= self.class.file
14
+ def file_name
15
+ @file_name ||= self.class.file_name
16
16
  end
17
17
 
18
18
  def path_take
@@ -22,13 +22,13 @@ module GemWrappers
22
22
  end
23
23
 
24
24
  def ensure
25
- return if File.exist?(file)
26
- FileUtils.mkdir_p(File.dirname(file)) unless File.exist?(File.dirname(file))
25
+ return if File.exist?(file_name)
26
+ FileUtils.mkdir_p(File.dirname(file_name)) unless File.exist?(File.dirname(file_name))
27
27
  content = ERB.new(template).result(binding)
28
- File.open(file, 'w') do |file|
28
+ File.open(file_name, 'w') do |file|
29
29
  file.write(content)
30
30
  end
31
- File.chmod(0644, file)
31
+ File.chmod(0644, file_name)
32
32
  end
33
33
 
34
34
  def template
@@ -25,11 +25,11 @@ module GemWrappers
25
25
 
26
26
  def install(executable)
27
27
  content = ERB.new(template).result(binding)
28
- file = File.join(wrappers_path, executable)
29
- File.open(file, 'w') do |file|
28
+ file_name = File.join(wrappers_path, executable)
29
+ File.open(file_name, 'w') do |file|
30
30
  file.write(content)
31
31
  end
32
- File.chmod(0755, file)
32
+ File.chmod(0755, file_name)
33
33
  end
34
34
 
35
35
  def template
@@ -1,3 +1,3 @@
1
1
  module GemWrappers
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
@@ -6,13 +6,13 @@ describe GemWrappers::Environment do
6
6
  describe "configuration" do
7
7
  it "uses default file" do
8
8
  Gem.configuration[:wrappers_environment_file] = nil
9
- GemWrappers::Environment.file.must_equal(File.join(Gem.dir, "environment"))
10
- GemWrappers::Environment.new.file.must_equal(GemWrappers::Environment.file)
9
+ GemWrappers::Environment.file_name.must_equal(File.join(Gem.dir, "environment"))
10
+ GemWrappers::Environment.new.file_name.must_equal(GemWrappers::Environment.file_name)
11
11
  end
12
12
  it "reads configured file" do
13
13
  Gem.configuration[:wrappers_environment_file] = "/path/to/environment"
14
- GemWrappers::Environment.file.must_equal("/path/to/environment")
15
- GemWrappers::Environment.new.file.must_equal("/path/to/environment")
14
+ GemWrappers::Environment.file_name.must_equal("/path/to/environment")
15
+ GemWrappers::Environment.new.file_name.must_equal("/path/to/environment")
16
16
  Gem.configuration[:wrappers_environment_file] = nil
17
17
  end
18
18
  it "uses default take" do
@@ -51,12 +51,12 @@ describe GemWrappers::Environment do
51
51
  end
52
52
 
53
53
  it "does not overwrite existing file" do
54
- subject.instance_variable_set(:@file, @test_file.path)
55
- File.open(subject.file, "w") do |file|
54
+ subject.instance_variable_set(:@file_name, @test_file.path)
55
+ File.open(subject.file_name, "w") do |file|
56
56
  file.write("something")
57
57
  end
58
58
  subject.ensure
59
- File.open(subject.file, "r") do |file|
59
+ File.open(subject.file_name, "r") do |file|
60
60
  file.read.must_equal("something")
61
61
  end
62
62
  end
@@ -65,11 +65,11 @@ describe GemWrappers::Environment do
65
65
  subject.instance_variable_set(:@path, ["/one/bin", "/two/bin"])
66
66
  subject.instance_variable_set(:@gem_path, ["/one", "/two"])
67
67
  subject.instance_variable_set(:@gem_home, "/one")
68
- subject.instance_variable_set(:@file, @test_file.path)
68
+ subject.instance_variable_set(:@file_name, @test_file.path)
69
69
  @test_file.close
70
70
  @test_file.unlink
71
71
  subject.ensure
72
- File.open(subject.file, "r") do |file|
72
+ File.open(subject.file_name, "r") do |file|
73
73
  file.read.must_equal(<<-EXPECTED)
74
74
  export PATH="/one/bin:/two/bin:$PATH"
75
75
  export GEM_PATH="/one:/two"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-wrappers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Papis
@@ -121,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '>='
123
123
  - !ruby/object:Gem::Version
124
- version: 2.0.0
124
+ version: '0'
125
125
  required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - '>='