diy_rails 0.1.0

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 (155) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +8 -0
  3. data/Gemfile.lock +21 -0
  4. data/README.md +29 -0
  5. data/Rakefile +4 -0
  6. data/lib/diy_rails/version.rb +5 -0
  7. data/lib/diy_rails.rb +8 -0
  8. data/sig/diy_rails.rbs +4 -0
  9. data/vendor/bundle/ruby/3.0.0/bin/rackup +29 -0
  10. data/vendor/bundle/ruby/3.0.0/bin/rake +29 -0
  11. data/vendor/bundle/ruby/3.0.0/cache/rack-2.2.4.gem +0 -0
  12. data/vendor/bundle/ruby/3.0.0/cache/rake-13.0.6.gem +0 -0
  13. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/CHANGELOG.md +708 -0
  14. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/CONTRIBUTING.md +136 -0
  15. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/MIT-LICENSE +20 -0
  16. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/README.rdoc +306 -0
  17. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/Rakefile +130 -0
  18. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/SPEC.rdoc +288 -0
  19. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/bin/rackup +5 -0
  20. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/contrib/rack.png +0 -0
  21. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/contrib/rack.svg +150 -0
  22. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/contrib/rack_logo.svg +164 -0
  23. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/contrib/rdoc.css +412 -0
  24. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/example/lobster.ru +6 -0
  25. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/example/protectedlobster.rb +16 -0
  26. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/example/protectedlobster.ru +10 -0
  27. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/abstract/handler.rb +39 -0
  28. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/abstract/request.rb +47 -0
  29. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/basic.rb +61 -0
  30. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/digest/md5.rb +131 -0
  31. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/digest/nonce.rb +54 -0
  32. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/digest/params.rb +54 -0
  33. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/auth/digest/request.rb +43 -0
  34. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/body_proxy.rb +45 -0
  35. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/builder.rb +257 -0
  36. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/cascade.rb +68 -0
  37. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/chunked.rb +117 -0
  38. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/common_logger.rb +83 -0
  39. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/conditional_get.rb +83 -0
  40. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/config.rb +22 -0
  41. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/content_length.rb +38 -0
  42. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/content_type.rb +30 -0
  43. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/core_ext/regexp.rb +14 -0
  44. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/deflater.rb +144 -0
  45. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/directory.rb +199 -0
  46. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/etag.rb +77 -0
  47. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/events.rb +153 -0
  48. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/file.rb +7 -0
  49. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/files.rb +218 -0
  50. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler/cgi.rb +59 -0
  51. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler/fastcgi.rb +100 -0
  52. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler/lsws.rb +61 -0
  53. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler/scgi.rb +71 -0
  54. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler/thin.rb +36 -0
  55. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler/webrick.rb +129 -0
  56. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/handler.rb +104 -0
  57. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/head.rb +25 -0
  58. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/lint.rb +806 -0
  59. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/lobster.rb +70 -0
  60. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/lock.rb +32 -0
  61. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/logger.rb +20 -0
  62. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/media_type.rb +43 -0
  63. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/method_override.rb +52 -0
  64. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/mime.rb +685 -0
  65. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/mock.rb +273 -0
  66. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/multipart/generator.rb +97 -0
  67. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/multipart/parser.rb +365 -0
  68. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/multipart/uploaded_file.rb +41 -0
  69. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/multipart.rb +64 -0
  70. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/null_logger.rb +39 -0
  71. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/query_parser.rb +221 -0
  72. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/recursive.rb +64 -0
  73. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/reloader.rb +114 -0
  74. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/request.rb +659 -0
  75. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/response.rb +318 -0
  76. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/rewindable_input.rb +94 -0
  77. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/runtime.rb +34 -0
  78. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/sendfile.rb +162 -0
  79. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/server.rb +466 -0
  80. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/session/abstract/id.rb +523 -0
  81. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/session/cookie.rb +203 -0
  82. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/session/memcache.rb +10 -0
  83. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/session/pool.rb +85 -0
  84. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/show_exceptions.rb +390 -0
  85. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/show_status.rb +113 -0
  86. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/static.rb +187 -0
  87. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/tempfile_reaper.rb +22 -0
  88. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/urlmap.rb +97 -0
  89. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/utils.rb +616 -0
  90. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack/version.rb +29 -0
  91. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/lib/rack.rb +141 -0
  92. data/vendor/bundle/ruby/3.0.0/gems/rack-2.2.4/rack.gemspec +46 -0
  93. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/History.rdoc +2403 -0
  94. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/MIT-LICENSE +21 -0
  95. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/README.rdoc +155 -0
  96. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/command_line_usage.rdoc +158 -0
  97. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/example/Rakefile1 +38 -0
  98. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/example/Rakefile2 +35 -0
  99. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/example/a.c +6 -0
  100. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/example/b.c +6 -0
  101. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/example/main.c +11 -0
  102. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/glossary.rdoc +42 -0
  103. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/jamis.rb +592 -0
  104. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/proto_rake.rdoc +127 -0
  105. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/rake.1 +156 -0
  106. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/rakefile.rdoc +622 -0
  107. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc/rational.rdoc +151 -0
  108. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake +27 -0
  109. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb +831 -0
  110. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/backtrace.rb +24 -0
  111. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/clean.rb +78 -0
  112. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/cloneable.rb +17 -0
  113. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/cpu_counter.rb +107 -0
  114. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/default_loader.rb +15 -0
  115. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/dsl_definition.rb +195 -0
  116. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/early_time.rb +22 -0
  117. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/ext/core.rb +26 -0
  118. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/ext/string.rb +176 -0
  119. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/file_creation_task.rb +25 -0
  120. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/file_list.rb +435 -0
  121. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/file_task.rb +54 -0
  122. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/file_utils.rb +134 -0
  123. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/file_utils_ext.rb +134 -0
  124. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/invocation_chain.rb +57 -0
  125. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/invocation_exception_mixin.rb +17 -0
  126. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/late_time.rb +18 -0
  127. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/linked_list.rb +112 -0
  128. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/loaders/makefile.rb +54 -0
  129. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/multi_task.rb +14 -0
  130. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/name_space.rb +38 -0
  131. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/packagetask.rb +222 -0
  132. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/phony.rb +16 -0
  133. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/private_reader.rb +21 -0
  134. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/promise.rb +100 -0
  135. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/pseudo_status.rb +30 -0
  136. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_module.rb +67 -0
  137. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb +27 -0
  138. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rule_recursion_overflow_error.rb +20 -0
  139. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/scope.rb +43 -0
  140. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb +434 -0
  141. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task_argument_error.rb +8 -0
  142. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task_arguments.rb +109 -0
  143. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task_manager.rb +331 -0
  144. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/tasklib.rb +12 -0
  145. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/testtask.rb +189 -0
  146. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/thread_history_display.rb +49 -0
  147. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/thread_pool.rb +163 -0
  148. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/trace_output.rb +23 -0
  149. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/version.rb +10 -0
  150. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/win32.rb +51 -0
  151. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake.rb +71 -0
  152. data/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/rake.gemspec +100 -0
  153. data/vendor/bundle/ruby/3.0.0/specifications/rack-2.2.4.gemspec +41 -0
  154. data/vendor/bundle/ruby/3.0.0/specifications/rake-13.0.6.gemspec +26 -0
  155. metadata +210 -0
