Class: Milkode::CLI
- Inherits:
-
Thor
- Object
- Thor
- Milkode::CLI
- Defined in:
- lib/milkode/cli.rb
Instance Method Summary collapse
- #add(*args) ⇒ Object
- #cleanup(*args) ⇒ Object
- #config(*args) ⇒ Object
- #dir(*args) ⇒ Object
- #dump ⇒ Object
- #fav(*paths) ⇒ Object
- #files(*args) ⇒ Object
- #grep(*args) ⇒ Object
- #ignore(*paths) ⇒ Object
- #info(*args) ⇒ Object
- #init(db_dir = nil) ⇒ Object
- #list(*args) ⇒ Object
- #mcd ⇒ Object
- #plugins(*args) ⇒ Object
- #pwd ⇒ Object
- #rebuild(*args) ⇒ Object
- #remove(*args) ⇒ Object
- #setdb(*args) ⇒ Object
- #update(*args) ⇒ Object
- #web ⇒ Object
Instance Method Details
#add(*args) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/milkode/cli.rb', line 44 def add(*args) if args.empty? CLI.task_help(shell, "add") else cdstk.add(args, ) end end |
#cleanup(*args) ⇒ Object
91 92 93 |
# File 'lib/milkode/cli.rb', line 91 def cleanup(*args) cdstk.cleanup(args, ) end |
#config(*args) ⇒ Object
223 224 225 |
# File 'lib/milkode/cli.rb', line 223 def config(*args) cdstk.config(args, ) end |
#dir(*args) ⇒ Object
109 110 111 |
# File 'lib/milkode/cli.rb', line 109 def dir(*args) cdstk.dir(args, ) end |
#dump ⇒ Object
103 104 105 |
# File 'lib/milkode/cli.rb', line 103 def dump cdstk.dump end |
#fav(*paths) ⇒ Object
153 154 155 |
# File 'lib/milkode/cli.rb', line 153 def fav(*paths) cdstk.fav(paths, ) end |
#files(*args) ⇒ Object
206 207 208 |
# File 'lib/milkode/cli.rb', line 206 def files(*args) cdstk.files(args, ) end |
#grep(*args) ⇒ Object
186 187 188 |
# File 'lib/milkode/cli.rb', line 186 def grep(*args) Milkode::CLI_Grep.execute($stdout, args) end |
#ignore(*paths) ⇒ Object
142 143 144 145 146 147 148 |
# File 'lib/milkode/cli.rb', line 142 def ignore(*paths) begin cdstk.ignore(paths, ) rescue IgnoreError => e $stdout.puts e. end end |
#info(*args) ⇒ Object
132 133 134 |
# File 'lib/milkode/cli.rb', line 132 def info(*args) cdstk.info(args_or_pipe(args, $stdin), ) end |
#init(db_dir = nil) ⇒ Object
16 17 18 19 20 |
# File 'lib/milkode/cli.rb', line 16 def init(db_dir = nil) db_dir = db_dir || Dbdir.default_dir FileUtils.mkdir_p db_dir cdstk(db_dir).init() end |
#list(*args) ⇒ Object
76 77 78 |
# File 'lib/milkode/cli.rb', line 76 def list(*args) cdstk.list(args, ) end |
#mcd ⇒ Object
121 122 123 |
# File 'lib/milkode/cli.rb', line 121 def mcd cdstk.mcd() end |
#plugins(*args) ⇒ Object
192 193 194 195 196 197 198 199 200 201 |
# File 'lib/milkode/cli.rb', line 192 def plugins(*args) $stdout.puts <<EOF bundle-milkode https://github.com/kou/bundle-milkode emacs-milkode https://github.com/ongaeshi/emacs-milkode gem-milkode https://github.com/kou/gem-milkode Gitomb https://github.com/tomykaira/gitomb Milkode_Sublime https://github.com/tsurushuu/Milkode_Sublime redmine_milkode https://github.com/suer/redmine_milkode EOF end |
#pwd ⇒ Object
82 83 84 |
# File 'lib/milkode/cli.rb', line 82 def pwd() cdstk.pwd() end |
#rebuild(*args) ⇒ Object
98 99 100 |
# File 'lib/milkode/cli.rb', line 98 def rebuild(*args) cdstk.rebuild(args, ) end |
#remove(*args) ⇒ Object
64 65 66 67 68 69 70 |
# File 'lib/milkode/cli.rb', line 64 def remove(*args) if args.empty? && ![:all] CLI.task_help(shell, "remove") else cdstk.remove(args, ) end end |
#setdb(*args) ⇒ Object
115 116 117 |
# File 'lib/milkode/cli.rb', line 115 def setdb(*args) cdstk.setdb(args, ) end |
#update(*args) ⇒ Object
56 57 58 |
# File 'lib/milkode/cli.rb', line 56 def update(*args) cdstk.update(args, ) end |
#web ⇒ Object
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/milkode/cli.rb', line 165 def web opts = { :environment => ENV['RACK_ENV'] || "development", :pid => nil, :Port => [:port], :Host => [:host], :AccessLog => [], :config => "config.ru", # ---------------------------- :server => [:server], :LaunchBrowser => ![:no_browser], :DbDir => [:db], :url => [:url], } opts[:customize] = [:customize] # cdstk(opts[:DbDir]).assert_compatible Milkode::CLI_Cdweb.($stdout, opts) end |