@@ -48,10 +48,10 @@ def self.execute(cmd_str, repo_id, options={}, &block)
48
48
end
49
49
50
50
###############################################
51
- # Duck-typing of an IO interface #
51
+ # Duck-typing of an IO interface #
52
52
###############################################
53
53
def respond_to? ( my_method )
54
- ! IO . instance_methods . index ( my_method . to_s ) . nil? || super ( my_method , *args , &block )
54
+ IO . instance_methods . map ( & :to_sym ) . include? ( my_method . to_sym ) || super ( my_method , *args , &block )
55
55
end
56
56
57
57
# Catch any extra args placed into stdin. We explicitly code the
@@ -104,7 +104,7 @@ def close_write
104
104
# Ruby 1.8 define_method doesn't work with blocks.
105
105
def method_missing ( my_method , *args , &block )
106
106
# Only handle IO methods!
107
- if IO . instance_methods . index ( my_method . to_s ) . nil?
107
+ unless IO . instance_methods . map ( & :to_sym ) . include? ( my_method . to_sym )
108
108
return super ( my_method , *args , &block )
109
109
end
110
110
@@ -195,8 +195,8 @@ def push_to_buffer(invalue)
195
195
end
196
196
197
197
##############################################################################
198
- # The following three functions are the generic versions of what is #
199
- # currently "compiled" into function definitions above in missing_method(). #
198
+ # The following three functions are the generic versions of what is #
199
+ # currently "compiled" into function definitions above in missing_method(). #
200
200
##############################################################################
201
201
# Class #1 functions (Read functions with block/enumerator behavior)
202
202
def enumerator_diverter ( my_method , *args , &block )
@@ -229,7 +229,7 @@ def simple_proxy(my_method,*args,&block)
229
229
end
230
230
231
231
###############################################
232
- # Basic redirector methods #
232
+ # Basic redirector methods #
233
233
###############################################
234
234
235
235
def initialize ( cmd_str , repo_id , options = { } )
@@ -299,19 +299,19 @@ def exit_shell
299
299
end
300
300
301
301
###############################################
302
- # Caching interface functions #
302
+ # Caching interface functions #
303
303
###############################################
304
304
305
305
def self . max_cache_time
306
- ( Setting . plugin_redmine_git_hosting [ 'gitCacheMaxTime' ] ) . to_i # in seconds, default = 60
306
+ ( Setting . plugin_redmine_git_hosting [ 'gitCacheMaxTime' ] ) . to_i # in seconds, default = 60
307
307
end
308
308
309
309
def self . max_cache_elements
310
310
( Setting . plugin_redmine_git_hosting [ 'gitCacheMaxElements' ] ) . to_i # default = 100
311
311
end
312
312
313
313
def self . max_cache_size
314
- ( Setting . plugin_redmine_git_hosting [ 'gitCacheMaxSize' ] ) . to_i *1024 *1024 # In MB, default = 16MB, converted to bytes
314
+ ( Setting . plugin_redmine_git_hosting [ 'gitCacheMaxSize' ] ) . to_i *1024 *1024 # In MB, default = 16MB, converted to bytes
315
315
end
316
316
317
317
def self . compose_key ( key1 , key2 )
0 commit comments