reditor 0.0.1 → 0.0.2

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.
data/README.md CHANGED
@@ -1,24 +1,44 @@
1
1
  # Reditor
2
2
 
3
- TODO: Write a gem description
3
+ Reditor provides `reditor` command.
4
+
5
+ This command detect and open a library from $LOAD_PATH or rubygems.
6
+
7
+ reditor requires the EDITOR variable.
4
8
 
5
9
  ## Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
8
12
 
9
- gem 'reditor'
13
+ ```ruby
14
+ gem 'reditor'
15
+ ```
10
16
 
11
17
  And then execute:
12
18
 
13
- $ bundle
19
+ ```
20
+ $ bundle
21
+ ```
14
22
 
15
23
  Or install it yourself as:
16
24
 
17
- $ gem install reditor
25
+ ```
26
+ $ gem install reditor
27
+ ```
18
28
 
19
29
  ## Usage
20
30
 
21
- TODO: Write usage instructions here
31
+ ### Open Standard Library
32
+
33
+ ```
34
+ $ reditor set
35
+ ```
36
+
37
+ ### Open a gem
38
+
39
+ ```
40
+ $ reditor mechanize
41
+ ```
22
42
 
23
43
  ## Contributing
24
44
 
@@ -6,7 +6,12 @@ module Reditor
6
6
  class Command < Thor
7
7
  include Reditor
8
8
 
9
- desc :open, 'open a library'
9
+ map '-v' => :version,
10
+ '-h' => :help,
11
+ '--version' => :version,
12
+ '--help' => :help
13
+
14
+ desc :open, 'Open the library'
10
15
  def open(name)
11
16
  dir, file = *detect(name)
12
17
 
@@ -20,7 +25,16 @@ module Reditor
20
25
  say e.message, :red
21
26
  end
22
27
 
23
- desc :version, 'show version'
28
+ desc :sh, 'Open a shell and move to the library'
29
+ def sh(name)
30
+ dir, _ = *detect(name)
31
+
32
+ Dir.chdir dir do
33
+ exec shell_command
34
+ end
35
+ end
36
+
37
+ desc :version, 'Show version'
24
38
  def version
25
39
  say "Reditor version #{VERSION}"
26
40
  end
@@ -33,7 +47,11 @@ module Reditor
33
47
  private
34
48
 
35
49
  def editor_command
36
- ENV['EDITOR']
50
+ ENV['EDITOR'] or raise '$EDITOR is not provided.'
51
+ end
52
+
53
+ def shell_command
54
+ ENV['SHELL'] or raise '$SHELL is not provided.'
37
55
  end
38
56
  end
39
57
  end
@@ -1,3 +1,3 @@
1
1
  module Reditor
2
- VERSION = "0.0.1"
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-11 00:00:00.000000000 Z
12
+ date: 2012-05-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70322074171720 !ruby/object:Gem::Requirement
16
+ requirement: &70335295082260 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.14.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70322074171720
24
+ version_requirements: *70335295082260
25
25
  description: Open a ruby library by your editor
26
26
  email:
27
27
  - celluloid.key@gmail.com
@@ -54,7 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
54
  version: '0'
55
55
  segments:
56
56
  - 0
57
- hash: 1804824006546242364
57
+ hash: -3496555786174773731
58
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  none: false
60
60
  requirements:
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  version: '0'
64
64
  segments:
65
65
  - 0
66
- hash: 1804824006546242364
66
+ hash: -3496555786174773731
67
67
  requirements: []
68
68
  rubyforge_project:
69
69
  rubygems_version: 1.8.11