clone 1.0.0.alpha → 1.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/Gemfile +1 -0
- data/LICENSE.txt +22 -0
- data/README.md +22 -1
- data/VERSION +1 -1
- data/bin/clone +7 -0
- data/clone.gemspec +4 -0
- data/docs/readme +16 -0
- data/docs/readme.txt +5 -0
- data/lib/clone.rb +13 -2
- data/lib/clone/config/config.rb +19 -0
- data/lib/clone/config/config.yml +22 -0
- data/lib/clone/config/default_config.yml +20 -0
- data/lib/clone/config/require.rb +3 -0
- data/lib/clone/config/version.rb +10 -0
- data/lib/clone/config/yml.rb +22 -0
- data/lib/clone/config/z_defaults.rb +28 -0
- data/lib/clone/generator/engine.rb +581 -0
- data/lib/clone/generator/terminal.rb +104 -0
- data/lib/clone/helpers/helper_methods.rb +251 -0
- data/lib/clone/helpers/local_methods.rb +150 -0
- data/lib/clone/helpers/require.rb +37 -0
- data/module/Marshal.4.8 +0 -0
- data/module/Marshal.4.8.Z +0 -0
- data/module/gems/commander-4.1.3/.gitignore +6 -0
- data/module/gems/commander-4.1.3/.travis.yml +11 -0
- data/module/gems/commander-4.1.3/DEVELOPMENT +15 -0
- data/module/gems/commander-4.1.3/Gemfile +3 -0
- data/module/gems/commander-4.1.3/History.rdoc +345 -0
- data/module/gems/commander-4.1.3/Manifest +38 -0
- data/module/gems/commander-4.1.3/README.rdoc +375 -0
- data/module/gems/commander-4.1.3/Rakefile +10 -0
- data/module/gems/commander-4.1.3/bin/commander +55 -0
- data/module/gems/commander-4.1.3/commander.gemspec +26 -0
- data/module/gems/commander-4.1.3/lib/commander.rb +32 -0
- data/module/gems/commander-4.1.3/lib/commander/blank.rb +8 -0
- data/module/gems/commander-4.1.3/lib/commander/command.rb +213 -0
- data/module/gems/commander-4.1.3/lib/commander/core_ext.rb +3 -0
- data/module/gems/commander-4.1.3/lib/commander/core_ext/array.rb +26 -0
- data/module/gems/commander-4.1.3/lib/commander/core_ext/object.rb +11 -0
- data/module/gems/commander-4.1.3/lib/commander/delegates.rb +13 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters.rb +8 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/base.rb +18 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal.rb +20 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal/command_help.erb +35 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal/help.erb +36 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal_compact.rb +12 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal_compact/command_help.erb +27 -0
- data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal_compact/help.erb +29 -0
- data/module/gems/commander-4.1.3/lib/commander/import.rb +10 -0
- data/module/gems/commander-4.1.3/lib/commander/platform.rb +8 -0
- data/module/gems/commander-4.1.3/lib/commander/runner.rb +411 -0
- data/module/gems/commander-4.1.3/lib/commander/user_interaction.rb +521 -0
- data/module/gems/commander-4.1.3/lib/commander/version.rb +3 -0
- data/module/gems/commander-4.1.3/spec/command_spec.rb +157 -0
- data/module/gems/commander-4.1.3/spec/core_ext/array_spec.rb +20 -0
- data/module/gems/commander-4.1.3/spec/core_ext/object_spec.rb +21 -0
- data/module/gems/commander-4.1.3/spec/help_formatters/terminal_spec.rb +67 -0
- data/module/gems/commander-4.1.3/spec/runner_spec.rb +526 -0
- data/module/gems/commander-4.1.3/spec/spec_helper.rb +59 -0
- data/module/gems/commander-4.1.3/spec/ui_spec.rb +30 -0
- data/module/gems/hello.rb +1 -0
- data/module/gems/highline-1.6.19/.gitignore +2 -0
- data/module/gems/highline-1.6.19/AUTHORS +3 -0
- data/module/gems/highline-1.6.19/CHANGELOG +346 -0
- data/module/gems/highline-1.6.19/COPYING +340 -0
- data/module/gems/highline-1.6.19/INSTALL +55 -0
- data/module/gems/highline-1.6.19/LICENSE +7 -0
- data/module/gems/highline-1.6.19/README.rdoc +63 -0
- data/module/gems/highline-1.6.19/Rakefile +50 -0
- data/module/gems/highline-1.6.19/TODO +6 -0
- data/module/gems/highline-1.6.19/examples/ansi_colors.rb +38 -0
- data/module/gems/highline-1.6.19/examples/asking_for_arrays.rb +18 -0
- data/module/gems/highline-1.6.19/examples/basic_usage.rb +75 -0
- data/module/gems/highline-1.6.19/examples/color_scheme.rb +32 -0
- data/module/gems/highline-1.6.19/examples/get_character.rb +12 -0
- data/module/gems/highline-1.6.19/examples/limit.rb +12 -0
- data/module/gems/highline-1.6.19/examples/menus.rb +65 -0
- data/module/gems/highline-1.6.19/examples/overwrite.rb +19 -0
- data/module/gems/highline-1.6.19/examples/page_and_wrap.rb +322 -0
- data/module/gems/highline-1.6.19/examples/password.rb +7 -0
- data/module/gems/highline-1.6.19/examples/repeat_entry.rb +21 -0
- data/module/gems/highline-1.6.19/examples/trapping_eof.rb +22 -0
- data/module/gems/highline-1.6.19/examples/using_readline.rb +17 -0
- data/module/gems/highline-1.6.19/highline.gemspec +37 -0
- data/module/gems/highline-1.6.19/lib/highline.rb +1012 -0
- data/module/gems/highline-1.6.19/lib/highline/color_scheme.rb +134 -0
- data/module/gems/highline-1.6.19/lib/highline/compatibility.rb +16 -0
- data/module/gems/highline-1.6.19/lib/highline/import.rb +41 -0
- data/module/gems/highline-1.6.19/lib/highline/menu.rb +398 -0
- data/module/gems/highline-1.6.19/lib/highline/question.rb +475 -0
- data/module/gems/highline-1.6.19/lib/highline/simulate.rb +48 -0
- data/module/gems/highline-1.6.19/lib/highline/string_extensions.rb +131 -0
- data/module/gems/highline-1.6.19/lib/highline/style.rb +181 -0
- data/module/gems/highline-1.6.19/lib/highline/system_extensions.rb +222 -0
- data/module/gems/highline-1.6.19/setup.rb +1360 -0
- data/module/gems/highline-1.6.19/site/.cvsignore +1 -0
- data/module/gems/highline-1.6.19/site/highline.css +65 -0
- data/module/gems/highline-1.6.19/site/images/logo.png +0 -0
- data/module/gems/highline-1.6.19/site/index.html +58 -0
- data/module/gems/highline-1.6.19/test/string_methods.rb +32 -0
- data/module/gems/highline-1.6.19/test/tc_color_scheme.rb +96 -0
- data/module/gems/highline-1.6.19/test/tc_highline.rb +1128 -0
- data/module/gems/highline-1.6.19/test/tc_import.rb +52 -0
- data/module/gems/highline-1.6.19/test/tc_menu.rb +439 -0
- data/module/gems/highline-1.6.19/test/tc_string_extension.rb +20 -0
- data/module/gems/highline-1.6.19/test/tc_string_highline.rb +38 -0
- data/module/gems/highline-1.6.19/test/tc_style.rb +567 -0
- data/module/gems/highline-1.6.19/test/ts_all.rb +16 -0
- data/module/latest_specs.4.8 +0 -0
- data/module/latest_specs.4.8.gz +0 -0
- data/module/prerelease_specs.4.8 +0 -0
- data/module/prerelease_specs.4.8.gz +0 -0
- data/module/specs.4.8 +0 -0
- data/module/specs.4.8.gz +0 -0
- data/samples/blather/restlike/Gemfile +4 -0
- data/samples/blather/restlike/cmd.yml +1 -0
- data/samples/blather/restlike/lib/blather.rb +9 -0
- data/samples/blather/restlike/lib/blather/dsl/api.rb +78 -0
- data/samples/blather/restlike/lib/blather/dsl/call.rb +13 -0
- data/samples/blather/restlike/lib/blather/dsl/client.rb +58 -0
- data/samples/blather/restlike/lib/blather/dsl/config.rb +11 -0
- data/samples/blather/restlike/lib/blather/dsl/extraDSL.rb +163 -0
- data/samples/blather/restlike/lib/blather/meta/require.rb +8 -0
- data/samples/blather/restlike/lib/blather/meta/xmpp.yml +5 -0
- data/samples/blather/restlike/lib/blather/vendors/xmpp_default.rb +27 -0
- data/samples/blather/restlike/readme +2 -0
- data/samples/grape/init/Gemfile +2 -0
- data/samples/grape/init/cmd.yml +3 -0
- data/samples/grape/init/config.ru +2 -0
- data/samples/grape/init/docs/grape/documentation.txt +939 -0
- data/samples/grape/init/docs/grape/generate_rest_routes.rb +37 -0
- data/samples/grape/init/docs/grape/ls_routes.rb +31 -0
- data/samples/grape/init/lib/grape.rb +4 -0
- data/samples/grape/init/lib/grape/meta/subclasses.rb +20 -0
- data/samples/grape/init/lib/grape/xpath/app.rb +30 -0
- data/samples/grape/init/lib/grape/xpath/ruotes.rb +6 -0
- data/samples/grape/init/readme +1 -0
- data/samples/grape/readme +29 -0
- data/samples/grape/vendor/lib/grape/vendors/v1/rest.rb +57 -0
- data/samples/mongoid/cmd.yml +1 -0
- data/samples/mongoid/init/Gemfile +3 -0
- data/samples/mongoid/init/cmd.yml +2 -0
- data/samples/mongoid/init/docs/mongoid/ModelsRelations.rb +11 -0
- data/samples/mongoid/init/docs/mongoid/documents.xls +0 -0
- data/samples/mongoid/init/docs/mongoid/generate_modelsToDocs.rb +25 -0
- data/samples/mongoid/init/docs/mongoid/modelsToDocs.rb +25 -0
- data/samples/mongoid/init/docs/mongoid/relations.txt +1354 -0
- data/samples/mongoid/init/lib/mongoid.rb +44 -0
- data/samples/mongoid/init/lib/mongoid/dsl/extraDSL_CRUD.rb +446 -0
- data/samples/mongoid/init/lib/mongoid/dsl/extraDSL_MP.rb +517 -0
- data/samples/mongoid/init/lib/mongoid/dsl/init.rb +37 -0
- data/samples/mongoid/init/lib/mongoid/dsl/params.rb +67 -0
- data/samples/mongoid/init/lib/mongoid/meta/banned.rb +147 -0
- data/samples/mongoid/init/lib/mongoid/meta/control.yml +13 -0
- data/samples/mongoid/init/lib/mongoid/meta/mongoid.yml +6 -0
- data/samples/mongoid/init/lib/mongoid/meta/mpatch.rb +14 -0
- data/samples/mongoid/model/lib/mongoid/models/model.rb +28 -0
- data/samples/mongoid/readme +33 -0
- data/samples/rack/init/Gemfile +10 -0
- data/samples/rack/init/cmd.yml +2 -0
- data/samples/rack/init/config.ru +1 -0
- data/samples/rack/init/docs/rack/rake introducing.txt +60 -0
- data/samples/rack/init/docs/rack/webservers/Thin +43 -0
- data/samples/rack/init/docs/rack/webservers/ebb +72 -0
- data/samples/rack/init/docs/rack/webservers/fcgi +103 -0
- data/samples/rack/init/docs/rack/webservers/mongrel +74 -0
- data/samples/rack/init/docs/rack/webservers/passenger +37 -0
- data/samples/rack/init/docs/rack/webservers/scgi +188 -0
- data/samples/rack/init/lib/rack.rb +1 -0
- data/samples/rack/init/lib/rack/meta/webserver/thin.rb +45 -0
- data/samples/rack/init/lib/rack/meta/webserver/thin.yml +6 -0
- data/samples/rack/init/server.rb +0 -0
- data/samples/rack/readme +13 -0
- data/samples/rest_client/init/Gemfile +5 -0
- data/samples/rest_client/init/boot.rb +2 -0
- data/samples/rest_client/init/cmd.yml +1 -0
- data/samples/rest_client/init/config/rest_client/defaults.rb +16 -0
- data/samples/rest_client/init/docs/rest_client/simple overlook +251 -0
- data/samples/rest_client/init/test/rest_client/rest_dsl.rb +5 -0
- data/samples/rest_client/readme +7 -0
- data/samples/scripts/lines_counter/lines_number.rb +32 -0
- data/samples/scripts/lines_counter/readme +5 -0
- data/samples/scripts/readme +1 -0
- metadata +197 -7
- data/lib/clone/cms.rb +0 -56
- data/lib/clone/ext.rb +0 -77
- data/sample/test.rb +0 -30
data/lib/clone/cms.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
module ARGVEXT
|
2
|
-
|
3
|
-
module MemoryCore
|
4
|
-
class << self
|
5
|
-
|
6
|
-
@@help_msg_obj ||= []
|
7
|
-
def add_help_msg msg,*keys
|
8
|
-
raise unless msg.class <= String
|
9
|
-
@@help_msg_obj.push [msg,keys]
|
10
|
-
return nil
|
11
|
-
end
|
12
|
-
|
13
|
-
def help_msg
|
14
|
-
|
15
|
-
helper_sym= [:helper,:help,:h]
|
16
|
-
self.add_help_msg "This will show you the help msg (this)",*helper_sym
|
17
|
-
unless ::ARGV.sym_flags.select{ |e| helper_sym.include?(e) }.empty?
|
18
|
-
|
19
|
-
tmp_ary= []
|
20
|
-
@@help_msg_obj.each{ |ary|
|
21
|
-
tmp_ary.push(ary[0])
|
22
|
-
ary[1].each{|e| tmp_ary.push( ( e.to_s.length == 1 ? "-#{e}" : "--#{e}" ) )}
|
23
|
-
tmp_ary.push("")
|
24
|
-
}
|
25
|
-
|
26
|
-
tmp_ary.each{ |element| element.include?('--') ? element.gsub!('--',"\t--") : element.gsub!('-',"\t -")}
|
27
|
-
puts "",tmp_ary.join("\n"),""
|
28
|
-
Process.exit!
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
module MemoryEXT
|
37
|
-
|
38
|
-
def add_help_msg msg,*keys
|
39
|
-
::ARGVEXT::MemoryCore.add_help_msg msg,*keys
|
40
|
-
end
|
41
|
-
|
42
|
-
alias :add_help :add_help_msg
|
43
|
-
|
44
|
-
def help_msg
|
45
|
-
::ARGVEXT::MemoryCore.help_msg
|
46
|
-
end
|
47
|
-
|
48
|
-
alias :show_help :help_msg
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
self.extend MemoryEXT
|
53
|
-
|
54
|
-
end
|
55
|
-
|
56
|
-
ARGV.__send__ :extend, ARGVEXT::MemoryEXT
|
data/lib/clone/ext.rb
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
module ARGVEXT
|
2
|
-
|
3
|
-
module EXTENSION
|
4
|
-
|
5
|
-
def to_hash opts= {}
|
6
|
-
raise(ArgumentError) unless opts.class <= Hash
|
7
|
-
|
8
|
-
opts[:sym_key] ||= opts[:sk] || opts[:sym] || opts[:s]
|
9
|
-
opts[:multi_value] ||= opts[:mv] || opts[:m]
|
10
|
-
|
11
|
-
return_obj= {}
|
12
|
-
self.count.times do |index|
|
13
|
-
unless opts[:multi_value]
|
14
|
-
|
15
|
-
next if self[index+1].nil?
|
16
|
-
if self[index][0].include?('-') && !self[index+1][0].include?('-')
|
17
|
-
return_obj[( opts[:sym_key] ? self[index].to_s.dup.gsub!(/^-*/,'').to_sym : self[index] )]= self[index+1]
|
18
|
-
end
|
19
|
-
|
20
|
-
else
|
21
|
-
|
22
|
-
begin
|
23
|
-
|
24
|
-
if self[index][0].include?('-') && !self[index+1][0].include?('-')
|
25
|
-
|
26
|
-
new_element= []
|
27
|
-
index_at= index+1
|
28
|
-
loop do
|
29
|
-
if self[index_at].nil? || self[index_at].to_s[0].include?('-')
|
30
|
-
break
|
31
|
-
else
|
32
|
-
new_element.push(self[index_at])
|
33
|
-
end
|
34
|
-
index_at += 1
|
35
|
-
end
|
36
|
-
return_obj[( opts[:sym_key] ? self[index].to_s.dup.gsub!(/^-*/,'').to_sym : self[index] )]= new_element
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
rescue
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
end
|
45
|
-
end
|
46
|
-
return return_obj
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
alias :flagtag :to_hash
|
51
|
-
alias :flagtags :to_hash
|
52
|
-
|
53
|
-
def flags
|
54
|
-
self.select { |e| e[0].include?('-') }
|
55
|
-
end
|
56
|
-
|
57
|
-
alias :flag :flags
|
58
|
-
alias :tags :flags
|
59
|
-
alias :keys :flags
|
60
|
-
|
61
|
-
def sym_flags
|
62
|
-
self.flags.map { |e| e.to_s.dup.gsub!(/^-*/,'').to_sym }
|
63
|
-
end
|
64
|
-
|
65
|
-
alias :flag_syms :sym_flags
|
66
|
-
alias :flag_sym :sym_flags
|
67
|
-
alias :tag_syms :sym_flags
|
68
|
-
alias :key_syms :sym_flags
|
69
|
-
|
70
|
-
def values
|
71
|
-
self.select { |e| !e[0].include?('-') }
|
72
|
-
end
|
73
|
-
|
74
|
-
end
|
75
|
-
|
76
|
-
end
|
77
|
-
ARGV.__send__ :extend,ARGVEXT::EXTENSION
|
data/sample/test.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require "argv"
|
2
|
-
|
3
|
-
#$ ruby sample/test.rb --test test this ok
|
4
|
-
|
5
|
-
# new help
|
6
|
-
ARGV.add_help "heeeelp meeeeee~~~",:no
|
7
|
-
|
8
|
-
ARGV.show_help
|
9
|
-
|
10
|
-
puts "","original ARGV:",ARGV.inspect,""
|
11
|
-
|
12
|
-
puts "hash from argv:",ARGV.to_hash,""
|
13
|
-
# {"--test"=>"test"}
|
14
|
-
|
15
|
-
puts "multi valued hash:",ARGV.to_hash( multi_value: true ),""
|
16
|
-
# {"--test"=>["test", "this", "ok"]}
|
17
|
-
|
18
|
-
puts "sym keyed hash:",ARGV.to_hash( sym_key: true ),""
|
19
|
-
# {:test=>"test"}
|
20
|
-
|
21
|
-
puts "sym keyed multi valued hash:",ARGV.to_hash( s: true, m: true ),""
|
22
|
-
# {:test=>["test", "this", "ok"]}
|
23
|
-
|
24
|
-
puts "argv values without the tags:",ARGV.values.inspect,""
|
25
|
-
# ["test", "this", "ok"]
|
26
|
-
|
27
|
-
puts "argv tags, \"keys\":",ARGV.keys.inspect,""
|
28
|
-
# ["--test"]
|
29
|
-
|
30
|
-
puts "symbolized flags:",ARGV.sym_flags.inspect,""
|