gem-wrappers 1.2.2 → 1.2.3

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
- ---
2
- SHA512:
3
- metadata.gz: 3ee86ce7a16e5713e54f5107c98e87a120c1b1538294ced359397a486fbebf440c3011f3a1824c22b17b4a01cedcd58a5a193ba85e5f9c388a6deec42b45a216
4
- data.tar.gz: a2d79cfbf6daf92e5e458147fc6324e8b984804481c25b7a726eb64213db3186551df04caf2009eca954d7ef56b76c9bbe720ecdad8c099b14cf9c14b74937ac
5
- SHA1:
6
- metadata.gz: d269e03a5d350449af2a2d0ea56d5b389a753bac
7
- data.tar.gz: c9c42d1cdecfafe73f3bc71e812982de79ec18a8
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e075b6b4f798f66c121e454eb80a4a7c278904f5
4
+ data.tar.gz: 94dd562158d23de72bf322901269f4ac223aa0de
5
+ SHA512:
6
+ metadata.gz: 337eef95541cecfdcc6d97161f627fa8f75c7699027f59cfc04a9511dcd07725c6746c140c9aea50768f075486b2b06f103e6ed087e09e2cde610d8491bf4bfc
7
+ data.tar.gz: dfc5917c29b21b15d9f772f9c90af75459c1bdc219a1ebf1f09cb8a0dca3e68d4f61f002e49bffd1f31577dd4c7fcdfe5752120dd85587600fd519dcedf3525c
data/Changelog.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.3
4
+ date: 2013-12-31
5
+
6
+ - fix uninstalling gems and add tests for it
7
+
3
8
  ## 1.2.2
4
9
  date: 2013-12-31
5
10
 
data/lib/gem-wrappers.rb CHANGED
@@ -8,7 +8,7 @@ module GemWrappers
8
8
  end
9
9
 
10
10
  def self.installer
11
- @installer ||= GemWrappers::Installer.new(@environment.file_name)
11
+ @installer ||= GemWrappers::Installer.new(@environment && @environment.file_name)
12
12
  end
13
13
 
14
14
  def self.install(executables)
@@ -1,3 +1,3 @@
1
1
  module GemWrappers
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
@@ -8,33 +8,83 @@ describe GemWrappers do
8
8
  GemWrappers
9
9
  end
10
10
 
11
- before do
12
- @fake_installer = GemWrappers::FakeInstaller.new
13
- @fake_envvironment = GemWrappers::FakeEnvironment.new
14
- subject.instance_variable_set(:@installer, @fake_installer)
15
- subject.instance_variable_set(:@environment, @fake_envvironment)
16
- end
11
+ describe "fake" do
12
+ before do
13
+ @fake_installer = GemWrappers::FakeInstaller.new
14
+ @fake_envvironment = GemWrappers::FakeEnvironment.new
15
+ subject.instance_variable_set(:@installer, @fake_installer)
16
+ subject.instance_variable_set(:@environment, @fake_envvironment)
17
+ end
17
18
 
18
- it "reads configured file" do
19
- subject.environment_file.must_equal("/path/to/environment")
20
- end
19
+ it "reads configured file" do
20
+ subject.environment_file.must_equal("/path/to/environment")
21
+ end
21
22
 
22
- it "reads configured file" do
23
- subject.wrappers_path.must_equal("/path/to/wrappers")
24
- end
23
+ it "reads configured file" do
24
+ subject.wrappers_path.must_equal("/path/to/wrappers")
25
+ end
25
26
 
26
- it "does create environment and wrapper" do
27
- subject.install(%w{rake test})
28
- @fake_envvironment.ensure?.must_equal(true)
29
- @fake_installer.ensure?.must_equal(true)
30
- @fake_installer.executables.must_equal(%w{rake test ruby gem erb irb ri rdoc testrb})
27
+ it "does create environment and wrapper" do
28
+ subject.install(%w{rake test})
29
+ @fake_envvironment.ensure?.must_equal(true)
30
+ @fake_installer.ensure?.must_equal(true)
31
+ @fake_installer.executables.must_equal(%w{rake test ruby gem erb irb ri rdoc testrb})
32
+ end
33
+
34
+ it "does remove wrapper" do
35
+ subject.install(%w{rake})
36
+ @fake_installer.executables.must_equal(%w{rake ruby gem erb irb ri rdoc testrb})
37
+ subject.uninstall(%w{rake})
38
+ @fake_installer.executables.must_equal(%w{ruby gem erb irb ri rdoc testrb})
39
+ end
31
40
  end
32
41
 
