reditor 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -3
- data/lib/reditor/command.rb +2 -7
- data/lib/reditor/library_search_query.rb +6 -2
- data/lib/reditor/version.rb +1 -1
- data/reditor.gemspec +4 -7
- data/spec/command_spec.rb +6 -8
- data/spec/library_search_query_spec.rb +2 -2
- data/spec/spec_helper.rb +3 -0
- metadata +16 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae0095f46e433eb0af571e1a17ba9c1464271028
|
4
|
+
data.tar.gz: 419423432cae539803d8aeff7425f43e11bfeb0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bb6dfe7d9b6092fe2b241f3635805b05d93316bdec9455e1d6055980a49e1041da697403bfa03b069f6a544717ed4e5d3985416e6ab51e1da22a5b4d677e220
|
7
|
+
data.tar.gz: 68d2c7e60bee8c9695ab6ebc91ba592a481c80f4a4fb53196ef302049080e25b2683c50b2ca991a34e57569376195a0c95a25a32fe5660fa1fadd86d31f886c4
|
data/.travis.yml
CHANGED
data/lib/reditor/command.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
require 'thor'
|
4
|
+
require 'pepin'
|
4
5
|
|
5
6
|
module Reditor
|
6
7
|
class Command < Thor
|
@@ -67,13 +68,7 @@ module Reditor
|
|
67
68
|
def choose_exec(name, options = {}, &block)
|
68
69
|
names = LibrarySearchQuery.search(name, options)
|
69
70
|
|
70
|
-
|
71
|
-
say "[#{i}] #{name}"
|
72
|
-
end
|
73
|
-
|
74
|
-
exit_silently unless num = ask('Choose number of library [0]>')
|
75
|
-
|
76
|
-
if name = names[num.to_i]
|
71
|
+
if name = Pepin.search(names)
|
77
72
|
do_exec LibraryLocator.detect!(name, options), &block
|
78
73
|
else
|
79
74
|
abort "#{num} isn't included in the list."
|
@@ -63,8 +63,12 @@ module Reditor
|
|
63
63
|
|
64
64
|
def candidates_from_loadpath
|
65
65
|
$LOAD_PATH.each_with_object([]) {|path, memo|
|
66
|
-
|
67
|
-
|
66
|
+
begin
|
67
|
+
Pathname(File.expand_path(path)).entries.each do |entry|
|
68
|
+
memo << entry.basename('.rb').to_s if entry.extname == '.rb'
|
69
|
+
end
|
70
|
+
rescue Errno::ENOENT
|
71
|
+
# maybe load path is invalid
|
68
72
|
end
|
69
73
|
}
|
70
74
|
end
|
data/lib/reditor/version.rb
CHANGED
data/reditor.gemspec
CHANGED
@@ -17,12 +17,9 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.version = Reditor::VERSION
|
18
18
|
|
19
19
|
gem.add_runtime_dependency 'hotwater', '~> 0.1.2'
|
20
|
-
gem.add_runtime_dependency '
|
20
|
+
gem.add_runtime_dependency 'pepin', '~> 0.1.1'
|
21
|
+
gem.add_runtime_dependency 'thor', '~> 0.19.1'
|
21
22
|
|
22
|
-
|
23
|
-
gem.
|
24
|
-
|
25
|
-
gem.add_development_dependency 'pry'
|
26
|
-
gem.add_development_dependency 'rspec', '~> 2.14.1'
|
27
|
-
gem.add_development_dependency 'tapp'
|
23
|
+
gem.add_development_dependency 'rake', '~> 10.4.2'
|
24
|
+
gem.add_development_dependency 'rspec', '~> 3.3.0'
|
28
25
|
end
|
data/spec/command_spec.rb
CHANGED
@@ -22,7 +22,7 @@ describe 'reditor command' do
|
|
22
22
|
}
|
23
23
|
end
|
24
24
|
|
25
|
-
let(:thor_in_global_gems) { /thor-0\.
|
25
|
+
let(:thor_in_global_gems) { /thor-0\.19\.*/ }
|
26
26
|
let(:thor_in_bundler_project) { /thor-0\.14\.6/ }
|
27
27
|
|
28
28
|
before :all do
|
@@ -41,7 +41,7 @@ describe 'reditor command' do
|
|
41
41
|
context 'Incorrect name library in non-bundler broject' do
|
42
42
|
subject { capture_reditor('cvs', on: 'blank_project') }
|
43
43
|
|
44
|
-
it { should match
|
44
|
+
it { should match /csv\s+/ }
|
45
45
|
end
|
46
46
|
|
47
47
|
context 'Rubygems library in non-bundler project' do
|
@@ -78,17 +78,15 @@ describe 'reditor command' do
|
|
78
78
|
context 'with incorrect name' do
|
79
79
|
subject { capture_reditor('rb') }
|
80
80
|
|
81
|
-
it { should match
|
82
|
-
it { should match
|
83
|
-
it { should match
|
84
|
-
it { should match /Choose number of library/ }
|
81
|
+
it { should match /irb\s+/ }
|
82
|
+
it { should match /erb\s+/ }
|
83
|
+
it { should match /drb\s+/ }
|
85
84
|
end
|
86
85
|
|
87
86
|
context 'with incorrect name and --global option' do
|
88
87
|
subject { capture_reditor('tho', on: 'bundler_project', global: true) }
|
89
88
|
|
90
|
-
it { should match
|
91
|
-
it { should match /Choose number of library/ }
|
89
|
+
it { should match /thor\s+/ }
|
92
90
|
end
|
93
91
|
end
|
94
92
|
end
|
@@ -4,7 +4,7 @@ require 'spec_helper'
|
|
4
4
|
describe Reditor::LibrarySearchQuery do
|
5
5
|
describe '.search(query, limit)' do
|
6
6
|
before do
|
7
|
-
Reditor::LibrarySearchQuery.
|
7
|
+
allow_any_instance_of(Reditor::LibrarySearchQuery).to receive(:candidates).and_return(
|
8
8
|
%w(
|
9
9
|
rails_admin
|
10
10
|
railtie
|
@@ -15,7 +15,7 @@ describe Reditor::LibrarySearchQuery do
|
|
15
15
|
itwho
|
16
16
|
csv
|
17
17
|
)
|
18
|
-
|
18
|
+
)
|
19
19
|
end
|
20
20
|
|
21
21
|
describe 'rails' do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hibariya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hotwater
|
@@ -25,75 +25,61 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.1.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: pepin
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.1.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.1.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: thor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.19.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.19.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 10.4.2
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 10.4.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 3.3.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: tapp
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
82
|
+
version: 3.3.0
|
97
83
|
description: Open a ruby library with $EDITOR. Reditor supports rubygems, bundler,
|
98
84
|
and stdlib (pure ruby).
|
99
85
|
email:
|
@@ -143,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
129
|
version: '0'
|
144
130
|
requirements: []
|
145
131
|
rubyforge_project:
|
146
|
-
rubygems_version: 2.
|
132
|
+
rubygems_version: 2.4.5.1
|
147
133
|
signing_key:
|
148
134
|
specification_version: 4
|
149
135
|
summary: Open a ruby library with $EDITOR.
|