clone 1.0.0.alpha → 1.0.0.beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/Gemfile +1 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +22 -1
  6. data/VERSION +1 -1
  7. data/bin/clone +7 -0
  8. data/clone.gemspec +4 -0
  9. data/docs/readme +16 -0
  10. data/docs/readme.txt +5 -0
  11. data/lib/clone.rb +13 -2
  12. data/lib/clone/config/config.rb +19 -0
  13. data/lib/clone/config/config.yml +22 -0
  14. data/lib/clone/config/default_config.yml +20 -0
  15. data/lib/clone/config/require.rb +3 -0
  16. data/lib/clone/config/version.rb +10 -0
  17. data/lib/clone/config/yml.rb +22 -0
  18. data/lib/clone/config/z_defaults.rb +28 -0
  19. data/lib/clone/generator/engine.rb +581 -0
  20. data/lib/clone/generator/terminal.rb +104 -0
  21. data/lib/clone/helpers/helper_methods.rb +251 -0
  22. data/lib/clone/helpers/local_methods.rb +150 -0
  23. data/lib/clone/helpers/require.rb +37 -0
  24. data/module/Marshal.4.8 +0 -0
  25. data/module/Marshal.4.8.Z +0 -0
  26. data/module/gems/commander-4.1.3/.gitignore +6 -0
  27. data/module/gems/commander-4.1.3/.travis.yml +11 -0
  28. data/module/gems/commander-4.1.3/DEVELOPMENT +15 -0
  29. data/module/gems/commander-4.1.3/Gemfile +3 -0
  30. data/module/gems/commander-4.1.3/History.rdoc +345 -0
  31. data/module/gems/commander-4.1.3/Manifest +38 -0
  32. data/module/gems/commander-4.1.3/README.rdoc +375 -0
  33. data/module/gems/commander-4.1.3/Rakefile +10 -0
  34. data/module/gems/commander-4.1.3/bin/commander +55 -0
  35. data/module/gems/commander-4.1.3/commander.gemspec +26 -0
  36. data/module/gems/commander-4.1.3/lib/commander.rb +32 -0
  37. data/module/gems/commander-4.1.3/lib/commander/blank.rb +8 -0
  38. data/module/gems/commander-4.1.3/lib/commander/command.rb +213 -0
  39. data/module/gems/commander-4.1.3/lib/commander/core_ext.rb +3 -0
  40. data/module/gems/commander-4.1.3/lib/commander/core_ext/array.rb +26 -0
  41. data/module/gems/commander-4.1.3/lib/commander/core_ext/object.rb +11 -0
  42. data/module/gems/commander-4.1.3/lib/commander/delegates.rb +13 -0
  43. data/module/gems/commander-4.1.3/lib/commander/help_formatters.rb +8 -0
  44. data/module/gems/commander-4.1.3/lib/commander/help_formatters/base.rb +18 -0
  45. data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal.rb +20 -0
  46. data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal/command_help.erb +35 -0
  47. data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal/help.erb +36 -0
  48. data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal_compact.rb +12 -0
  49. data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal_compact/command_help.erb +27 -0
  50. data/module/gems/commander-4.1.3/lib/commander/help_formatters/terminal_compact/help.erb +29 -0
  51. data/module/gems/commander-4.1.3/lib/commander/import.rb +10 -0
  52. data/module/gems/commander-4.1.3/lib/commander/platform.rb +8 -0
  53. data/module/gems/commander-4.1.3/lib/commander/runner.rb +411 -0
  54. data/module/gems/commander-4.1.3/lib/commander/user_interaction.rb +521 -0
  55. data/module/gems/commander-4.1.3/lib/commander/version.rb +3 -0
  56. data/module/gems/commander-4.1.3/spec/command_spec.rb +157 -0
  57. data/module/gems/commander-4.1.3/spec/core_ext/array_spec.rb +20 -0
  58. data/module/gems/commander-4.1.3/spec/core_ext/object_spec.rb +21 -0
  59. data/module/gems/commander-4.1.3/spec/help_formatters/terminal_spec.rb +67 -0
  60. data/module/gems/commander-4.1.3/spec/runner_spec.rb +526 -0
  61. data/module/gems/commander-4.1.3/spec/spec_helper.rb +59 -0
  62. data/module/gems/commander-4.1.3/spec/ui_spec.rb +30 -0
  63. data/module/gems/hello.rb +1 -0
  64. data/module/gems/highline-1.6.19/.gitignore +2 -0
  65. data/module/gems/highline-1.6.19/AUTHORS +3 -0
  66. data/module/gems/highline-1.6.19/CHANGELOG +346 -0
  67. data/module/gems/highline-1.6.19/COPYING +340 -0
  68. data/module/gems/highline-1.6.19/INSTALL +55 -0
  69. data/module/gems/highline-1.6.19/LICENSE +7 -0
  70. data/module/gems/highline-1.6.19/README.rdoc +63 -0
  71. data/module/gems/highline-1.6.19/Rakefile +50 -0
  72. data/module/gems/highline-1.6.19/TODO +6 -0
  73. data/module/gems/highline-1.6.19/examples/ansi_colors.rb +38 -0
  74. data/module/gems/highline-1.6.19/examples/asking_for_arrays.rb +18 -0
  75. data/module/gems/highline-1.6.19/examples/basic_usage.rb +75 -0
  76. data/module/gems/highline-1.6.19/examples/color_scheme.rb +32 -0
  77. data/module/gems/highline-1.6.19/examples/get_character.rb +12 -0
  78. data/module/gems/highline-1.6.19/examples/limit.rb +12 -0
  79. data/module/gems/highline-1.6.19/examples/menus.rb +65 -0
  80. data/module/gems/highline-1.6.19/examples/overwrite.rb +19 -0
  81. data/module/gems/highline-1.6.19/examples/page_and_wrap.rb +322 -0
  82. data/module/gems/highline-1.6.19/examples/password.rb +7 -0
  83. data/module/gems/highline-1.6.19/examples/repeat_entry.rb +21 -0
  84. data/module/gems/highline-1.6.19/examples/trapping_eof.rb +22 -0
  85. data/module/gems/highline-1.6.19/examples/using_readline.rb +17 -0
  86. data/module/gems/highline-1.6.19/highline.gemspec +37 -0
  87. data/module/gems/highline-1.6.19/lib/highline.rb +1012 -0
  88. data/module/gems/highline-1.6.19/lib/highline/color_scheme.rb +134 -0
  89. data/module/gems/highline-1.6.19/lib/highline/compatibility.rb +16 -0
  90. data/module/gems/highline-1.6.19/lib/highline/import.rb +41 -0
  91. data/module/gems/highline-1.6.19/lib/highline/menu.rb +398 -0
  92. data/module/gems/highline-1.6.19/lib/highline/question.rb +475 -0
  93. data/module/gems/highline-1.6.19/lib/highline/simulate.rb +48 -0
  94. data/module/gems/highline-1.6.19/lib/highline/string_extensions.rb +131 -0
  95. data/module/gems/highline-1.6.19/lib/highline/style.rb +181 -0
  96. data/module/gems/highline-1.6.19/lib/highline/system_extensions.rb +222 -0
  97. data/module/gems/highline-1.6.19/setup.rb +1360 -0
  98. data/module/gems/highline-1.6.19/site/.cvsignore +1 -0
  99. data/module/gems/highline-1.6.19/site/highline.css +65 -0
  100. data/module/gems/highline-1.6.19/site/images/logo.png +0 -0
  101. data/module/gems/highline-1.6.19/site/index.html +58 -0
  102. data/module/gems/highline-1.6.19/test/string_methods.rb +32 -0
  103. data/module/gems/highline-1.6.19/test/tc_color_scheme.rb +96 -0
  104. data/module/gems/highline-1.6.19/test/tc_highline.rb +1128 -0
  105. data/module/gems/highline-1.6.19/test/tc_import.rb +52 -0
  106. data/module/gems/highline-1.6.19/test/tc_menu.rb +439 -0
  107. data/module/gems/highline-1.6.19/test/tc_string_extension.rb +20 -0
  108. data/module/gems/highline-1.6.19/test/tc_string_highline.rb +38 -0
  109. data/module/gems/highline-1.6.19/test/tc_style.rb +567 -0
  110. data/module/gems/highline-1.6.19/test/ts_all.rb +16 -0
  111. data/module/latest_specs.4.8 +0 -0
  112. data/module/latest_specs.4.8.gz +0 -0
  113. data/module/prerelease_specs.4.8 +0 -0
  114. data/module/prerelease_specs.4.8.gz +0 -0
  115. data/module/specs.4.8 +0 -0
  116. data/module/specs.4.8.gz +0 -0
  117. data/samples/blather/restlike/Gemfile +4 -0
  118. data/samples/blather/restlike/cmd.yml +1 -0
  119. data/samples/blather/restlike/lib/blather.rb +9 -0
  120. data/samples/blather/restlike/lib/blather/dsl/api.rb +78 -0
  121. data/samples/blather/restlike/lib/blather/dsl/call.rb +13 -0
  122. data/samples/blather/restlike/lib/blather/dsl/client.rb +58 -0
  123. data/samples/blather/restlike/lib/blather/dsl/config.rb +11 -0
  124. data/samples/blather/restlike/lib/blather/dsl/extraDSL.rb +163 -0
  125. data/samples/blather/restlike/lib/blather/meta/require.rb +8 -0
  126. data/samples/blather/restlike/lib/blather/meta/xmpp.yml +5 -0
  127. data/samples/blather/restlike/lib/blather/vendors/xmpp_default.rb +27 -0
  128. data/samples/blather/restlike/readme +2 -0
  129. data/samples/grape/init/Gemfile +2 -0
  130. data/samples/grape/init/cmd.yml +3 -0
  131. data/samples/grape/init/config.ru +2 -0
  132. data/samples/grape/init/docs/grape/documentation.txt +939 -0
  133. data/samples/grape/init/docs/grape/generate_rest_routes.rb +37 -0
  134. data/samples/grape/init/docs/grape/ls_routes.rb +31 -0
  135. data/samples/grape/init/lib/grape.rb +4 -0
  136. data/samples/grape/init/lib/grape/meta/subclasses.rb +20 -0
  137. data/samples/grape/init/lib/grape/xpath/app.rb +30 -0
  138. data/samples/grape/init/lib/grape/xpath/ruotes.rb +6 -0
  139. data/samples/grape/init/readme +1 -0
  140. data/samples/grape/readme +29 -0
  141. data/samples/grape/vendor/lib/grape/vendors/v1/rest.rb +57 -0
  142. data/samples/mongoid/cmd.yml +1 -0
  143. data/samples/mongoid/init/Gemfile +3 -0
  144. data/samples/mongoid/init/cmd.yml +2 -0
  145. data/samples/mongoid/init/docs/mongoid/ModelsRelations.rb +11 -0
  146. data/samples/mongoid/init/docs/mongoid/documents.xls +0 -0
  147. data/samples/mongoid/init/docs/mongoid/generate_modelsToDocs.rb +25 -0
  148. data/samples/mongoid/init/docs/mongoid/modelsToDocs.rb +25 -0
  149. data/samples/mongoid/init/docs/mongoid/relations.txt +1354 -0
  150. data/samples/mongoid/init/lib/mongoid.rb +44 -0
  151. data/samples/mongoid/init/lib/mongoid/dsl/extraDSL_CRUD.rb +446 -0
  152. data/samples/mongoid/init/lib/mongoid/dsl/extraDSL_MP.rb +517 -0
  153. data/samples/mongoid/init/lib/mongoid/dsl/init.rb +37 -0
  154. data/samples/mongoid/init/lib/mongoid/dsl/params.rb +67 -0
  155. data/samples/mongoid/init/lib/mongoid/meta/banned.rb +147 -0
  156. data/samples/mongoid/init/lib/mongoid/meta/control.yml +13 -0
  157. data/samples/mongoid/init/lib/mongoid/meta/mongoid.yml +6 -0
  158. data/samples/mongoid/init/lib/mongoid/meta/mpatch.rb +14 -0
  159. data/samples/mongoid/model/lib/mongoid/models/model.rb +28 -0
  160. data/samples/mongoid/readme +33 -0
  161. data/samples/rack/init/Gemfile +10 -0
  162. data/samples/rack/init/cmd.yml +2 -0
  163. data/samples/rack/init/config.ru +1 -0
  164. data/samples/rack/init/docs/rack/rake introducing.txt +60 -0
  165. data/samples/rack/init/docs/rack/webservers/Thin +43 -0
  166. data/samples/rack/init/docs/rack/webservers/ebb +72 -0
  167. data/samples/rack/init/docs/rack/webservers/fcgi +103 -0
  168. data/samples/rack/init/docs/rack/webservers/mongrel +74 -0
  169. data/samples/rack/init/docs/rack/webservers/passenger +37 -0
  170. data/samples/rack/init/docs/rack/webservers/scgi +188 -0
  171. data/samples/rack/init/lib/rack.rb +1 -0
  172. data/samples/rack/init/lib/rack/meta/webserver/thin.rb +45 -0
  173. data/samples/rack/init/lib/rack/meta/webserver/thin.yml +6 -0
  174. data/samples/rack/init/server.rb +0 -0
  175. data/samples/rack/readme +13 -0
  176. data/samples/rest_client/init/Gemfile +5 -0
  177. data/samples/rest_client/init/boot.rb +2 -0
  178. data/samples/rest_client/init/cmd.yml +1 -0
  179. data/samples/rest_client/init/config/rest_client/defaults.rb +16 -0
  180. data/samples/rest_client/init/docs/rest_client/simple overlook +251 -0
  181. data/samples/rest_client/init/test/rest_client/rest_dsl.rb +5 -0
  182. data/samples/rest_client/readme +7 -0
  183. data/samples/scripts/lines_counter/lines_number.rb +32 -0
  184. data/samples/scripts/lines_counter/readme +5 -0
  185. data/samples/scripts/readme +1 -0
  186. metadata +197 -7
  187. data/lib/clone/cms.rb +0 -56
  188. data/lib/clone/ext.rb +0 -77
  189. data/sample/test.rb +0 -30
