gem-open 0.1.7 → 0.1.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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +9 -0
- data/Rakefile +4 -1
- data/gem-open.gemspec +5 -8
- data/lib/rubygems/commands/open.rb +6 -1
- data/test/gem_open_test.rb +27 -5
- metadata +19 -13
- data/Gemfile.lock +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70536596a4f7c0a6d18327088306fe6bbe825cc4
|
4
|
+
data.tar.gz: d821174f2a223d28791577a77a16b25278948646
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17227cb5dfd587b87397ee1bb08407c21f1846c2eb16bff640771c2bdd600366245732372e3318d83d681ac8f8d2cba8320031adc4928fb65a941854efdd80f3
|
7
|
+
data.tar.gz: 4a1bd555ec9ad39b528cae78b2475f8028d503d19e07cb05634acb7e4cd77a76ce908ae7cc4c6d4e99964fc4341a529d04952d2aad3f422b4d405551ec8a03b8
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Rakefile
CHANGED
data/gem-open.gemspec
CHANGED
@@ -1,23 +1,20 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
|
4
1
|
Gem::Specification.new do |s|
|
5
2
|
s.name = "gem-open"
|
6
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.8"
|
7
4
|
s.platform = Gem::Platform::RUBY
|
8
5
|
s.authors = ["Nando Vieira"]
|
9
6
|
s.email = ["fnando.vieira@gmail.com"]
|
10
|
-
s.homepage = "http://
|
7
|
+
s.homepage = "http://github.com/fnando/gem-open"
|
11
8
|
s.summary = "Open gems on your favorite editor by running a specific gem command like `gem open nokogiri`."
|
12
9
|
s.description = s.summary
|
13
10
|
|
14
11
|
s.files = `git ls-files`.split("\n")
|
15
12
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{
|
13
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f) }
|
17
14
|
s.require_paths = ["lib"]
|
18
15
|
|
19
|
-
s.add_development_dependency "mocha"
|
20
|
-
s.add_development_dependency "test-unit"
|
16
|
+
s.add_development_dependency "mocha"
|
21
17
|
s.add_development_dependency "minitest"
|
18
|
+
s.add_development_dependency "minitest-utils"
|
22
19
|
s.add_development_dependency "rake"
|
23
20
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "shellwords"
|
2
|
+
|
1
3
|
class Gem::Commands::OpenCommand < Gem::Command
|
2
4
|
def description
|
3
5
|
"Open a gem into your favorite editor"
|
@@ -67,7 +69,10 @@ class Gem::Commands::OpenCommand < Gem::Command
|
|
67
69
|
editor = ENV["GEM_EDITOR"] || ENV["EDITOR"]
|
68
70
|
|
69
71
|
if editor
|
70
|
-
|
72
|
+
path = spec.full_gem_path
|
73
|
+
Dir.chdir(path) do
|
74
|
+
system(*Shellwords.split(editor), path)
|
75
|
+
end
|
71
76
|
else
|
72
77
|
say "You must set your editor in your .bash_profile or equivalent:"
|
73
78
|
say " export GEM_EDITOR='mate'"
|
data/test/gem_open_test.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
require "bundler/setup"
|
2
2
|
|
3
|
-
|
4
|
-
require "
|
5
|
-
require "
|
3
|
+
require "minitest"
|
4
|
+
require "minitest/utils"
|
5
|
+
require "minitest/autorun"
|
6
|
+
require "mocha/mini_test"
|
6
7
|
require "rubygems_plugin"
|
7
|
-
require "
|
8
|
+
require "fileutils"
|
8
9
|
|
9
|
-
class GemOpenTest < Test
|
10
|
+
class GemOpenTest < Minitest::Test
|
10
11
|
def setup
|
11
12
|
ENV["GEM_EDITOR"] = "mate"
|
12
13
|
@plugin = Gem::Commands::OpenCommand.new
|
@@ -48,6 +49,7 @@ class GemOpenTest < Test::Unit::TestCase
|
|
48
49
|
@plugin.expects(:dirs).returns([File.dirname(__FILE__) + "/resources"])
|
49
50
|
|
50
51
|
@plugin.expects(:options).returns(:args => [gemname])
|
52
|
+
Dir.expects(:chdir).with("#{@gemdir}/activesupport-3.0.0.beta3").yields
|
51
53
|
@plugin.expects(:system).with("mate", "#{@gemdir}/activesupport-3.0.0.beta3")
|
52
54
|
|
53
55
|
@plugin.execute
|
@@ -62,6 +64,7 @@ class GemOpenTest < Test::Unit::TestCase
|
|
62
64
|
@plugin.expects(:dirs).returns([File.dirname(__FILE__) + "/resources"])
|
63
65
|
|
64
66
|
@plugin.expects(:options).returns(:args => [gemname])
|
67
|
+
Dir.expects(:chdir).with("#{@gemdir}/activesupport-3.0.0.beta3").yields
|
65
68
|
@plugin.expects(:system).with("vim", "#{@gemdir}/activesupport-3.0.0.beta3")
|
66
69
|
|
67
70
|
@plugin.execute
|
@@ -73,6 +76,7 @@ class GemOpenTest < Test::Unit::TestCase
|
|
73
76
|
@plugin.expects(:dirs).returns([File.dirname(__FILE__) + "/resources"])
|
74
77
|
|
75
78
|
@plugin.expects(:options).returns(:args => [gemname])
|
79
|
+
Dir.expects(:chdir).with("#{@gemdir}/activesupport-3.0.0.beta3").yields
|
76
80
|
@plugin.expects(:system).with("mate", "#{@gemdir}/activesupport-3.0.0.beta3")
|
77
81
|
|
78
82
|
@plugin.execute
|
@@ -84,6 +88,7 @@ class GemOpenTest < Test::Unit::TestCase
|
|
84
88
|
@plugin.expects(:dirs).returns([File.dirname(__FILE__) + "/resources"])
|
85
89
|
|
86
90
|
@plugin.expects(:options).returns(:args => [gemname])
|
91
|
+
Dir.expects(:chdir).with("#{@gemdir}/activesupport-2.3.5").yields
|
87
92
|
@plugin.expects(:system).with("mate", "#{@gemdir}/activesupport-2.3.5")
|
88
93
|
|
89
94
|
@plugin.execute
|
@@ -95,6 +100,7 @@ class GemOpenTest < Test::Unit::TestCase
|
|
95
100
|
@plugin.expects(:dirs).returns([File.dirname(__FILE__) + "/resources"])
|
96
101
|
|
97
102
|
@plugin.expects(:options).returns(:args => [gemname])
|
103
|
+
Dir.expects(:chdir).with("#{@gemdir}/sinatra-sugar-0.4.1").yields
|
98
104
|
@plugin.expects(:system).with("mate", "#{@gemdir}/sinatra-sugar-0.4.1")
|
99
105
|
|
100
106
|
@plugin.execute
|
@@ -106,6 +112,7 @@ class GemOpenTest < Test::Unit::TestCase
|
|
106
112
|
@plugin.expects(:dirs).returns([File.dirname(__FILE__) + "/resources"])
|
107
113
|
|
108
114
|
@plugin.expects(:options).returns(:args => [gemname])
|
115
|
+
Dir.expects(:chdir).with("#{@gemdir}/sinatra-sugar-0.4.1").yields
|
109
116
|
@plugin.expects(:system).with("mate", "#{@gemdir}/sinatra-sugar-0.4.1")
|
110
117
|
|
111
118
|
@plugin.execute
|
@@ -117,6 +124,7 @@ class GemOpenTest < Test::Unit::TestCase
|
|
117
124
|
@plugin.expects(:dirs).returns([File.dirname(__FILE__) + "/resources"])
|
118
125
|
|
119
126
|
@plugin.expects(:options).returns(:args => [gemname])
|
127
|
+
Dir.expects(:chdir).with("#{@gemdir}/imgur2-1.2.0").yields
|
120
128
|
@plugin.expects(:system).with("mate", "#{@gemdir}/imgur2-1.2.0")
|
121
129
|
|
122
130
|
@plugin.execute
|
@@ -128,11 +136,25 @@ class GemOpenTest < Test::Unit::TestCase
|
|
128
136
|
@plugin.expects(:dirs).returns([File.dirname(__FILE__) + "/resources"])
|
129
137
|
|
130
138
|
@plugin.expects(:options).returns(:args => [gemname])
|
139
|
+
Dir.expects(:chdir).with("#{@gemdir}/imgur2-1.2.0").yields
|
131
140
|
@plugin.expects(:system).with("mate", "#{@gemdir}/imgur2-1.2.0")
|
132
141
|
|
133
142
|
@plugin.execute
|
134
143
|
end
|
135
144
|
|
145
|
+
def test_parse_editor
|
146
|
+
ENV["GEM_EDITOR"] = "mate -H '/Users/My Home/Code and Stuff'"
|
147
|
+
gemname = "imgur2-1.2.0"
|
148
|
+
|
149
|
+
@plugin.expects(:dirs).returns([File.dirname(__FILE__) + "/resources"])
|
150
|
+
|
151
|
+
@plugin.expects(:options).returns(:args => [gemname])
|
152
|
+
Dir.expects(:chdir).with("#{@gemdir}/imgur2-1.2.0").yields
|
153
|
+
@plugin.expects(:system).with("mate", "-H", "/Users/My Home/Code and Stuff", "#{@gemdir}/imgur2-1.2.0")
|
154
|
+
|
155
|
+
@plugin.execute
|
156
|
+
end
|
157
|
+
|
136
158
|
def test_unset_editor
|
137
159
|
ENV["GEM_EDITOR"] = nil
|
138
160
|
ENV["EDITOR"] = nil
|
metadata
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem-open
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mocha
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: minitest
|
42
|
+
name: minitest-utils
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -75,8 +75,8 @@ extensions: []
|
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
77
|
- ".gitignore"
|
78
|
+
- ".travis.yml"
|
78
79
|
- Gemfile
|
79
|
-
- Gemfile.lock
|
80
80
|
- README.rdoc
|
81
81
|
- Rakefile
|
82
82
|
- gem-open.gemspec
|
@@ -89,7 +89,7 @@ files:
|
|
89
89
|
- test/resources/rails-2.3.5.gemspec
|
90
90
|
- test/resources/sinatra-1.0.gemspec
|
91
91
|
- test/resources/sinatra-sugar-0.4.1.gemspec
|
92
|
-
homepage: http://
|
92
|
+
homepage: http://github.com/fnando/gem-open
|
93
93
|
licenses: []
|
94
94
|
metadata: {}
|
95
95
|
post_install_message:
|
@@ -108,10 +108,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.
|
111
|
+
rubygems_version: 2.5.1
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Open gems on your favorite editor by running a specific gem command like
|
115
115
|
`gem open nokogiri`.
|
116
|
-
test_files:
|
117
|
-
|
116
|
+
test_files:
|
117
|
+
- test/gem_open_test.rb
|
118
|
+
- test/resources/activesupport-2.3.5.gemspec
|
119
|
+
- test/resources/activesupport-3.0.0.beta3.gemspec
|
120
|
+
- test/resources/imgur2-1.2.0.gemspec
|
121
|
+
- test/resources/rails-2.3.5.gemspec
|
122
|
+
- test/resources/sinatra-1.0.gemspec
|
123
|
+
- test/resources/sinatra-sugar-0.4.1.gemspec
|
data/Gemfile.lock
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
gem-open (0.1.7)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: http://rubygems.org/
|
8
|
-
specs:
|
9
|
-
minitest (5.2.1)
|
10
|
-
mocha (0.9.12)
|
11
|
-
rake (10.1.1)
|
12
|
-
test-unit (2.5.5)
|
13
|
-
|
14
|
-
PLATFORMS
|
15
|
-
ruby
|
16
|
-
|
17
|
-
DEPENDENCIES
|
18
|
-
gem-open!
|
19
|
-
minitest
|
20
|
-
mocha (~> 0.9.12)
|
21
|
-
rake
|
22
|
-
test-unit
|