gem-toolbox 0.0.2 → 0.1.0

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/CHANGES.md CHANGED
@@ -1,7 +1,11 @@
1
+ ## 0.1.0, released 2011-05-09
2
+
3
+ * Added cd command (Mac OSX only)
4
+
1
5
  ## 0.0.2, released 2010-09-13
2
6
 
3
7
  * Added dependencies to gemspec
4
8
 
5
9
  ## 0.0.1, released 2010-09-13
6
10
 
7
- * Initial version with doc, history, open, readme and visit commands
11
+ * Initial version with doc, history, open, readme and visit commands
@@ -14,6 +14,13 @@ To open a gem's installation folder in textmate:
14
14
 
15
15
  Note: This is the same command as the one in open_gem.
16
16
 
17
+
18
+ === Changing directory to the gem's source files
19
+
20
+ $ gem cd gem-toolbox
21
+
22
+ Note: This currently only works in Terminal (Mac OSX)
23
+
17
24
 
18
25
  === Displaying the README
19
26
 
@@ -0,0 +1,37 @@
1
+ # encoding: utf-8
2
+
3
+ # CdCommand will cd to gem's source path
4
+ class Gem::Commands::CdCommand < Gem::Command
5
+ include GemToolbox::CommonOptions
6
+ include Gem::VersionOption
7
+
8
+ def initialize
9
+ super 'cd', "Change directory to the gem's source directory",
10
+ :command => nil,
11
+ :version=> Gem::Requirement.default,
12
+ :latest=> false
13
+
14
+ add_command_option
15
+ add_latest_version_option
16
+ add_version_option
17
+ add_exact_match_option
18
+ end
19
+
20
+ def arguments # :nodoc:
21
+ "GEMNAME gem to cd into"
22
+ end
23
+
24
+ def execute
25
+ name = get_one_gem_name
26
+ path = get_path(name)
27
+
28
+ do_cd(path) if path
29
+ end
30
+
31
+ def do_cd(path)
32
+ app = Appscript.app("Terminal")
33
+ win = app.windows.get.detect { |w| w.properties_.get[:frontmost] }
34
+ win.do_script "cd #{path}", :in => win
35
+ end
36
+
37
+ end
@@ -5,9 +5,11 @@ require 'rubygems/dependency'
5
5
  require 'rubygems/version_option'
6
6
  require 'shellwords'
7
7
  require 'gem_toolbox/common_options'
8
+ require 'appscript'
8
9
 
9
10
  Gem::CommandManager.instance.register_command :open
10
11
  Gem::CommandManager.instance.register_command :doc
11
12
  Gem::CommandManager.instance.register_command :history
12
13
  Gem::CommandManager.instance.register_command :readme
13
- Gem::CommandManager.instance.register_command :visit
14
+ Gem::CommandManager.instance.register_command :visit
15
+ Gem::CommandManager.instance.register_command :cd
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-toolbox
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 2
9
- version: 0.0.2
4
+ prerelease:
5
+ version: 0.1.0
10
6
  platform: ruby
11
7
  authors:
12
8
  - Gudleik Rasch
@@ -14,7 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2010-09-13 00:00:00 +02:00
13
+ date: 2011-05-09 00:00:00 +02:00
18
14
  default_executable:
19
15
  dependencies:
20
16
  - !ruby/object:Gem::Dependency
@@ -25,14 +21,21 @@ dependencies:
25
21
  requirements:
26
22
  - - ~>
27
23
  - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- - 3
31
- - 5
32
24
  version: 0.3.5
33
25
  type: :runtime
34
26
  version_requirements: *id001
35
- description: "Gem-Toolbox is a RubyGems plugin that adds extra commands to RubyGems: open, doc, history, readme and visit"
27
+ - !ruby/object:Gem::Dependency
28
+ name: rb-appscript
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ~>
34
+ - !ruby/object:Gem::Version
35
+ version: 0.6.1
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ description: "Gem-Toolbox is a RubyGems plugin that adds extra commands to RubyGems: open, cd, doc, history, readme and visit"
36
39
  email:
37
40
  - gudleik@gmail.com
38
41
  executables: []
@@ -43,6 +46,7 @@ extra_rdoc_files:
43
46
  - README.rdoc
44
47
  files:
45
48
  - lib/gem_toolbox/common_options.rb
49
+ - lib/rubygems/commands/cd_command.rb
46
50
  - lib/rubygems/commands/doc_command.rb
47
51
  - lib/rubygems/commands/history_command.rb
48
52
  - lib/rubygems/commands/open_command.rb
@@ -65,23 +69,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
69
  requirements:
66
70
  - - ">="
67
71
  - !ruby/object:Gem::Version
68
- segments:
69
- - 0
70
72
  version: "0"
71
73
  required_rubygems_version: !ruby/object:Gem::Requirement
72
74
  none: false
73
75
  requirements:
74
76
  - - ">="
75
77
  - !ruby/object:Gem::Version
76
- segments:
77
- - 0
78
78
  version: "0"
79
79
  requirements: []
80
80
 
81
81
  rubyforge_project:
82
- rubygems_version: 1.3.7
82
+ rubygems_version: 1.6.2
83
83
  signing_key:
84
84
  specification_version: 3
85
- summary: "Adds extra commands to RubyGems: open, doc, history, readme and visit"
85
+ summary: "Adds extra commands to RubyGems: open, cd, doc, history, readme and visit"
86
86
  test_files: []
87
87