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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65d269738917fa656392dbfdc72911162d4bceb1
4
- data.tar.gz: 9c2a310abe62329700de7faf0a991327796c64c5
3
+ metadata.gz: ae0095f46e433eb0af571e1a17ba9c1464271028
4
+ data.tar.gz: 419423432cae539803d8aeff7425f43e11bfeb0d
5
5
  SHA512:
6
- metadata.gz: 8c7832bc2ac674fbbc2da482810af2bf5733acde8d9ad9073df2e50d3aeacf1080ada3acb3ee288f6b4277f3e5f91e0d389c7e3bc0e5a0d61e653d3b6d191613
7
- data.tar.gz: 6812fbaf4a82210d4eb0f40e6e0a80d71040316a071be069e9790af510e781961e1e318663aa81ce328d70b9463dbbeffea292d858bc90f2ba88c7473a518e80
6
+ metadata.gz: 3bb6dfe7d9b6092fe2b241f3635805b05d93316bdec9455e1d6055980a49e1041da697403bfa03b069f6a544717ed4e5d3985416e6ab51e1da22a5b4d677e220
7
+ data.tar.gz: 68d2c7e60bee8c9695ab6ebc91ba592a481c80f4a4fb53196ef302049080e25b2683c50b2ca991a34e57569376195a0c95a25a32fe5660fa1fadd86d31f886c4
@@ -1,5 +1,3 @@
1
1
  rvm:
2
- - '1.9.3'
3
- - '2.0.0'
4
2
  - '2.1.0'
5
- - '2.1.1'
3
+ - '2.2.3'
@@ -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
- names.each.with_index do |name, i|
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
- Pathname(File.expand_path(path)).entries.each do |entry|
67
- memo << entry.basename('.rb').to_s if entry.extname == '.rb'
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
@@ -1,3 +1,3 @@
1
1
  module Reditor
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -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 'thor', '~> 0.18.1'
20
+ gem.add_runtime_dependency 'pepin', '~> 0.1.1'
21
+ gem.add_runtime_dependency 'thor', '~> 0.19.1'
21
22
 
22
- # Add into runtime dependency to avoid `WARN: Unresolved specs during Gem::Specification.reset: rake (>= 0)'
23
- gem.add_runtime_dependency 'rake', '~> 10.1.1'
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
@@ -22,7 +22,7 @@ describe 'reditor command' do
22
22
  }
23
23
  end
24
24
 
25
- let(:thor_in_global_gems) { /thor-0\.18\.*/ }
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 /\[0\] csv/ }
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 /\[\d+\]\sirb$/ }
82
- it { should match /\[\d+\]\serb$/ }
83
- it { should match /\[\d+\]\sdrb$/ }
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 /\[\d+\]\sthor$/ }
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.any_instance.stub(:candidates) {
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
@@ -9,4 +9,7 @@ PROJECT_ROOT = Pathname.new(__FILE__).dirname.join('..').realpath
9
9
  RSpec.configure do |config|
10
10
  config.filter_run focus: true
11
11
  config.run_all_when_everything_filtered = true
12
+ config.expect_with :rspec do |c|
13
+ c.syntax = :should
14
+ end
12
15
  end
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.0
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: 2014-03-16 00:00:00.000000000 Z
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: thor
28
+ name: pepin
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.18.1
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.18.1
40
+ version: 0.1.1
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: thor
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 10.1.1
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: 10.1.1
54
+ version: 0.19.1
55
55
  - !ruby/object:Gem::Dependency
56
- name: pry
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
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: '0'
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: 2.14.1
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: 2.14.1
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.2.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.