@@ -0,0 +1,163 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rake/promise"
4
+
5
+ module Rake
6
+
7
+ class ThreadPool # :nodoc: all
8
+
9
+ # Creates a ThreadPool object. The +thread_count+ parameter is the size
10
+ # of the pool.
11
+ def initialize(thread_count)
12
+ require "set"
13
+ @max_active_threads = [thread_count, 0].max
14
+ @threads = Set.new
15
+ @threads_mon = Monitor.new
16
+ @queue = Queue.new
17
+ @join_cond = @threads_mon.new_cond
18
+
19
+ @history_start_time = nil
20
+ @history = []
21
+ @history_mon = Monitor.new
22
+ @total_threads_in_play = 0
23
+ end
24
+
25
+ # Creates a future executed by the +ThreadPool+.
26
+ #
27
+ # The args are passed to the block when executing (similarly to
28
+ # Thread#new) The return value is an object representing
29
+ # a future which has been created and added to the queue in the
30
+ # pool. Sending #value to the object will sleep the
31
+ # current thread until the future is finished and will return the
32
+ # result (or raise an exception thrown from the future)
33
+ def future(*args, &block)
34
+ promise = Promise.new(args, &block)
35
+ promise.recorder = lambda { |*stats| stat(*stats) }
36
+
37
+ @queue.enq promise
38
+ stat :queued, item_id: promise.object_id
39
+ start_thread
40
+ promise
41
+ end
42
+
43
+ # Waits until the queue of futures is empty and all threads have exited.
44
+ def join
45
+ @threads_mon.synchronize do
46
+ begin
47
+ stat :joining
48
+ @join_cond.wait unless @threads.empty?
49
+ stat :joined
50
+ rescue Exception => e
51
+ stat :joined
52
+ $stderr.puts e
53
+ $stderr.print "Queue contains #{@queue.size} items. " +
54
+ "Thread pool contains #{@threads.count} threads\n"
55
+ $stderr.print "Current Thread #{Thread.current} status = " +
56
+ "#{Thread.current.status}\n"
57
+ $stderr.puts e.backtrace.join("\n")
58
+ @threads.each do |t|
59
+ $stderr.print "Thread #{t} status = #{t.status}\n"
60
+ $stderr.puts t.backtrace.join("\n")
61
+ end
62
+ raise e
63
+ end
64
+ end
65
+ end
66
+
67
+ # Enable the gathering of history events.
68
+ def gather_history #:nodoc:
69
+ @history_start_time = Time.now if @history_start_time.nil?
70
+ end
71
+
72
+ # Return a array of history events for the thread pool.
73
+ #
74
+ # History gathering must be enabled to be able to see the events
75
+ # (see #gather_history). Best to call this when the job is
76
+ # complete (i.e. after ThreadPool#join is called).
77
+ def history # :nodoc:
78
+ @history_mon.synchronize { @history.dup }.
79
+ sort_by { |i| i[:time] }.
80
+ each { |i| i[:time] -= @history_start_time }
81
+ end
82
+
83
+ # Return a hash of always collected statistics for the thread pool.
84
+ def statistics # :nodoc:
85
+ {
86
+ total_threads_in_play: @total_threads_in_play,
87
+ max_active_threads: @max_active_threads,
88
+ }
89
+ end
90
+
91
+ private
92
+
93
+ # processes one item on the queue. Returns true if there was an
94
+ # item to process, false if there was no item
95
+ def process_queue_item #:nodoc:
96
+ return false if @queue.empty?
97
+
98
+ # Even though we just asked if the queue was empty, it
99
+ # still could have had an item which by this statement
100
+ # is now gone. For this reason we pass true to Queue#deq
101
+ # because we will sleep indefinitely if it is empty.
102
+ promise = @queue.deq(true)
103
+ stat :dequeued, item_id: promise.object_id
104
+ promise.work
105
+ return true
106
+
107
+ rescue ThreadError # this means the queue is empty
108
+ false
109
+ end
110
+
111
+ def safe_thread_count
112
+ @threads_mon.synchronize do
113
+ @threads.count
114
+ end
115
+ end
116
+
117
+ def start_thread # :nodoc:
118
+ @threads_mon.synchronize do
119
+ next unless @threads.count < @max_active_threads
120
+
121
+ t = Thread.new do
122
+ begin
123
+ while safe_thread_count <= @max_active_threads
124
+ break unless process_queue_item
125
+ end
126
+ ensure
127
+ @threads_mon.synchronize do
128
+ @threads.delete Thread.current
129
+ stat :ended, thread_count: @threads.count
130
+ @join_cond.broadcast if @threads.empty?
131
+ end
132
+ end
133
+ end
134
+
135
+ @threads << t
136
+ stat(
137
+ :spawned,
138
+ new_thread: t.object_id,
139
+ thread_count: @threads.count)
140
+ @total_threads_in_play = @threads.count if
141
+ @threads.count > @total_threads_in_play
142
+ end
143
+ end
144
+
145
+ def stat(event, data=nil) # :nodoc:
146
+ return if @history_start_time.nil?
147
+ info = {
148
+ event: event,
149
+ data: data,
150
+ time: Time.now,
151
+ thread: Thread.current.object_id,
152
+ }
153
+ @history_mon.synchronize { @history << info }
154
+ end
155
+
156
+ # for testing only
157
+
158
+ def __queue__ # :nodoc:
159
+ @queue
160
+ end
161
+ end
162
+
163
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+ module Rake
3
+ module TraceOutput # :nodoc: all
4
+
5
+ # Write trace output to output stream +out+.
6
+ #
7
+ # The write is done as a single IO call (to print) to lessen the
8
+ # chance that the trace output is interrupted by other tasks also
9
+ # producing output.
10
+ def trace_on(out, *strings)
11
+ sep = $\ || "\n"
12
+ if strings.empty?
13
+ output = sep
14
+ else
15
+ output = strings.map { |s|
16
+ next if s.nil?
17
+ s.end_with?(sep) ? s : s + sep
18
+ }.join
19
+ end
20
+ out.print(output)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+ module Rake
3
+ VERSION = "13.0.6"
4
+
5
+ module Version # :nodoc: all
6
+ MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "."
7
+
8
+ NUMBERS = [MAJOR, MINOR, BUILD, *OTHER]
9
+ end
10
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+ require "rbconfig"
3
+
4
+ module Rake
5
+ # Win 32 interface methods for Rake. Windows specific functionality
6
+ # will be placed here to collect that knowledge in one spot.
7
+ module Win32 # :nodoc: all
8
+
9
+ # Error indicating a problem in locating the home directory on a
10
+ # Win32 system.
11
+ class Win32HomeError < RuntimeError
12
+ end
13
+
14
+ class << self
15
+ # True if running on a windows system.
16
+ def windows?
17
+ RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw|[Ww]indows)!
18
+ end
19
+
20
+ # The standard directory containing system wide rake files on
21
+ # Win 32 systems. Try the following environment variables (in
22
+ # order):
23
+ #
24
+ # * HOME
25
+ # * HOMEDRIVE + HOMEPATH
26
+ # * APPDATA
27
+ # * USERPROFILE
28
+ #
29
+ # If the above are not defined, the return nil.
30
+ def win32_system_dir #:nodoc:
31
+ win32_shared_path = ENV["HOME"]
32
+ if win32_shared_path.nil? && ENV["HOMEDRIVE"] && ENV["HOMEPATH"]
33
+ win32_shared_path = ENV["HOMEDRIVE"] + ENV["HOMEPATH"]
34
+ end
35
+
36
+ win32_shared_path ||= ENV["APPDATA"]
37
+ win32_shared_path ||= ENV["USERPROFILE"]
38
+ raise Win32HomeError,
39
+ "Unable to determine home path environment variable." if
40
+ win32_shared_path.nil? or win32_shared_path.empty?
41
+ normalize(File.join(win32_shared_path, "Rake"))
42
+ end
43
+
44
+ # Normalize a win32 path so that the slashes are all forward slashes.
45
+ def normalize(path)
46
+ path.gsub(/\\/, "/")
47
+ end
48
+
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+ #--
3
+ # Copyright 2003-2010 by Jim Weirich (jim.weirich@gmail.com)
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to
7
+ # deal in the Software without restriction, including without limitation the
8
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9
+ # sell copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in
13
+ # all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21
+ # IN THE SOFTWARE.
22
+ #++
23
+
24
+ module Rake; end
25
+
26
+ require "rake/version"
27
+
28
+ require "rbconfig"
29
+ require "fileutils"
30
+ require "singleton"
31
+ require "monitor"
32
+ require "optparse"
33
+ require "ostruct"
34
+
35
+ require "rake/ext/string"
36
+
37
+ require "rake/win32"
38
+
39
+ require "rake/linked_list"
40
+ require "rake/cpu_counter"
41
+ require "rake/scope"
42
+ require "rake/task_argument_error"
43
+ require "rake/rule_recursion_overflow_error"
44
+ require "rake/rake_module"
45
+ require "rake/trace_output"
46
+ require "rake/pseudo_status"
47
+ require "rake/task_arguments"
48
+ require "rake/invocation_chain"
49
+ require "rake/task"
50
+ require "rake/file_task"
51
+ require "rake/file_creation_task"
52
+ require "rake/multi_task"
53
+ require "rake/dsl_definition"
54
+ require "rake/file_utils_ext"
55
+ require "rake/file_list"
56
+ require "rake/default_loader"
57
+ require "rake/early_time"
58
+ require "rake/late_time"
59
+ require "rake/name_space"
60
+ require "rake/task_manager"
61
+ require "rake/application"
62
+ require "rake/backtrace"
63
+
64
+ $trace = false
65
+
66
+ # :stopdoc:
67
+ #
68
+ # Some top level Constants.
69
+
70
+ FileList = Rake::FileList
71
+ RakeFileUtils = Rake::FileUtilsExt
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+ require_relative 'lib/rake/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "rake".freeze
6
+ s.version = Rake::VERSION
7
+ s.authors = ["Hiroshi SHIBATA".freeze, "Eric Hodel".freeze, "Jim Weirich".freeze]
8
+ s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze]
9
+
10
+ s.summary = "Rake is a Make-like program implemented in Ruby".freeze
11
+ s.description = <<-DESCRIPTION
12
+ Rake is a Make-like program implemented in Ruby. Tasks and dependencies are
13
+ specified in standard Ruby syntax.
14
+ Rake has the following features:
15
+ * Rakefiles (rake's version of Makefiles) are completely defined in standard Ruby syntax.
16
+ No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?)
17
+ * Users can specify tasks with prerequisites.
18
+ * Rake supports rule patterns to synthesize implicit tasks.
19
+ * Flexible FileLists that act like arrays but know about manipulating file names and paths.
20
+ * Supports parallel execution of tasks.
21
+ DESCRIPTION
22
+ s.homepage = "https://github.com/ruby/rake".freeze
23
+ s.licenses = ["MIT".freeze]
24
+
25
+ s.metadata = {
26
+ "bug_tracker_uri" => "https://github.com/ruby/rake/issues",
27
+ "changelog_uri" => "https://github.com/ruby/rake/blob/v#{s.version}/History.rdoc",
28
+ "documentation_uri" => "https://ruby.github.io/rake",
29
+ "source_code_uri" => "https://github.com/ruby/rake/tree/v#{s.version}",
30
+ }
31
+
32
+ s.files = [
33
+ "History.rdoc",
34
+ "MIT-LICENSE",
35
+ "README.rdoc",
36
+ "doc/command_line_usage.rdoc",
37
+ "doc/example/Rakefile1",
38
+ "doc/example/Rakefile2",
39
+ "doc/example/a.c",
40
+ "doc/example/b.c",
41
+ "doc/example/main.c",
42
+ "doc/glossary.rdoc",
43
+ "doc/jamis.rb",
44
+ "doc/proto_rake.rdoc",
45
+ "doc/rake.1",
46
+ "doc/rakefile.rdoc",
47
+ "doc/rational.rdoc",
48
+ "exe/rake",
49
+ "lib/rake.rb",
50
+ "lib/rake/application.rb",
51
+ "lib/rake/backtrace.rb",
52
+ "lib/rake/clean.rb",
53
+ "lib/rake/cloneable.rb",
54
+ "lib/rake/cpu_counter.rb",
55
+ "lib/rake/default_loader.rb",
56
+ "lib/rake/dsl_definition.rb",
57
+ "lib/rake/early_time.rb",
58
+ "lib/rake/ext/core.rb",
59
+ "lib/rake/ext/string.rb",
60
+ "lib/rake/file_creation_task.rb",
61
+ "lib/rake/file_list.rb",
62
+ "lib/rake/file_task.rb",
63
+ "lib/rake/file_utils.rb",
64
+ "lib/rake/file_utils_ext.rb",
65
+ "lib/rake/invocation_chain.rb",
66
+ "lib/rake/invocation_exception_mixin.rb",
67
+ "lib/rake/late_time.rb",
68
+ "lib/rake/linked_list.rb",
69
+ "lib/rake/loaders/makefile.rb",
70
+ "lib/rake/multi_task.rb",
71
+ "lib/rake/name_space.rb",
72
+ "lib/rake/packagetask.rb",
73
+ "lib/rake/phony.rb",
74
+ "lib/rake/private_reader.rb",
75
+ "lib/rake/promise.rb",
76
+ "lib/rake/pseudo_status.rb",
77
+ "lib/rake/rake_module.rb",
78
+ "lib/rake/rake_test_loader.rb",
79
+ "lib/rake/rule_recursion_overflow_error.rb",
80
+ "lib/rake/scope.rb",
81
+ "lib/rake/task.rb",
82
+ "lib/rake/task_argument_error.rb",
83
+ "lib/rake/task_arguments.rb",
84
+ "lib/rake/task_manager.rb",
85
+ "lib/rake/tasklib.rb",
86
+ "lib/rake/testtask.rb",
87
+ "lib/rake/thread_history_display.rb",
88
+ "lib/rake/thread_pool.rb",
89
+ "lib/rake/trace_output.rb",
90
+ "lib/rake/version.rb",
91
+ "lib/rake/win32.rb",
92
+ "rake.gemspec"
93
+ ]
94
+ s.bindir = "exe"
95
+ s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
96
+ s.require_paths = ["lib".freeze]
97
+
98
+ s.required_ruby_version = Gem::Requirement.new(">= 2.2".freeze)
99
+ s.rdoc_options = ["--main".freeze, "README.rdoc".freeze]
100
+ end
@@ -0,0 +1,41 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # stub: rack 2.2.4 ruby lib
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "rack".freeze
6
+ s.version = "2.2.4"
7
+
8
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
+ s.metadata = { "bug_tracker_uri" => "https://github.com/rack/rack/issues", "changelog_uri" => "https://github.com/rack/rack/blob/master/CHANGELOG.md", "documentation_uri" => "https://rubydoc.info/github/rack/rack", "source_code_uri" => "https://github.com/rack/rack" } if s.respond_to? :metadata=
10
+ s.require_paths = ["lib".freeze]
11
+ s.authors = ["Leah Neukirchen".freeze]
12
+ s.date = "2022-06-30"
13
+ s.description = "Rack provides a minimal, modular and adaptable interface for developing\nweb applications in Ruby. By wrapping HTTP requests and responses in\nthe simplest way possible, it unifies and distills the API for web\nservers, web frameworks, and software in between (the so-called\nmiddleware) into a single method call.\n".freeze
14
+ s.email = "leah@vuxu.org".freeze
15
+ s.executables = ["rackup".freeze]
16
+ s.extra_rdoc_files = ["README.rdoc".freeze, "CHANGELOG.md".freeze, "CONTRIBUTING.md".freeze]
17
+ s.files = ["CHANGELOG.md".freeze, "CONTRIBUTING.md".freeze, "README.rdoc".freeze, "bin/rackup".freeze]
18
+ s.homepage = "https://github.com/rack/rack".freeze
19
+ s.licenses = ["MIT".freeze]
20
+ s.required_ruby_version = Gem::Requirement.new(">= 2.3.0".freeze)
21
+ s.rubygems_version = "3.3.21".freeze
22
+ s.summary = "A modular Ruby webserver interface.".freeze
23
+
24
+ s.installed_by_version = "3.3.21" if s.respond_to? :installed_by_version
25
+
26
+ if s.respond_to? :specification_version then
27
+ s.specification_version = 4
28
+ end
29
+
30
+ if s.respond_to? :add_runtime_dependency then
31
+ s.add_development_dependency(%q<minitest>.freeze, ["~> 5.0"])
32
+ s.add_development_dependency(%q<minitest-sprint>.freeze, [">= 0"])
33
+ s.add_development_dependency(%q<minitest-global_expectations>.freeze, [">= 0"])
34
+ s.add_development_dependency(%q<rake>.freeze, [">= 0"])
35
+ else
36
+ s.add_dependency(%q<minitest>.freeze, ["~> 5.0"])
37
+ s.add_dependency(%q<minitest-sprint>.freeze, [">= 0"])
38
+ s.add_dependency(%q<minitest-global_expectations>.freeze, [">= 0"])
39
+ s.add_dependency(%q<rake>.freeze, [">= 0"])
40
+ end
41
+ end
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # stub: rake 13.0.6 ruby lib
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "rake".freeze
6
+ s.version = "13.0.6"
7
+
8
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
+ s.metadata = { "bug_tracker_uri" => "https://github.com/ruby/rake/issues", "changelog_uri" => "https://github.com/ruby/rake/blob/v13.0.6/History.rdoc", "documentation_uri" => "https://ruby.github.io/rake", "source_code_uri" => "https://github.com/ruby/rake/tree/v13.0.6" } if s.respond_to? :metadata=
10
+ s.require_paths = ["lib".freeze]
11
+ s.authors = ["Hiroshi SHIBATA".freeze, "Eric Hodel".freeze, "Jim Weirich".freeze]
12
+ s.bindir = "exe".freeze
13
+ s.date = "2021-07-09"
14
+ s.description = "Rake is a Make-like program implemented in Ruby. Tasks and dependencies are\nspecified in standard Ruby syntax.\nRake has the following features:\n * Rakefiles (rake's version of Makefiles) are completely defined in standard Ruby syntax.\n No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?)\n * Users can specify tasks with prerequisites.\n * Rake supports rule patterns to synthesize implicit tasks.\n * Flexible FileLists that act like arrays but know about manipulating file names and paths.\n * Supports parallel execution of tasks.\n".freeze
15
+ s.email = ["hsbt@ruby-lang.org".freeze, "drbrain@segment7.net".freeze, "".freeze]
16
+ s.executables = ["rake".freeze]
17
+ s.files = ["exe/rake".freeze]
18
+ s.homepage = "https://github.com/ruby/rake".freeze
19
+ s.licenses = ["MIT".freeze]
20
+ s.rdoc_options = ["--main".freeze, "README.rdoc".freeze]
21
+ s.required_ruby_version = Gem::Requirement.new(">= 2.2".freeze)
22
+ s.rubygems_version = "3.3.21".freeze
23
+ s.summary = "Rake is a Make-like program implemented in Ruby".freeze
24
+
25
+ s.installed_by_version = "3.3.21" if s.respond_to? :installed_by_version
26
+ end