Adding 'yadr' command for managing plugins (wip)
This commit is contained in:
4
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/flickr
vendored
Executable file
4
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/flickr
vendored
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env ruby
|
||||
$:.unshift(File.dirname(__FILE__) + "/../../lib")
|
||||
VERSION="0.0.2" # just to test it
|
||||
require 'git-style-binary/command'
|
||||
17
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/flickr-download
vendored
Executable file
17
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/flickr-download
vendored
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env ruby
|
||||
$:.unshift(File.dirname(__FILE__) + "/../../lib")
|
||||
require 'git-style-binary/command'
|
||||
|
||||
GitStyleBinary.command do
|
||||
short_desc "download a flickr image"
|
||||
banner <<-EOS
|
||||
SYNOPSIS
|
||||
#{command.full_name} #{all_options_string} url
|
||||
|
||||
Downloads an image from flickr
|
||||
|
||||
EOS
|
||||
run do |command|
|
||||
puts "would download: #{command.argv.inspect}"
|
||||
end
|
||||
end
|
||||
42
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/wordpress
vendored
Executable file
42
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/wordpress
vendored
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env ruby
|
||||
$:.unshift(File.dirname(__FILE__) + "/../../lib")
|
||||
|
||||
require 'git-style-binary/command'
|
||||
GitStyleBinary.primary do
|
||||
version "0.0.1 (c) 2009 Nate Murray - local"
|
||||
opt :test_primary, "test an option on the primary", :type => String
|
||||
|
||||
action do
|
||||
@categories = ["sports", "news"]
|
||||
end
|
||||
|
||||
before_run do |cmd|
|
||||
puts "before_run command #{cmd}"
|
||||
end
|
||||
|
||||
after_run do |cmd|
|
||||
puts "after_run command #{cmd}"
|
||||
end
|
||||
|
||||
run do |command|
|
||||
puts "Primary Options: #{command.opts.inspect}"
|
||||
end
|
||||
end
|
||||
|
||||
# OR
|
||||
|
||||
# require 'git-style-binary/primary'
|
||||
# command = GitStyleBinary::primary("wordpress") do
|
||||
# version "#{$0} 0.0.1 (c) 2009 Nate Murray"
|
||||
# banner <<-EOS
|
||||
# usage: #{$0} #{all_options.collect(:&to_s).join(" ")} COMMAND [ARGS]
|
||||
#
|
||||
# The wordpress subcommands commands are:
|
||||
# {subcommand_names.pretty_print}
|
||||
#
|
||||
# See 'wordpress help COMMAND' for more information on a specific command.
|
||||
# EOS
|
||||
# opt :verbose, "verbose", :default => false
|
||||
# opt :dry, "dry run", :default => false
|
||||
# opt :test_global, "a basic global string option", :type => String
|
||||
# end
|
||||
18
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/wordpress-categories
vendored
Executable file
18
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/wordpress-categories
vendored
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env ruby
|
||||
$:.unshift(File.dirname(__FILE__) + "/../../lib")
|
||||
require 'git-style-binary/command'
|
||||
|
||||
GitStyleBinary.command do
|
||||
short_desc "do something with categories"
|
||||
banner <<-EOS
|
||||
SYNOPSIS
|
||||
#{command.full_name} #{all_options_string}
|
||||
|
||||
Does something with categories
|
||||
|
||||
EOS
|
||||
run do |command|
|
||||
puts "does something with categories"
|
||||
puts @categories.join(" ")
|
||||
end
|
||||
end
|
||||
18
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/wordpress-list
vendored
Executable file
18
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/wordpress-list
vendored
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env ruby
|
||||
$:.unshift(File.dirname(__FILE__) + "/../../lib")
|
||||
require 'git-style-binary/command'
|
||||
|
||||
GitStyleBinary.command do
|
||||
short_desc "list blog postings"
|
||||
banner <<-EOS
|
||||
SYNOPSIS
|
||||
#{command.full_name} #{all_options_string}
|
||||
|
||||
Lists the posts on the blog
|
||||
|
||||
EOS
|
||||
run do |command|
|
||||
puts "listing blog posts"
|
||||
end
|
||||
end
|
||||
|
||||
26
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/wordpress-post
vendored
Executable file
26
bin/yadr/lib/git-style-binaries-0.1.11/test/fixtures/wordpress-post
vendored
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env ruby
|
||||
$:.unshift(File.dirname(__FILE__) + "/../../lib")
|
||||
require 'git-style-binary/command'
|
||||
|
||||
GitStyleBinary.command do
|
||||
short_desc "create a blog post"
|
||||
banner <<-EOS
|
||||
SYNOPSIS
|
||||
#{command.full_name} #{all_options_string} {content|STDIN}
|
||||
|
||||
EOS
|
||||
opt :blog, "short name of the blog to use", :default => 'default'
|
||||
opt :category, "tag/category. specify multiple times for multiple categories", :type => String, :multi => true
|
||||
opt :title, "title for the post", :required => true, :type => String
|
||||
opt :type, "type of the content [html|xhtml|text]", :default => 'html', :type => String
|
||||
|
||||
run do |command|
|
||||
command.die :type, "type must be one of [html|xhtml|text]" unless command.opts[:type] =~ /^(x?html|text)$/i
|
||||
|
||||
puts "Subcommand name: #{command.name.inspect}"
|
||||
puts "Options: #{command.opts.inspect}"
|
||||
puts "Remaining arguments: #{command.argv.inspect}"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user