33
- it "does remove wrapper" do
34
- subject.install(%w{rake})
35
- @fake_installer.executables.must_equal(%w{rake ruby gem erb irb ri rdoc testrb})
36
- subject.uninstall(%w{rake})
37
- @fake_installer.executables.must_equal(%w{ruby gem erb irb ri rdoc testrb})
42
+ describe "real" do
43
+ before do
44
+ file = Tempfile.new('wrappers')
45
+ @test_path = file.path
46
+ file.close
47
+ file.unlink
48
+ Dir.mkdir(@test_path)
49
+
50
+ subject.instance_variable_set(:@installer, nil)
51
+ subject.instance_variable_set(:@environment, nil)
52
+
53
+ @wrappers_path = File.join(@test_path, "wrappers")
54
+ @environment_path = File.join(@test_path, "environment")
55
+ @rake_wrapper = File.join(@wrappers_path, "rake")
56
+
57
+ ENV['GEMRC'] = File.join(@test_path, ".gemrc")
58
+ File.open(ENV['GEMRC'], "w") do |file|
59
+ file.write <<-GEMRC
60
+ wrappers_path: #{@wrappers_path}
61
+ wrappers_environment_file: #{@environment_path}
62
+ GEMRC
63
+ end
64
+ Gem.instance_variable_set(:@configuration, Gem::ConfigFile.new([]))
65
+ end
66
+
67
+ after do
68
+ ENV['GEMRC'] = nil
69
+ Gem.instance_variable_set(:@configuration, Gem::ConfigFile.new([]))
70
+ FileUtils.rm_rf(@test_path)
71
+ end
72
+
73
+ it "installas wrappers" do
74
+ File.exist?(@rake_wrapper).must_equal(false)
75
+ subject.install(%w{rake})
76
+ File.exist?(@rake_wrapper ).must_equal(true)
77
+ end
78
+
79
+ it "removes wrappers" do
80
+ File.exist?(@rake_wrapper ).must_equal(false)
81
+ Dir.mkdir(@wrappers_path)
82
+ File.open(@rake_wrapper, "w") do |file|
83
+ file.puts "small wrapper"
84
+ end
85
+ subject.uninstall(%w{rake})
86
+ File.exist?(@rake_wrapper ).must_equal(false)
87
+ end
38
88
  end
39
89
 
40
90
  end
metadata CHANGED
@@ -1,45 +1,51 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: gem-wrappers
3
- version: !ruby/object:Gem::Version
4
- version: 1.2.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.3
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Michal Papis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2013-12-31 00:00:00 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
11
+ date: 2013-12-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
15
14
  name: rake
16
- prerelease: false
17
- requirement: &id001 !ruby/object:Gem::Requirement
18
- requirements:
19
- - &id002
20
- - ">="
21
- - !ruby/object:Gem::Version
22
- version: "0"
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
23
20
  type: :development
24
- version_requirements: *id001
25
- - !ruby/object:Gem::Dependency
26
- name: minitest
27
21
  prerelease: false
28
- requirement: &id003 !ruby/object:Gem::Requirement
29
- requirements:
30
- - *id002
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: minitest
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
31
34
  type: :development
32
- version_requirements: *id003
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
33
41
  description:
34
- email:
42
+ email:
35
43
  - mpapis@gmail.com
36
44
  executables: []
37
-
38
- extensions:
45
+ extensions:
39
46
  - ext/wrapper_generator/extconf.rb
40
47
  extra_rdoc_files: []
41
-
42
- files:
48
+ files:
43
49
  - .gitignore
44
50
  - .travis.yml
45
51
  - Changelog.md
@@ -65,29 +71,30 @@ files:
65
71
  - test/gem-wrappers_test.rb
66
72
  - test/test_helper.rb
67
73
  homepage: https://github.com/rvm/gem-wrappers
68
- licenses:
74
+ licenses:
69
75
  - Apache 2.0
70
76
  metadata: {}
71
-
72
77
  post_install_message:
73
78
  rdoc_options: []
74
-
75
- require_paths:
79
+ require_paths:
76
80
  - lib
77
- required_ruby_version: !ruby/object:Gem::Requirement
78
- requirements:
79
- - *id002
80
- required_rubygems_version: !ruby/object:Gem::Requirement
81
- requirements:
82
- - *id002
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
83
91
  requirements: []
84
-
85
92
  rubyforge_project:
86
- rubygems_version: 2.0.14
93
+ rubygems_version: 2.2.0
87
94
  signing_key:
88
95
  specification_version: 4
89
96
  summary: Create gem wrappers for easy use of gems in cron and other system locations.
90
- test_files:
97
+ test_files:
91
98
  - test/gem-wrappers/command_test.rb
92
99
  - test/gem-wrappers/environment_test.rb
93
100
  - test/gem-wrappers/fakes.rb