amatsuda-atode_yomu 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 [name of plugin creator]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown ADDED
@@ -0,0 +1,44 @@
1
+ AtodeYomu
2
+ ========
3
+
4
+ Installs rdoc and ri for latest versions of already installed gems only if the docs are not installed yet.
5
+
6
+ gem atode_yomu rails
7
+
8
+ or
9
+
10
+ gem atode_yomu --all
11
+
12
+ # maybe only "atode" will be enough
13
+
14
+
15
+ Recommended Usage:
16
+ ------------
17
+
18
+ Put the following line to your ~/.gemrc to skip installing the docs for gem by default.
19
+
20
+ gem: --no-rdoc --no-ri
21
+
22
+ You can install these docs at any time by running this plugin command (gem atode --all).
23
+ This may save much of your time on daily gem installing and updating.
24
+
25
+
26
+ Installation:
27
+ ------------
28
+
29
+ gem sources -a http://gems.github.com
30
+ gem install amatsuda-atode_yomu
31
+
32
+
33
+ Requirements:
34
+ ------------
35
+ Use rubygems 1.3.2 or higher.
36
+
37
+
38
+
39
+ What's Atode?:
40
+ ------------
41
+ "atode" means "later" in Japanese.
42
+
43
+
44
+ Akira Matsuda
data/VERSION.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ :patch: 0
3
+ :major: 0
4
+ :minor: 1
@@ -0,0 +1,75 @@
1
+ require 'rubygems/command'
2
+ require 'rubygems/dependency'
3
+ require 'rubygems/version_option'
4
+ require 'rubygems/doc_manager'
5
+
6
+ class Gem::DocManager
7
+ ##
8
+ # Is the ri documentation installed?
9
+
10
+ def ri_installed?
11
+ File.exist?(File.join(@doc_dir, "ri"))
12
+ end
13
+ end
14
+
15
+ class Gem::Commands::AtodeYomuCommand < Gem::Command
16
+ include Gem::VersionOption
17
+
18
+ def initialize
19
+ super 'atode_yomu', 'Cleverly installs rdoc and ri for the latest versions of already installed gems',
20
+ :generate_rdoc => true,
21
+ :generate_ri => true
22
+
23
+ add_option('--all',
24
+ 'Generate RDoc/RI documentation for',
25
+ 'the latest versions of installed gems') do |value, options|
26
+ options[:all] = value
27
+ end
28
+
29
+ # add_version_option
30
+ end
31
+
32
+ def arguments # :nodoc:
33
+ 'GEMNAME gem to generate documentation for (unless --all)'
34
+ end
35
+
36
+ def usage # :nodoc:
37
+ "#{program_name} [args]"
38
+ end
39
+
40
+ def execute
41
+ if options[:all] then
42
+ specs = Gem::SourceIndex.from_installed_gems.latest_specs
43
+ else
44
+ gem_name = get_one_gem_name
45
+ dep = Gem::Dependency.new gem_name
46
+ specs = Gem::SourceIndex.from_installed_gems.latest_specs.search dep
47
+ end
48
+
49
+ if specs.empty?
50
+ fail "Failed to find gem #{gem_name} to generate RDoc"
51
+ end
52
+
53
+ specs.each do |spec|
54
+ doc_manager = Gem::DocManager.new spec
55
+ if options[:generate_ri]
56
+ if !doc_manager.ri_installed? && File.exist?(File.join(spec.full_gem_path, 'lib'))
57
+ doc_manager.generate_ri
58
+ else
59
+ say "skip installing ri for #{spec.name} #{spec.version}..."
60
+ end
61
+ end
62
+
63
+ if options[:generate_rdoc]
64
+ if !doc_manager.rdoc_installed? && File.exist?(File.join(spec.full_gem_path, 'lib'))
65
+ doc_manager.generate_rdoc
66
+ else
67
+ say "skip installing rdoc for #{spec.name} #{spec.version}..."
68
+ end
69
+ end
70
+ end if options[:generate_ri] || options[:generate_rdoc]
71
+ Gem::DocManager.update_ri_cache if options[:generate_ri]
72
+
73
+ true
74
+ end
75
+ end
@@ -0,0 +1,3 @@
1
+ require 'rubygems/command_manager'
2
+
3
+ Gem::CommandManager.instance.register_command :atode_yomu
metadata ADDED
@@ -0,0 +1,57 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: amatsuda-atode_yomu
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Akira Matsuda
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-22 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: A gem plugin that cleverly installs rdoc and ri for the latest versions of already installed gems
17
+ email: ronnie@dio.jp
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - MIT-LICENSE
26
+ - README.markdown
27
+ - VERSION.yml
28
+ - lib/rubygems/commands/atode_yomu_command.rb
29
+ - lib/rubygems_plugin.rb
30
+ has_rdoc: false
31
+ homepage: http://github.com/amatsuda/atode_yomu
32
+ post_install_message:
33
+ rdoc_options: []
34
+
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: "0"
42
+ version:
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: "0"
48
+ version:
49
+ requirements: []
50
+
51
+ rubyforge_project:
52
+ rubygems_version: 1.2.0
53
+ signing_key:
54
+ specification_version: 2
55
+ summary: A gem plugin to install rdoc and ri cleverly anytime LATER
56
+ test_files: []
57
+