Class: Jmpod::Command::Op::Gems
- Inherits:
-
Jmpod::Command::Op
- Object
- CLAide::Command
- Jmpod::Command
- Jmpod::Command::Op
- Jmpod::Command::Op::Gems
- Defined in:
- lib/jmpod/command/op/gems.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ Gems
constructor
A new instance of Gems.
- #openGems ⇒ Object
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Jmpod::Command
Constructor Details
#initialize(argv) ⇒ Gems
Returns a new instance of Gems.
14 15 16 |
# File 'lib/jmpod/command/op/gems.rb', line 14 def initialize(argv) super end |
Instance Method Details
#openGems ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jmpod/command/op/gems.rb', line 26 def openGems last_version_file = "0" Dir.foreach('/Library/Ruby/Gems/') do |file| if file.to_s > last_version_file last_version_file = file.to_s end end version = last_version_file path = "/Library/Ruby/Gems/#{version}/gems" puts "gem路径为:#{path}".green system "open #{path}" end |
#run ⇒ Object
22 23 24 |
# File 'lib/jmpod/command/op/gems.rb', line 22 def run openGems end |
#validate! ⇒ Object
18 19 20 |
# File 'lib/jmpod/command/op/gems.rb', line 18 def validate! super end |