@@ -0,0 +1 @@
1
+ require_relative_directory File.join "rack"
@@ -0,0 +1,45 @@
1
+ require "yaml"
2
+ THIN_CONFIG= YAML.load_file(File.expand_path(File.join(File.dirname(__FILE__),'thin.yml')))
3
+
4
+ module Thin
5
+ class Server
6
+ def initialize(*args, &block)
7
+ host, port, options = DEFAULT_HOST, DEFAULT_PORT, {}
8
+
9
+ # Guess each parameter by its type so they can be
10
+ # received in any order.
11
+ args.each do |arg|
12
+ case arg
13
+ when Fixnum, /^\d+$/ then port = arg.to_i
14
+ when String then host = arg
15
+ when Hash then options = arg
16
+ else
17
+ @app = arg if arg.respond_to?(:call)
18
+ end
19
+ end
20
+
21
+ # Set tag if needed
22
+ self.tag = options[:tag]
23
+
24
+ # Try to intelligently select which backend to use.
25
+ @backend = select_backend(host, port, options)
26
+
27
+ load_cgi_multipart_eof_fix
28
+
29
+ @backend.server = self
30
+
31
+ # Set defaults
32
+ @backend.maximum_connections = THIN_CONFIG['DEFAULT_MAXIMUM_CONNECTIONS'].to_i
33
+ @backend.maximum_persistent_connections = THIN_CONFIG['DEFAULT_MAXIMUM_PERSISTENT_CONNECTIONS'].to_i
34
+ @backend.timeout = THIN_CONFIG['DEFAULT_TIMEOUT'].to_i
35
+
36
+ # Allow using Rack builder as a block
37
+ @app = Rack::Builder.new(&block).to_app if block
38
+
39
+ # If in debug mode, wrap in logger adapter
40
+ @app = Rack::CommonLogger.new(@app) if Logging.debug?
41
+
42
+ setup_signals unless options[:signals].class == FalseClass
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,6 @@
1
+ DEFAULT_MAXIMUM_CONNECTIONS: 1001
2
+ DEFAULT_MAXIMUM_PERSISTENT_CONNECTIONS: 1001
3
+ DEFAULT_TIMEOUT: 30
4
+ tcp:
5
+ min: 10000
6
+ max: 10099
File without changes
@@ -0,0 +1,13 @@
1
+ rack is a basic framework
2
+ a lego alapja
3
+
4
+ Rack provides a minimal, modular and
5
+ adaptable interface for developing
6
+ web applications in Ruby. By wrapping
7
+ HTTP requests and responses in the
8
+ simplest way possible, it unifies
9
+ and distills the API for web servers,
10
+ web frameworks, and software in between
11
+ (the so-called middleware) into a single
12
+ method call.
13
+ Also see http://rack.github.com/.
@@ -0,0 +1,5 @@
1
+
2
+ #A simple HTTP and REST client for Ruby,
3
+ #inspired by the Sinatra microframework
4
+ #style of specifying actions: get, put, post, delete
5
+ gem "rest-client"
@@ -0,0 +1,2 @@
1
+ # Load rest-client parts
2
+ require_relative_directory File.join "config","rest_client"
@@ -0,0 +1 @@
1
+ helper: init
@@ -0,0 +1,16 @@
1
+ module REST
2
+ class Client
3
+
4
+ class << self
5
+ attr_accessor :target,
6
+ :port
7
+ end
8
+
9
+ def after_initialize
10
+ return unless new_record?
11
+ self.target = "0.0.0.0"
12
+ self.port = "8080"
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,251 @@
1
+ REST Client – simple DSL for accessing HTTP and REST resources
2
+ Build status:
3
+
4
+ A simple HTTP and REST client for Ruby, inspired by the Sinatra’s microframework style of specifying actions: get, put, post, delete.
5
+
6
+ Main page: github.com/rest-client/rest-client
7
+
8
+ Mailing list: rest.client@librelist.com (send a mail to subscribe).
9
+
10
+ Usage: Raw URL
11
+
12
+ require 'rest_client'
13
+
14
+ RestClient.get 'http://example.com/resource'
15
+
16
+ RestClient.get 'http://example.com/resource', {:params => {:id => 50, 'foo' => 'bar'}}
17
+
18
+ RestClient.get 'https://user:password@example.com/private/resource', {:accept => :json}
19
+
20
+ RestClient.post 'http://example.com/resource', :param1 => 'one', :nested => { :param2 => 'two' }
21
+
22
+ RestClient.post "http://example.com/resource", { 'x' => 1 }.to_json, :content_type => :json, :accept => :json
23
+
24
+ RestClient.delete 'http://example.com/resource'
25
+
26
+ response = RestClient.get 'http://example.com/resource'
27
+ response.code
28
+ ➔ 200
29
+ response.cookies
30
+ ➔ {"Foo"=>"BAR", "QUUX"=>"QUUUUX"}
31
+ response.headers
32
+ ➔ {:content_type=>"text/html; charset=utf-8", :cache_control=>"private" ...
33
+ response.to_str
34
+ ➔ \n<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n \"http://www.w3.org/TR/html4/strict.dtd\">\n\n<html ....
35
+
36
+ RestClient.post( url,
37
+ {
38
+ :transfer => {
39
+ :path => '/foo/bar',
40
+ :owner => 'that_guy',
41
+ :group => 'those_guys'
42
+ },
43
+ :upload => {
44
+ :file => File.new(path, 'rb')
45
+ }
46
+ })
47
+ Multipart
48
+
49
+ Yeah, that’s right! This does multipart sends for you!
50
+
51
+ RestClient.post '/data', :myfile => File.new("/path/to/image.jpg", 'rb')
52
+ This does two things for you:
53
+
54
+ Auto-detects that you have a File value sends it as multipart
55
+
56
+ Auto-detects the mime of the file and sets it in the HEAD of the payload for each entry
57
+
58
+ If you are sending params that do not contain a File object but the payload needs to be multipart then:
59
+
60
+ RestClient.post '/data', {:foo => 'bar', :multipart => true}
61
+ Usage: ActiveResource-Style
62
+
63
+ resource = RestClient::Resource.new 'http://example.com/resource'
64
+ resource.get
65
+
66
+ private_resource = RestClient::Resource.new 'https://example.com/private/resource', 'user', 'pass'
67
+ private_resource.put File.read('pic.jpg'), :content_type => 'image/jpg'
68
+ See RestClient::Resource module docs for details.
69
+
70
+ Usage: Resource Nesting
71
+
72
+ site = RestClient::Resource.new('http://example.com')
73
+ site['posts/1/comments'].post 'Good article.', :content_type => 'text/plain'
74
+ See RestClient::Resource docs for details.
75
+
76
+ Exceptions (see www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)
77
+
78
+ for results code between 200 and 207 a RestClient::Response will be returned
79
+
80
+ for results code 301, 302 or 307 the redirection will be followed if the request is a get or a head
81
+
82
+ for result code 303 the redirection will be followed and the request transformed into a get
83
+
84
+ for other cases a RestClient::Exception holding the Response will be raised, a specific exception class will be thrown for know error codes
85
+
86
+ RestClient.get 'http://example.com/resource'
87
+ ➔ RestClient::ResourceNotFound: RestClient::ResourceNotFound
88
+
89
+ begin
90
+ RestClient.get 'http://example.com/resource'
91
+ rescue => e
92
+ e.response
93
+ end
94
+ ➔ 404 Resource Not Found | text/html 282 bytes
95
+ Result handling
96
+
97
+ A block can be passed to the RestClient method, this block will then be called with the Response. Response.return! can be called to invoke the default response’s behavior.
98
+
99
+ # Don't raise exceptions but return the response
100
+ RestClient.get('http://example.com/resource'){|response, request, result| response }
101
+ ➔ 404 Resource Not Found | text/html 282 bytes
102
+
103
+ # Manage a specific error code
104
+ RestClient.get('http://my-rest-service.com/resource'){ |response, request, result, &block|
105
+ case response.code
106
+ when 200
107
+ p "It worked !"
108
+ response
109
+ when 423
110
+ raise SomeCustomExceptionIfYouWant
111
+ else
112
+ response.return!(request, result, &block)
113
+ end
114
+ }
115
+
116
+ # Follow redirections for all request types and not only for get and head
117
+ # RFC : "If the 301, 302 or 307 status code is received in response to a request other than GET or HEAD,
118
+ # the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user,
119
+ # since this might change the conditions under which the request was issued."
120
+ RestClient.get('http://my-rest-service.com/resource'){ |response, request, result, &block|
121
+ if [301, 302, 307].include? response.code
122
+ response.follow_redirection(request, result, &block)
123
+ else
124
+ response.return!(request, result, &block)
125
+ end
126
+ }
127
+ Non-normalized URIs.
128
+
129
+ If you want to use non-normalized URIs, you can normalize them with the addressable gem (addressable.rubyforge.org/api/).
130
+
131
+ require 'addressable/uri'
132
+ RestClient.get(Addressable::URI.parse("http://www.詹姆斯.com/").normalize.to_str)
133
+ Lower-level access
134
+
135
+ For cases not covered by the general API, you can use the RestClient::Request class which provide a lower-level API.
136
+
137
+ You can:
138
+
139
+ specify ssl parameters
140
+
141
+ override cookies
142
+
143
+ manually handle the response (so you can operate on the response stream than reading it fully in memory)
144
+
145
+ see the class’ rdoc for more information.
146
+
147
+ Shell
148
+
149
+ The restclient shell command gives an IRB session with RestClient already loaded:
150
+
151
+ $ restclient
152
+ >> RestClient.get 'http://example.com'
153
+ Specify a URL argument for get/post/put/delete on that resource:
154
+
155
+ $ restclient http://example.com
156
+ >> put '/resource', 'data'
157
+ Add a user and password for authenticated resources:
158
+
159
+ $ restclient https://example.com user pass
160
+ >> delete '/private/resource'
161
+ Create ~/.restclient for named sessions:
162
+
163
+ sinatra:
164
+ url: http://localhost:4567
165
+ rack:
166
+ url: http://localhost:9292
167
+ private_site:
168
+ url: http://example.com
169
+ username: user
170
+ password: pass
171
+ Then invoke:
172
+
173
+ $ restclient private_site
174
+ Use as a one-off, curl-style:
175
+
176
+ $ restclient get http://example.com/resource > output_body
177
+
178
+ $ restclient put http://example.com/resource < input_body
179
+ Logging
180
+
181
+ To enable logging you can
182
+
183
+ set RestClient.log with a ruby Logger
184
+
185
+ or set an environment variable to avoid modifying the code (in this case you can use a file name, “stdout” or “stderr”):
186
+
187
+ $ RESTCLIENT_LOG=stdout path/to/my/program
188
+ Either produces logs like this:
189
+
190
+ RestClient.get "http://some/resource"
191
+ # => 200 OK | text/html 250 bytes
192
+ RestClient.put "http://some/resource", "payload"
193
+ # => 401 Unauthorized | application/xml 340 bytes
194
+ Note that these logs are valid Ruby, so you can paste them into the restclient shell or a script to replay your sequence of rest calls.
195
+
196
+ Proxy
197
+
198
+ All calls to RestClient, including Resources, will use the proxy specified by RestClient.proxy:
199
+
200
+ RestClient.proxy = "http://proxy.example.com/"
201
+ RestClient.get "http://some/resource"
202
+ # => response from some/resource as proxied through proxy.example.com
203
+ Often the proxy url is set in an environment variable, so you can do this to use whatever proxy the system is configured to use:
204
+
205
+ RestClient.proxy = ENV['http_proxy']
206
+ Query parameters
207
+
208
+ Request objects know about query parameters and will automatically add them to the url for GET, HEAD and DELETE requests and escape the keys and values as needed:
209
+
210
+ RestClient.get 'http://example.com/resource', :params => {:foo => 'bar', :baz => 'qux'}
211
+ # will GET http://example.com/resource?foo=bar&baz=qux
212
+ Cookies
213
+
214
+ Request and Response objects know about HTTP cookies, and will automatically extract and set headers for them as needed:
215
+
216
+ response = RestClient.get 'http://example.com/action_which_sets_session_id'
217
+ response.cookies
218
+ # => {"_applicatioN_session_id" => "1234"}
219
+
220
+ response2 = RestClient.post(
221
+ 'http://localhost:3000/',
222
+ {:param1 => "foo"},
223
+ {:cookies => {:session_id => "1234"}}
224
+ )
225
+ # ...response body
226
+ SSL Client Certificates
227
+
228
+ RestClient::Resource.new(
229
+ 'https://example.com',
230
+ :ssl_client_cert => OpenSSL::X509::Certificate.new(File.read("cert.pem")),
231
+ :ssl_client_key => OpenSSL::PKey::RSA.new(File.read("key.pem"), "passphrase, if any"),
232
+ :ssl_ca_file => "ca_certificate.pem",
233
+ :verify_ssl => OpenSSL::SSL::VERIFY_PEER
234
+ ).get
235
+ Self-signed certificates can be generated with the openssl command-line tool.
236
+
237
+ Hook
238
+
239
+ RestClient.add_before_execution_proc add a Proc to be called before each execution, it’s handy if you need a direct access to the http request.
240
+
241
+ Example:
242
+
243
+ # Add oath support using the oauth gem
244
+ require 'oauth'
245
+ access_token = ...
246
+
247
+ RestClient.add_before_execution_proc do |req, params|
248
+ access_token.sign! req
249
+ end
250
+
251
+ RestClient.get 'http://example.com'
@@ -0,0 +1,5 @@
1
+ require 'rest_client'
2
+ params=Hash.new
3
+ params['hello']="world!"
4
+
5
+ RestClient.get "0.0.0.0:8080", :params => params
@@ -0,0 +1,7 @@
1
+ rest-client is a tool for sending and get recive
2
+ to that sended msg through REST Protocol
3
+
4
+ require 'rest_client'
5
+ RestClient.get 'http://example.com/resource',:params => {"param_hash"=>"tags"}
6
+
7
+ See more in docs
@@ -0,0 +1,32 @@
1
+ #encode: UTF-8
2
+ project_path= ARGV.shift
3
+ if ARGV == Array.new
4
+ puts "you forget mark extension names, type \"--all\" if you want all type"
5
+ Process.exit!
6
+ end
7
+
8
+ project_file_extensions= ARGV.join(',')
9
+ line_number= 0
10
+
11
+ target_files= nil
12
+ if ARGV.include? "--all"
13
+ target_files= "*"
14
+ else
15
+ target_files= "*.{#{project_file_extensions}}"
16
+ end
17
+
18
+ Dir.glob(File.join(project_path, "**",target_files)).uniq.each do |filename|
19
+
20
+ begin
21
+ unless File.directory?(filename)
22
+ count = 0
23
+ File.open(filename) {|f| count = f.read.count("\n")}
24
+ line_number += count
25
+ end
26
+ rescue Exception
27
+ end
28
+
29
+ end
30
+
31
+ puts "target project folder files with #{project_file_extensions} "+
32
+ "extensions are:\n\t#{line_number}"
@@ -0,0 +1,5 @@
1
+ This script is for count the total files number in a
2
+ directory for development purpose
3
+
4
+ use as:
5
+ ruby lines_count.rb full_path ext_name1 ext_name2 ext_nameN
@@ -0,0 +1 @@
1
+ standalone scripts collections
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha
4
+ version: 1.0.0.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Luzsi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-25 00:00:00.000000000 Z
11
+ date: 2014-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,11 +38,26 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: commander
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: " File system based sample cloner. You can build new projects with it,
42
56
  or merge,reuse parts from one or other. "
43
57
  email:
44
58
  - adamluzsi@gmail.com
45
- executables: []
59
+ executables:
60
+ - clone
46
61
  extensions: []
47
62
  extra_rdoc_files: []
48
63
  files:
@@ -50,15 +65,190 @@ files:
50
65
  - Gemfile
51
66
  - Gemfile.lock
52
67
  - LICENSE
68
+ - LICENSE.txt
53
69
  - README.md
54
70
  - Rakefile
55
71
  - VERSION
72
+ - bin/clone
56
73
  - clone.gemspec
74
+ - docs/readme
75
+ - docs/readme.txt
57
76
  - lib/clone.rb
58
- - lib/clone/cms.rb
59
- - lib/clone/ext.rb
60
- - sample/test.rb
61
- homepage:
77
+ - lib/clone/config/config.rb
78
+ - lib/clone/config/config.yml
79
+ - lib/clone/config/default_config.yml
80
+ - lib/clone/config/require.rb
81
+ - lib/clone/config/version.rb
82
+ - lib/clone/config/yml.rb
83
+ - lib/clone/config/z_defaults.rb
84
+ - lib/clone/generator/engine.rb
85
+ - lib/clone/generator/terminal.rb
86
+ - lib/clone/helpers/helper_methods.rb
87
+ - lib/clone/helpers/local_methods.rb
88
+ - lib/clone/helpers/require.rb
89
+ - module/Marshal.4.8
90
+ - module/Marshal.4.8.Z
91
+ - module/gems/commander-4.1.3/.gitignore
92
+ - module/gems/commander-4.1.3/.travis.yml
93
+ - module/gems/commander-4.1.3/DEVELOPMENT
94
+ - module/gems/commander-4.1.3/Gemfile
95
+ - module/gems/commander-4.1.3/History.rdoc
96
+ - module/gems/commander-4.1.3/Manifest
97
+ - module/gems/commander-4.1.3/README.rdoc
98
+ - module/gems/commander-4.1.3/Rakefile
99
+ - module/gems/commander-4.1.3/bin/commander
100
+ - module/gems/commander-4.1.3/commander.gemspec
101
+ - module/gems/commander-4.1.3/lib/commander.rb
102
+ - module/gems/commander-4.1.3/lib/commander/blank.rb
103
+ - module/gems/commander-4.1.3/lib/commander/command.rb
104
+ - module/gems/commander-4.1.3/lib/commander/core_ext.rb
105
+ - module/gems/commander-4.1.3/lib/commander/core_ext/array.rb
106
+ - module/gems/commander-4.1.3/lib/commander/core_ext/object.rb
107
+ - module/gems/commander-4.1.3/lib/commander/delegates.rb
108
+ - module/gems/commander-4.1.3/lib/commander/help_formatters.rb
109
+ - module/gems/commander-4.1.3/lib/commander/help_formatters/base.rb
110
+ - module/gems/commander-4.1.3/lib/commander/help_formatters/terminal.rb
111
+ - module/gems/commander-4.1.3/lib/commander/help_formatters/terminal/command_help.erb
112
+ - module/gems/commander-4.1.3/lib/commander/help_formatters/terminal/help.erb
113
+ - module/gems/commander-4.1.3/lib/commander/help_formatters/terminal_compact.rb
114
+ - module/gems/commander-4.1.3/lib/commander/help_formatters/terminal_compact/command_help.erb
115
+ - module/gems/commander-4.1.3/lib/commander/help_formatters/terminal_compact/help.erb
116
+ - module/gems/commander-4.1.3/lib/commander/import.rb
117
+ - module/gems/commander-4.1.3/lib/commander/platform.rb
118
+ - module/gems/commander-4.1.3/lib/commander/runner.rb
119
+ - module/gems/commander-4.1.3/lib/commander/user_interaction.rb
120
+ - module/gems/commander-4.1.3/lib/commander/version.rb
121
+ - module/gems/commander-4.1.3/spec/command_spec.rb
122
+ - module/gems/commander-4.1.3/spec/core_ext/array_spec.rb
123
+ - module/gems/commander-4.1.3/spec/core_ext/object_spec.rb
124
+ - module/gems/commander-4.1.3/spec/help_formatters/terminal_spec.rb
125
+ - module/gems/commander-4.1.3/spec/runner_spec.rb
126
+ - module/gems/commander-4.1.3/spec/spec_helper.rb
127
+ - module/gems/commander-4.1.3/spec/ui_spec.rb
128
+ - module/gems/hello.rb
129
+ - module/gems/highline-1.6.19/.gitignore
130
+ - module/gems/highline-1.6.19/AUTHORS
131
+ - module/gems/highline-1.6.19/CHANGELOG
132
+ - module/gems/highline-1.6.19/COPYING
133
+ - module/gems/highline-1.6.19/INSTALL
134
+ - module/gems/highline-1.6.19/LICENSE
135
+ - module/gems/highline-1.6.19/README.rdoc
136
+ - module/gems/highline-1.6.19/Rakefile
137
+ - module/gems/highline-1.6.19/TODO
138
+ - module/gems/highline-1.6.19/examples/ansi_colors.rb
139
+ - module/gems/highline-1.6.19/examples/asking_for_arrays.rb
140
+ - module/gems/highline-1.6.19/examples/basic_usage.rb
141
+ - module/gems/highline-1.6.19/examples/color_scheme.rb
142
+ - module/gems/highline-1.6.19/examples/get_character.rb
143
+ - module/gems/highline-1.6.19/examples/limit.rb
144
+ - module/gems/highline-1.6.19/examples/menus.rb
145
+ - module/gems/highline-1.6.19/examples/overwrite.rb
146
+ - module/gems/highline-1.6.19/examples/page_and_wrap.rb
147
+ - module/gems/highline-1.6.19/examples/password.rb
148
+ - module/gems/highline-1.6.19/examples/repeat_entry.rb
149
+ - module/gems/highline-1.6.19/examples/trapping_eof.rb
150
+ - module/gems/highline-1.6.19/examples/using_readline.rb
151
+ - module/gems/highline-1.6.19/highline.gemspec
152
+ - module/gems/highline-1.6.19/lib/highline.rb
153
+ - module/gems/highline-1.6.19/lib/highline/color_scheme.rb
154
+ - module/gems/highline-1.6.19/lib/highline/compatibility.rb
155
+ - module/gems/highline-1.6.19/lib/highline/import.rb
156
+ - module/gems/highline-1.6.19/lib/highline/menu.rb
157
+ - module/gems/highline-1.6.19/lib/highline/question.rb
158
+ - module/gems/highline-1.6.19/lib/highline/simulate.rb
159
+ - module/gems/highline-1.6.19/lib/highline/string_extensions.rb
160
+ - module/gems/highline-1.6.19/lib/highline/style.rb
161
+ - module/gems/highline-1.6.19/lib/highline/system_extensions.rb
162
+ - module/gems/highline-1.6.19/setup.rb
163
+ - module/gems/highline-1.6.19/site/.cvsignore
164
+ - module/gems/highline-1.6.19/site/highline.css
165
+ - module/gems/highline-1.6.19/site/images/logo.png
166
+ - module/gems/highline-1.6.19/site/index.html
167
+ - module/gems/highline-1.6.19/test/string_methods.rb
168
+ - module/gems/highline-1.6.19/test/tc_color_scheme.rb
169
+ - module/gems/highline-1.6.19/test/tc_highline.rb
170
+ - module/gems/highline-1.6.19/test/tc_import.rb
171
+ - module/gems/highline-1.6.19/test/tc_menu.rb
172
+ - module/gems/highline-1.6.19/test/tc_string_extension.rb
173
+ - module/gems/highline-1.6.19/test/tc_string_highline.rb
174
+ - module/gems/highline-1.6.19/test/tc_style.rb
175
+ - module/gems/highline-1.6.19/test/ts_all.rb
176
+ - module/latest_specs.4.8
177
+ - module/latest_specs.4.8.gz
178
+ - module/prerelease_specs.4.8
179
+ - module/prerelease_specs.4.8.gz
180
+ - module/specs.4.8
181
+ - module/specs.4.8.gz
182
+ - samples/blather/restlike/Gemfile
183
+ - samples/blather/restlike/cmd.yml
184
+ - samples/blather/restlike/lib/blather.rb
185
+ - samples/blather/restlike/lib/blather/dsl/api.rb
186
+ - samples/blather/restlike/lib/blather/dsl/call.rb
187
+ - samples/blather/restlike/lib/blather/dsl/client.rb
188
+ - samples/blather/restlike/lib/blather/dsl/config.rb
189
+ - samples/blather/restlike/lib/blather/dsl/extraDSL.rb
190
+ - samples/blather/restlike/lib/blather/meta/require.rb
191
+ - samples/blather/restlike/lib/blather/meta/xmpp.yml
192
+ - samples/blather/restlike/lib/blather/vendors/xmpp_default.rb
193
+ - samples/blather/restlike/readme
194
+ - samples/grape/init/Gemfile
195
+ - samples/grape/init/cmd.yml
196
+ - samples/grape/init/config.ru
197
+ - samples/grape/init/docs/grape/documentation.txt
198
+ - samples/grape/init/docs/grape/generate_rest_routes.rb
199
+ - samples/grape/init/docs/grape/ls_routes.rb
200
+ - samples/grape/init/lib/grape.rb
201
+ - samples/grape/init/lib/grape/meta/subclasses.rb
202
+ - samples/grape/init/lib/grape/xpath/app.rb
203
+ - samples/grape/init/lib/grape/xpath/ruotes.rb
204
+ - samples/grape/init/readme
205
+ - samples/grape/readme
206
+ - samples/grape/vendor/lib/grape/vendors/v1/rest.rb
207
+ - samples/mongoid/cmd.yml
208
+ - samples/mongoid/init/Gemfile
209
+ - samples/mongoid/init/cmd.yml
210
+ - samples/mongoid/init/docs/mongoid/ModelsRelations.rb
211
+ - samples/mongoid/init/docs/mongoid/documents.xls
212
+ - samples/mongoid/init/docs/mongoid/generate_modelsToDocs.rb
213
+ - samples/mongoid/init/docs/mongoid/modelsToDocs.rb
214
+ - samples/mongoid/init/docs/mongoid/relations.txt
215
+ - samples/mongoid/init/lib/mongoid.rb
216
+ - samples/mongoid/init/lib/mongoid/dsl/extraDSL_CRUD.rb
217
+ - samples/mongoid/init/lib/mongoid/dsl/extraDSL_MP.rb
218
+ - samples/mongoid/init/lib/mongoid/dsl/init.rb
219
+ - samples/mongoid/init/lib/mongoid/dsl/params.rb
220
+ - samples/mongoid/init/lib/mongoid/meta/banned.rb
221
+ - samples/mongoid/init/lib/mongoid/meta/control.yml
222
+ - samples/mongoid/init/lib/mongoid/meta/mongoid.yml
223
+ - samples/mongoid/init/lib/mongoid/meta/mpatch.rb
224
+ - samples/mongoid/model/lib/mongoid/models/model.rb
225
+ - samples/mongoid/readme
226
+ - samples/rack/init/Gemfile
227
+ - samples/rack/init/cmd.yml
228
+ - samples/rack/init/config.ru
229
+ - samples/rack/init/docs/rack/rake introducing.txt
230
+ - samples/rack/init/docs/rack/webservers/Thin
231
+ - samples/rack/init/docs/rack/webservers/ebb
232
+ - samples/rack/init/docs/rack/webservers/fcgi
233
+ - samples/rack/init/docs/rack/webservers/mongrel
234
+ - samples/rack/init/docs/rack/webservers/passenger
235
+ - samples/rack/init/docs/rack/webservers/scgi
236
+ - samples/rack/init/lib/rack.rb
237
+ - samples/rack/init/lib/rack/meta/webserver/thin.rb
238
+ - samples/rack/init/lib/rack/meta/webserver/thin.yml
239
+ - samples/rack/init/server.rb
240
+ - samples/rack/readme
241
+ - samples/rest_client/init/Gemfile
242
+ - samples/rest_client/init/boot.rb
243
+ - samples/rest_client/init/cmd.yml
244
+ - samples/rest_client/init/config/rest_client/defaults.rb
245
+ - samples/rest_client/init/docs/rest_client/simple overlook
246
+ - samples/rest_client/init/test/rest_client/rest_dsl.rb
247
+ - samples/rest_client/readme
248
+ - samples/scripts/lines_counter/lines_number.rb
249
+ - samples/scripts/lines_counter/readme
250
+ - samples/scripts/readme
251
+ homepage: https://github.com/adamluzsi/clone
62
252
  licenses: []
63
253
  metadata: {}
64
254
  post_install_message: