commandlineflunky 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +20 -0
- data/README.md +4 -0
- data/README.rdoc +19 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/commandlineflunky.gemspec +60 -0
- data/lib/commandlineflunky.rb +246 -0
- data/test/helper.rb +18 -0
- data/test/test_commandlineflunky.rb +7 -0
- metadata +127 -0
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "shoulda", ">= 0"
|
10
|
+
gem "rdoc", ">= 3.12"
|
11
|
+
gem "bundler", ">= 1.0.0"
|
12
|
+
gem "jeweler", ">= 1.8.4"
|
13
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 Edmund Highcock
|
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.md
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= commandlineflunky
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Contributing to commandlineflunky
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
+
* Fork the project.
|
10
|
+
* Start a feature/bugfix branch.
|
11
|
+
* Commit and push until you are happy with your contribution.
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2012 Edmund Highcock. See LICENSE.txt for
|
18
|
+
further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "commandlineflunky"
|
18
|
+
gem.homepage = "http://github.com/edmundhighcock/commandlineflunky"
|
19
|
+
gem.license = "GPLv3"
|
20
|
+
gem.summary = %Q{A library for quickly creating a command line program.}
|
21
|
+
gem.description = %Q{A library for quickly creating a command line program. Quickly create commands, options and a built in manual.}
|
22
|
+
gem.email = "edmundhighcock@sourceforge.net"
|
23
|
+
gem.authors = ["Edmund Highcock"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rake/testtask'
|
29
|
+
Rake::TestTask.new(:test) do |test|
|
30
|
+
test.libs << 'lib' << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
|
35
|
+
#require 'rcov/rcovtask'
|
36
|
+
#Rcov::RcovTask.new do |test|
|
37
|
+
##test.libs << 'test'
|
38
|
+
##test.pattern = 'test/**/test_*.rb'
|
39
|
+
##test.verbose = true
|
40
|
+
##test.rcov_opts << '--exclude "gems/*"'
|
41
|
+
##end
|
42
|
+
|
43
|
+
task :default => :test
|
44
|
+
|
45
|
+
require 'rdoc/task'
|
46
|
+
Rake::RDocTask.new do |rdoc|
|
47
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
+
|
49
|
+
rdoc.rdoc_dir = 'rdoc'
|
50
|
+
rdoc.title = "commandlineflunky #{version}"
|
51
|
+
rdoc.rdoc_files.include('README*')
|
52
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "commandlineflunky"
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Edmund Highcock"]
|
12
|
+
s.date = "2012-12-10"
|
13
|
+
s.description = "A library for quickly creating a command line program. Quickly create commands, options and a built in manual."
|
14
|
+
s.email = "edmundhighcock@sourceforge.net"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.md",
|
18
|
+
"README.rdoc"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".document",
|
22
|
+
"Gemfile",
|
23
|
+
"LICENSE.txt",
|
24
|
+
"README.md",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"commandlineflunky.gemspec",
|
29
|
+
"lib/commandlineflunky.rb",
|
30
|
+
"test/helper.rb",
|
31
|
+
"test/test_commandlineflunky.rb"
|
32
|
+
]
|
33
|
+
s.homepage = "http://github.com/edmundhighcock/commandlineflunky"
|
34
|
+
s.licenses = ["GPLv3"]
|
35
|
+
s.require_paths = ["lib"]
|
36
|
+
s.rubygems_version = "1.8.24"
|
37
|
+
s.summary = "A library for quickly creating a command line program."
|
38
|
+
|
39
|
+
if s.respond_to? :specification_version then
|
40
|
+
s.specification_version = 3
|
41
|
+
|
42
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
43
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
44
|
+
s.add_development_dependency(%q<rdoc>, [">= 3.12"])
|
45
|
+
s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
|
46
|
+
s.add_development_dependency(%q<jeweler>, [">= 1.8.4"])
|
47
|
+
else
|
48
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
49
|
+
s.add_dependency(%q<rdoc>, [">= 3.12"])
|
50
|
+
s.add_dependency(%q<bundler>, [">= 1.0.0"])
|
51
|
+
s.add_dependency(%q<jeweler>, [">= 1.8.4"])
|
52
|
+
end
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
55
|
+
s.add_dependency(%q<rdoc>, [">= 3.12"])
|
56
|
+
s.add_dependency(%q<bundler>, [">= 1.0.0"])
|
57
|
+
s.add_dependency(%q<jeweler>, [">= 1.8.4"])
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
@@ -0,0 +1,246 @@
|
|
1
|
+
|
2
|
+
if RUBY_VERSION.to_f < 1.9
|
3
|
+
raise "Ruby version 1.9 or greater required (current version is #{RUBY_VERSION})"
|
4
|
+
end
|
5
|
+
module CommandLineFlunky
|
6
|
+
# $stderr.puts STARTUP_MESSAGE unless $has_put_startup_message
|
7
|
+
|
8
|
+
COMMAND_FOLDER = Dir.pwd
|
9
|
+
SCRIPT_FOLDER = File.dirname(File.expand_path(SCRIPT_FILE)) #i.e. where the script using command line flunky is
|
10
|
+
SYS = (ENV['COMMAND_LINE_FLUNKY_SYSTEM'] or "genericlinux")
|
11
|
+
@@sys = SYS
|
12
|
+
def gets #No reading from the command line thank you very much!
|
13
|
+
$stdin.gets
|
14
|
+
end
|
15
|
+
def self.gets
|
16
|
+
$stdin.gets
|
17
|
+
end
|
18
|
+
end
|
19
|
+
CommandLineFlunky::GLOBAL_BINDING = binding
|
20
|
+
|
21
|
+
# $stderr.print 'Loading libraries...' unless $has_put_startup_message
|
22
|
+
require 'getoptlong'
|
23
|
+
# $stderr.puts unless $has_put_startup_message
|
24
|
+
$has_put_startup_message = true
|
25
|
+
|
26
|
+
# Log.log_file = nil
|
27
|
+
|
28
|
+
|
29
|
+
module CommandLineFlunky
|
30
|
+
# CLF = COMMAND_LINE_FLAGS = []
|
31
|
+
|
32
|
+
# This lists all the commands available on the command line. The first two items in each array indicate the long and short form of the command, and the third indicates the number of arguments the command takes. They are all implemented as Code Runner class methods (the method is named after the long form). The short form of the command is available as a global method in Code Runner interactive mode.
|
33
|
+
|
34
|
+
COMMANDS.push ['interactive_mode', 'im', 0]
|
35
|
+
|
36
|
+
# A lookup hash which gives the appropriate short command option (copt) key for a given long command flag
|
37
|
+
|
38
|
+
CLF_TO_SHORT_COPTS = COMMAND_LINE_FLAGS.inject({}) do |hash, arr|
|
39
|
+
unless arr.size == 2
|
40
|
+
long, short, req = arr
|
41
|
+
letter = short[1,1]
|
42
|
+
hash[long] = letter.to_sym
|
43
|
+
end
|
44
|
+
hash
|
45
|
+
end
|
46
|
+
|
47
|
+
# specifying flag sets a bool to be true
|
48
|
+
|
49
|
+
# CLF_BOOLS = [:H, :U, :u, :A, :a, :T, :N, :q, :z, :d]
|
50
|
+
# CLF_BOOLS = [:s, :r, :D, :H, :U, :u, :L, :l, :A, :a, :T, :N,:V, :q, :z, :d] #
|
51
|
+
|
52
|
+
CLF_INVERSE_BOOLS = [] # specifying flag sets a bool to be false
|
53
|
+
|
54
|
+
# a look up hash that converts the long form of the command options to the short form (NB command options e.g. use_large_cache have a different form from command line flags e.g. --use-large-cache)
|
55
|
+
|
56
|
+
LONG_TO_SHORT = COMMAND_LINE_FLAGS.inject({}) do |hash, arr|
|
57
|
+
unless arr.size == 2 #No short version
|
58
|
+
long, short, req = arr
|
59
|
+
letter = short[1,1]
|
60
|
+
hash[long[2, long.size].gsub(/\-/, '_').to_sym] = letter.to_sym
|
61
|
+
end
|
62
|
+
hash
|
63
|
+
end
|
64
|
+
|
65
|
+
#Converts a command line flag opt with value arg to a command option which is stored in copts
|
66
|
+
|
67
|
+
def self.process_command_line_option(opt, arg, copts)
|
68
|
+
if CLF_BOOLS.include? CLF_TO_SHORT_COPTS[opt]
|
69
|
+
copts[CLF_TO_SHORT_COPTS[opt]] = true
|
70
|
+
elsif CLF_INVERSE_BOOLS.include? CLF_TO_SHORT_COPTS[opt]
|
71
|
+
copts[CLF_TO_SHORT_COPTS[opt]] = false
|
72
|
+
elsif CLF_TO_SHORT_COPTS[opt] # Applies to most options
|
73
|
+
copts[CLF_TO_SHORT_COPTS[opt]] = arg
|
74
|
+
else
|
75
|
+
copts[opt[2, opt.size].gsub(/\-/, '_').to_sym] = arg
|
76
|
+
end
|
77
|
+
copts
|
78
|
+
end
|
79
|
+
|
80
|
+
# Default command options; they are usually determined by the command line flags, but can be set independently
|
81
|
+
|
82
|
+
DEFAULT_COMMAND_OPTIONS = {}
|
83
|
+
|
84
|
+
def self.set_default_command_options_from_command_line
|
85
|
+
opts = GetoptLong.new(*COMMAND_LINE_FLAGS)
|
86
|
+
opts.each do |opt, arg|
|
87
|
+
process_command_line_option(opt, arg, DEFAULT_COMMAND_OPTIONS)
|
88
|
+
end
|
89
|
+
raise "\n\nCannot use large cache ('-U' or '-u' ) if submitting runs" if DEFAULT_COMMAND_OPTIONS[:U] and (DEFAULT_COMMAND_OPTIONS[:s] or DEFAULT_COMMAND_OPTIONS[:P])
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
module CommandLineFlunky
|
94
|
+
|
95
|
+
def self.read_default_command_options(copts)
|
96
|
+
DEFAULT_COMMAND_OPTIONS.each do |key, value|
|
97
|
+
copts[key] ||= value
|
98
|
+
end
|
99
|
+
end
|
100
|
+
# def self.process_command_options(copts)
|
101
|
+
# read_default_command_options(copts)
|
102
|
+
# copts.each do |key, value|
|
103
|
+
# copts[LONG_TO_SHORT[key]] = value if LONG_TO_SHORT[key]
|
104
|
+
# end
|
105
|
+
#
|
106
|
+
#
|
107
|
+
# if copts[:j] # j can be a number '65' or list of numbers '65,43,382'
|
108
|
+
# copts[:f]= "#{eval("[#{copts[:j]}]").inspect}.include? id"
|
109
|
+
# end
|
110
|
+
# if copts[:z]
|
111
|
+
# Log.log_file = Dir.pwd + '/.cr_logfile.txt'
|
112
|
+
# Log.clean_up
|
113
|
+
# else
|
114
|
+
# Log.log_file = nil
|
115
|
+
# end
|
116
|
+
# copts[:F] = (copts[:F].class == Hash ? copts[:F] : (copts[:F].class == String and copts[:F] =~ /\A\{.*\}\Z/) ? eval(copts[:F]) : {})
|
117
|
+
# copts[:G]= [copts[:G]] if copts[:G].kind_of? String
|
118
|
+
# copts[:g]= [copts[:g]] if copts[:g].kind_of? String
|
119
|
+
# if copts[:Y] and copts[:Y] =~ /:/
|
120
|
+
# copts[:running_remotely] = true
|
121
|
+
# else
|
122
|
+
# copts[:Y].gsub!(/~/, ENV['HOME']) if copts[:Y]
|
123
|
+
# Dir.chdir((copts[:Y] or Dir.pwd)) do
|
124
|
+
# set_runner_defaults(copts)
|
125
|
+
# end
|
126
|
+
# end
|
127
|
+
# if copts[:p] and copts[:p].class == String # should be a hash or an inspected hash
|
128
|
+
# copts[:p] = eval(copts[:p])
|
129
|
+
# end
|
130
|
+
# # ep Log.log_file
|
131
|
+
# end
|
132
|
+
#
|
133
|
+
# # Retrieve the runner with the folder (and possibly server) given in copts[:Y]. If no runner has been loaded for that folder, load one.
|
134
|
+
#
|
135
|
+
# def self.fetch_runner(copts={})
|
136
|
+
# # ep copts
|
137
|
+
# process_command_options(copts)
|
138
|
+
# @runners ||= {}
|
139
|
+
# runner = nil
|
140
|
+
# if copts[:Y] and copts[:Y] =~ /:/
|
141
|
+
# copts_r = copts.dup
|
142
|
+
# host, folder = copts[:Y].split(':')
|
143
|
+
# copts_r[:Y] = nil
|
144
|
+
# copts[:Y] = nil
|
145
|
+
# unless @runners[[host, folder]]
|
146
|
+
# runner = @runners[[host, folder]] = RemoteCommandLineFlunky.new(host, folder, copts)
|
147
|
+
# (eputs 'Updating remote...'; runner.update) unless (copts[:g] and (copts[:g].kind_of? String or copts[:g].size > 0)) or copts[:no_update]
|
148
|
+
# else
|
149
|
+
# runner = @runners[[host, folder]]
|
150
|
+
# end
|
151
|
+
# else
|
152
|
+
#
|
153
|
+
# copts[:Y] ||= Dir.pwd
|
154
|
+
# Dir.chdir((copts[:Y] or Dir.pwd)) do
|
155
|
+
# unless @runners[copts[:Y]]
|
156
|
+
# runner = @runners[copts[:Y]] = CommandLineFlunky.new(Dir.pwd, code: copts[:C], modlet: copts[:m], version: copts[:v], executable: copts[:X])
|
157
|
+
# runner.update unless copts[:no_update]
|
158
|
+
# else
|
159
|
+
# runner = @runners[copts[:Y]]
|
160
|
+
# end
|
161
|
+
# # p 'reading defaults', @r.conditions, DEFAULT_RUNNER_OPTIONS
|
162
|
+
# runner.read_defaults
|
163
|
+
# # p 'read defaults', @r.conditions
|
164
|
+
#
|
165
|
+
# end #Dir.chdir
|
166
|
+
# end
|
167
|
+
# return runner
|
168
|
+
# # @r.read_defaults
|
169
|
+
# end
|
170
|
+
# def self.update_runners
|
171
|
+
# @runners ||= {}
|
172
|
+
# @runners.each{|runner| runner.update}
|
173
|
+
# end
|
174
|
+
|
175
|
+
|
176
|
+
INTERACTIVE_METHODS = <<EOF
|
177
|
+
CommandLineFlunky::COMMANDS.each do |command|
|
178
|
+
eval("def #\{command[1]}(*args)
|
179
|
+
CommandLineFlunky.send(#\{command[0].to_sym.inspect}, *args)
|
180
|
+
end")
|
181
|
+
|
182
|
+
EOF
|
183
|
+
def self.runner
|
184
|
+
@runner
|
185
|
+
end
|
186
|
+
|
187
|
+
def CommandLineFlunky.interactive_mode(copts={})
|
188
|
+
# process_command_options(copts)
|
189
|
+
unless false and FileTest.exist? (ENV['HOME'] + "/.#{PROJECT_NAME}_interactive_options.rb")
|
190
|
+
File.open(ENV['HOME'] + "/.#{PROJECT_NAME}_interactive_options.rb", 'w') do |file|
|
191
|
+
file.puts <<EOF
|
192
|
+
$has_put_startup_message = true #please leave!
|
193
|
+
$command_line_flunky_interactive_mode = true #please leave!
|
194
|
+
require 'yaml'
|
195
|
+
|
196
|
+
def reset
|
197
|
+
Dispatcher.reset_application!
|
198
|
+
end
|
199
|
+
|
200
|
+
IRB.conf[:AUTO_INDENT] = true
|
201
|
+
IRB.conf[:USE_READLINE] = true
|
202
|
+
IRB.conf[:LOAD_MODULES] = [] unless IRB.conf.key?(:LOAD_MODULES)
|
203
|
+
unless IRB.conf[:LOAD_MODULES].include?('irb/completion')
|
204
|
+
IRB.conf[:LOAD_MODULES] << 'irb/completion'
|
205
|
+
end
|
206
|
+
|
207
|
+
|
208
|
+
require 'irb/completion'
|
209
|
+
require 'irb/ext/save-history'
|
210
|
+
IRB.conf[:PROMPT_MODE] = :SIMPLE
|
211
|
+
IRB.conf[:SAVE_HISTORY] = 100
|
212
|
+
IRB.conf[:HISTORY_FILE] = "\#\{ENV['HOME']}/.#{PROJECT_NAME}_irb_save_history"
|
213
|
+
IRB.conf[:INSPECT_MODE] = false
|
214
|
+
|
215
|
+
|
216
|
+
EOF
|
217
|
+
end
|
218
|
+
end
|
219
|
+
File.open(".int.tmp.rb", 'w')do |file|
|
220
|
+
file.puts "#{copts.inspect}.each do |key, val|
|
221
|
+
CommandLineFlunky::DEFAULT_COMMAND_OPTIONS[key] = val
|
222
|
+
end"
|
223
|
+
file.puts CommandLineFlunky::INTERACTIVE_METHODS
|
224
|
+
end
|
225
|
+
exec %[#{Config::CONFIG['bindir']}/irb#{Config::CONFIG['ruby_install_name'].sub(/ruby/, '')} -f -I '#{SCRIPT_FOLDER}' -I '#{File.dirname(__FILE__)}' -I '#{Dir.pwd}' -I '#{ENV['HOME']}' -r '.#{PROJECT_NAME}_interactive_options' -r '#{File.basename(SCRIPT_FILE)}' -r .int.tmp ]
|
226
|
+
end
|
227
|
+
|
228
|
+
# # def self.setup
|
229
|
+
# # end
|
230
|
+
|
231
|
+
def CommandLineFlunky.run_script
|
232
|
+
CommandLineFlunky.setup(DEFAULT_COMMAND_OPTIONS)
|
233
|
+
return if $command_line_flunky_interactive_mode
|
234
|
+
command = COMMANDS.find{|com| com.slice(0..1).include? ARGV[0]}
|
235
|
+
raise "Command #{ARGV[0]} not found" unless command
|
236
|
+
send(command[0].to_sym, *ARGV.slice(1...(1+command[2])), DEFAULT_COMMAND_OPTIONS)
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
CommandLineFlunky.set_default_command_options_from_command_line
|
241
|
+
|
242
|
+
####################
|
243
|
+
# CommandLineFlunky.run_script unles
|
244
|
+
###################
|
245
|
+
|
246
|
+
|
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'commandlineflunky'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: commandlineflunky
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Edmund Highcock
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: shoulda
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rdoc
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '3.12'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '3.12'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: bundler
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.0.0
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.0.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: jeweler
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.8.4
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.8.4
|
78
|
+
description: A library for quickly creating a command line program. Quickly create
|
79
|
+
commands, options and a built in manual.
|
80
|
+
email: edmundhighcock@sourceforge.net
|
81
|
+
executables: []
|
82
|
+
extensions: []
|
83
|
+
extra_rdoc_files:
|
84
|
+
- LICENSE.txt
|
85
|
+
- README.md
|
86
|
+
- README.rdoc
|
87
|
+
files:
|
88
|
+
- .document
|
89
|
+
- Gemfile
|
90
|
+
- LICENSE.txt
|
91
|
+
- README.md
|
92
|
+
- README.rdoc
|
93
|
+
- Rakefile
|
94
|
+
- VERSION
|
95
|
+
- commandlineflunky.gemspec
|
96
|
+
- lib/commandlineflunky.rb
|
97
|
+
- test/helper.rb
|
98
|
+
- test/test_commandlineflunky.rb
|
99
|
+
homepage: http://github.com/edmundhighcock/commandlineflunky
|
100
|
+
licenses:
|
101
|
+
- GPLv3
|
102
|
+
post_install_message:
|
103
|
+
rdoc_options: []
|
104
|
+
require_paths:
|
105
|
+
- lib
|
106
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ! '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
segments:
|
113
|
+
- 0
|
114
|
+
hash: -681905963035614078
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
117
|
+
requirements:
|
118
|
+
- - ! '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
requirements: []
|
122
|
+
rubyforge_project:
|
123
|
+
rubygems_version: 1.8.24
|
124
|
+
signing_key:
|
125
|
+
specification_version: 3
|
126
|
+
summary: A library for quickly creating a command line program.
|
127
|
+
test_files: []
|