quality_extensions 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme +54 -0
- data/lib/qualitysmith_extensions/all.rb +4 -0
- data/lib/qualitysmith_extensions/array/all.rb +2 -0
- data/lib/qualitysmith_extensions/array/average.rb +44 -0
- data/lib/qualitysmith_extensions/array/classify.rb +97 -0
- data/lib/qualitysmith_extensions/array/expand_ranges.rb +52 -0
- data/lib/qualitysmith_extensions/array/group_by.rb +134 -0
- data/lib/qualitysmith_extensions/array/sequence.rb +66 -0
- data/lib/qualitysmith_extensions/array/shell_escape.rb +36 -0
- data/lib/qualitysmith_extensions/array/to_a_recursive.rb +41 -0
- data/lib/qualitysmith_extensions/array/to_query_string.rb +96 -0
- data/lib/qualitysmith_extensions/collection_extensions_for_cgi.rb +2 -0
- data/lib/qualitysmith_extensions/colored/toggleability.rb +62 -0
- data/lib/qualitysmith_extensions/console/command.facets.1.8.51.rb +749 -0
- data/lib/qualitysmith_extensions/console/command.facets.1.8.54.rb +748 -0
- data/lib/qualitysmith_extensions/console/command.rb +944 -0
- data/lib/qualitysmith_extensions/date/all.rb +2 -0
- data/lib/qualitysmith_extensions/date/deprecated.rb +40 -0
- data/lib/qualitysmith_extensions/date/iso8601.rb +31 -0
- data/lib/qualitysmith_extensions/date/month_ranges.rb +122 -0
- data/lib/qualitysmith_extensions/dir/each_child.rb +58 -0
- data/lib/qualitysmith_extensions/enumerable/enum.rb +69 -0
- data/lib/qualitysmith_extensions/enumerable/select_until.rb +4 -0
- data/lib/qualitysmith_extensions/enumerable/select_while.rb +109 -0
- data/lib/qualitysmith_extensions/exception/inspect_with_backtrace.rb +65 -0
- data/lib/qualitysmith_extensions/file/exact_match_regexp.rb +34 -0
- data/lib/qualitysmith_extensions/file_test/binary_file.rb +110 -0
- data/lib/qualitysmith_extensions/find/select.rb +68 -0
- data/lib/qualitysmith_extensions/global_variable_set.rb +153 -0
- data/lib/qualitysmith_extensions/hash/all.rb +2 -0
- data/lib/qualitysmith_extensions/hash/to_date.rb +34 -0
- data/lib/qualitysmith_extensions/hash/to_query_string.rb +121 -0
- data/lib/qualitysmith_extensions/kernel/all.rb +2 -0
- data/lib/qualitysmith_extensions/kernel/autoreload.rb +128 -0
- data/lib/qualitysmith_extensions/kernel/backtrace.rb +71 -0
- data/lib/qualitysmith_extensions/kernel/capture_output.rb +115 -0
- data/lib/qualitysmith_extensions/kernel/die.rb +49 -0
- data/lib/qualitysmith_extensions/kernel/example_printer.rb +81 -0
- data/lib/qualitysmith_extensions/kernel/filter_output.rb +108 -0
- data/lib/qualitysmith_extensions/kernel/remove_const.rb +178 -0
- data/lib/qualitysmith_extensions/kernel/remove_module.rb +127 -0
- data/lib/qualitysmith_extensions/kernel/require_all.rb +186 -0
- data/lib/qualitysmith_extensions/kernel/require_local_all.rb +4 -0
- data/lib/qualitysmith_extensions/kernel/require_once.rb +18 -0
- data/lib/qualitysmith_extensions/kernel/simulate_input.rb +52 -0
- data/lib/qualitysmith_extensions/kernel/trap_chain.rb +61 -0
- data/lib/qualitysmith_extensions/kernel/windows_platform.rb +46 -0
- data/lib/qualitysmith_extensions/module/alias_method.rb +6 -0
- data/lib/qualitysmith_extensions/module/alias_method_chain.rb +165 -0
- data/lib/qualitysmith_extensions/module/ancestry_of_instance_method.rb +43 -0
- data/lib/qualitysmith_extensions/module/attribute_accessors.rb +49 -0
- data/lib/qualitysmith_extensions/module/basename.rb +76 -0
- data/lib/qualitysmith_extensions/module/bool_attr_accessor.rb +497 -0
- data/lib/qualitysmith_extensions/module/class_methods.rb +87 -0
- data/lib/qualitysmith_extensions/module/create.rb +315 -0
- data/lib/qualitysmith_extensions/module/create_setter.rb +9 -0
- data/lib/qualitysmith_extensions/module/dirname.rb +4 -0
- data/lib/qualitysmith_extensions/module/guard_method.rb +312 -0
- data/lib/qualitysmith_extensions/module/includable_once.rb +10 -0
- data/lib/qualitysmith_extensions/module/join.rb +66 -0
- data/lib/qualitysmith_extensions/module/malias_method_chain.rb +92 -0
- data/lib/qualitysmith_extensions/module/module_methods.rb +4 -0
- data/lib/qualitysmith_extensions/module/namespace.rb +112 -0
- data/lib/qualitysmith_extensions/module/parents.rb +61 -0
- data/lib/qualitysmith_extensions/module/remove_const.rb +117 -0
- data/lib/qualitysmith_extensions/module/split.rb +55 -0
- data/lib/qualitysmith_extensions/month.rb +66 -0
- data/lib/qualitysmith_extensions/mutex/if_available.rb +75 -0
- data/lib/qualitysmith_extensions/object/ancestry_of_method.rb +257 -0
- data/lib/qualitysmith_extensions/object/default.rb +69 -0
- data/lib/qualitysmith_extensions/object/if_else.rb +157 -0
- data/lib/qualitysmith_extensions/object/ignore_access.rb +84 -0
- data/lib/qualitysmith_extensions/object/mcall.rb +92 -0
- data/lib/qualitysmith_extensions/object/methods.rb +63 -0
- data/lib/qualitysmith_extensions/object/send_if.rb +151 -0
- data/lib/qualitysmith_extensions/object/send_if_not_nil.rb +35 -0
- data/lib/qualitysmith_extensions/object/singleton_send.rb +129 -0
- data/lib/qualitysmith_extensions/regexp/join.rb +111 -0
- data/lib/qualitysmith_extensions/string/all.rb +2 -0
- data/lib/qualitysmith_extensions/string/constantize.rb +4 -0
- data/lib/qualitysmith_extensions/string/digits_only.rb +27 -0
- data/lib/qualitysmith_extensions/string/each_char_with_index.rb +41 -0
- data/lib/qualitysmith_extensions/string/md5.rb +29 -0
- data/lib/qualitysmith_extensions/string/shell_escape.rb +43 -0
- data/lib/qualitysmith_extensions/string/to_underscored_label.rb +37 -0
- data/lib/qualitysmith_extensions/string/with_knowledge_of_color.rb +64 -0
- data/lib/qualitysmith_extensions/symbol/constantize.rb +69 -0
- data/lib/qualitysmith_extensions/symbol/match.rb +157 -0
- data/lib/qualitysmith_extensions/template.rb +33 -0
- data/lib/qualitysmith_extensions/test/all.rb +2 -0
- data/lib/qualitysmith_extensions/test/assert_anything.rb +93 -0
- data/lib/qualitysmith_extensions/test/assert_changed.rb +66 -0
- data/lib/qualitysmith_extensions/test/assert_exception.rb +66 -0
- data/lib/qualitysmith_extensions/test/assert_includes.rb +36 -0
- data/lib/qualitysmith_extensions/test/assert_user_error.rb +37 -0
- data/lib/qualitysmith_extensions/test/difference_highlighting.rb +323 -0
- data/lib/qualitysmith_extensions/time/all.rb +2 -0
- data/lib/qualitysmith_extensions/time/deprecated.rb +31 -0
- data/test/all.rb +16 -0
- metadata +148 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
#--
|
2
|
+
# Author:: Tyler Rick
|
3
|
+
# Copyright:: Copyright (c) 2007 QualitySmith, Inc.
|
4
|
+
# License:: Ruby License
|
5
|
+
# Submit to Facets?:: No!
|
6
|
+
#++
|
7
|
+
|
8
|
+
class Time
|
9
|
+
# This should be moved elsewhere because it is subjective and depends on the context where it's used.
|
10
|
+
def datetime_for_report(line_break = false)
|
11
|
+
optional_line_break = (line_break ? "<br/>\n" : "")
|
12
|
+
strftime("%I:%M %p #{optional_line_break} %B %d, %Y") # Example: "June 18, 2006"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# _____ _
|
17
|
+
# |_ _|__ ___| |_
|
18
|
+
# | |/ _ \/ __| __|
|
19
|
+
# | | __/\__ \ |_
|
20
|
+
# |_|\___||___/\__|
|
21
|
+
#
|
22
|
+
=begin test
|
23
|
+
class TheTest < Test::Unit::TestCase
|
24
|
+
|
25
|
+
def test_date_for_report
|
26
|
+
assert_equal "01:49 PM June 18, 2006", Time.mktime(2006, 6, 18, 13, 49, 4).datetime_for_report()
|
27
|
+
assert_equal "01:49 PM <br/>\n June 18, 2006", Time.mktime(2006, 6, 18, 13, 49, 4).datetime_for_report(line_break = true)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
=end
|
data/test/all.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#require File.dirname(__FILE__) + "/../lib/kernel/require_all.rb"
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "rake" # FileList
|
5
|
+
require 'exacto' # Test extractor
|
6
|
+
|
7
|
+
FileList[File.dirname(__FILE__) + "/../lib/" + "**/**/*.rb"].exclude(/all/).each do |filename|
|
8
|
+
puts "Running #{filename}"
|
9
|
+
begin
|
10
|
+
Exacto::RubyCommand.new([filename]).run
|
11
|
+
rescue SystemExit => exception # "Code block not found" -- we don't care -- keep going already!
|
12
|
+
end
|
13
|
+
#sh "exrb #{filename}"
|
14
|
+
end
|
15
|
+
|
16
|
+
|
metadata
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.2
|
3
|
+
specification_version: 1
|
4
|
+
name: quality_extensions
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.1.1
|
7
|
+
date: 2007-07-18 00:00:00 -07:00
|
8
|
+
summary: A collection of reusable Ruby methods.
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: rubyforge.org@tylerrick.com
|
12
|
+
homepage: http://quality-ext.rubyforge.org/
|
13
|
+
rubyforge_project: quality_extensions
|
14
|
+
description: A collection of reusable Ruby methods.
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Tyler Rick and others
|
31
|
+
files:
|
32
|
+
- lib/qualitysmith_extensions/global_variable_set.rb
|
33
|
+
- lib/qualitysmith_extensions/collection_extensions_for_cgi.rb
|
34
|
+
- lib/qualitysmith_extensions/template.rb
|
35
|
+
- lib/qualitysmith_extensions/all.rb
|
36
|
+
- lib/qualitysmith_extensions/month.rb
|
37
|
+
- lib/qualitysmith_extensions/test/assert_anything.rb
|
38
|
+
- lib/qualitysmith_extensions/test/assert_exception.rb
|
39
|
+
- lib/qualitysmith_extensions/test/assert_user_error.rb
|
40
|
+
- lib/qualitysmith_extensions/test/assert_changed.rb
|
41
|
+
- lib/qualitysmith_extensions/test/difference_highlighting.rb
|
42
|
+
- lib/qualitysmith_extensions/test/all.rb
|
43
|
+
- lib/qualitysmith_extensions/test/assert_includes.rb
|
44
|
+
- lib/qualitysmith_extensions/exception/inspect_with_backtrace.rb
|
45
|
+
- lib/qualitysmith_extensions/colored/toggleability.rb
|
46
|
+
- lib/qualitysmith_extensions/file_test/binary_file.rb
|
47
|
+
- lib/qualitysmith_extensions/kernel/autoreload.rb
|
48
|
+
- lib/qualitysmith_extensions/kernel/require_all.rb
|
49
|
+
- lib/qualitysmith_extensions/kernel/simulate_input.rb
|
50
|
+
- lib/qualitysmith_extensions/kernel/die.rb
|
51
|
+
- lib/qualitysmith_extensions/kernel/require_once.rb
|
52
|
+
- lib/qualitysmith_extensions/kernel/require_local_all.rb
|
53
|
+
- lib/qualitysmith_extensions/kernel/example_printer.rb
|
54
|
+
- lib/qualitysmith_extensions/kernel/all.rb
|
55
|
+
- lib/qualitysmith_extensions/kernel/filter_output.rb
|
56
|
+
- lib/qualitysmith_extensions/kernel/backtrace.rb
|
57
|
+
- lib/qualitysmith_extensions/kernel/capture_output.rb
|
58
|
+
- lib/qualitysmith_extensions/kernel/remove_module.rb
|
59
|
+
- lib/qualitysmith_extensions/kernel/windows_platform.rb
|
60
|
+
- lib/qualitysmith_extensions/kernel/remove_const.rb
|
61
|
+
- lib/qualitysmith_extensions/kernel/trap_chain.rb
|
62
|
+
- lib/qualitysmith_extensions/dir/each_child.rb
|
63
|
+
- lib/qualitysmith_extensions/object/singleton_send.rb
|
64
|
+
- lib/qualitysmith_extensions/object/mcall.rb
|
65
|
+
- lib/qualitysmith_extensions/object/ancestry_of_method.rb
|
66
|
+
- lib/qualitysmith_extensions/object/send_if_not_nil.rb
|
67
|
+
- lib/qualitysmith_extensions/object/ignore_access.rb
|
68
|
+
- lib/qualitysmith_extensions/object/methods.rb
|
69
|
+
- lib/qualitysmith_extensions/object/default.rb
|
70
|
+
- lib/qualitysmith_extensions/object/send_if.rb
|
71
|
+
- lib/qualitysmith_extensions/object/if_else.rb
|
72
|
+
- lib/qualitysmith_extensions/file/exact_match_regexp.rb
|
73
|
+
- lib/qualitysmith_extensions/date/iso8601.rb
|
74
|
+
- lib/qualitysmith_extensions/date/deprecated.rb
|
75
|
+
- lib/qualitysmith_extensions/date/all.rb
|
76
|
+
- lib/qualitysmith_extensions/date/month_ranges.rb
|
77
|
+
- lib/qualitysmith_extensions/time/deprecated.rb
|
78
|
+
- lib/qualitysmith_extensions/time/all.rb
|
79
|
+
- lib/qualitysmith_extensions/regexp/join.rb
|
80
|
+
- lib/qualitysmith_extensions/find/select.rb
|
81
|
+
- lib/qualitysmith_extensions/mutex/if_available.rb
|
82
|
+
- lib/qualitysmith_extensions/console/command.rb
|
83
|
+
- lib/qualitysmith_extensions/console/command.facets.1.8.54.rb
|
84
|
+
- lib/qualitysmith_extensions/console/command.facets.1.8.51.rb
|
85
|
+
- lib/qualitysmith_extensions/module/guard_method.rb
|
86
|
+
- lib/qualitysmith_extensions/module/ancestry_of_instance_method.rb
|
87
|
+
- lib/qualitysmith_extensions/module/split.rb
|
88
|
+
- lib/qualitysmith_extensions/module/module_methods.rb
|
89
|
+
- lib/qualitysmith_extensions/module/alias_method.rb
|
90
|
+
- lib/qualitysmith_extensions/module/namespace.rb
|
91
|
+
- lib/qualitysmith_extensions/module/malias_method_chain.rb
|
92
|
+
- lib/qualitysmith_extensions/module/includable_once.rb
|
93
|
+
- lib/qualitysmith_extensions/module/parents.rb
|
94
|
+
- lib/qualitysmith_extensions/module/dirname.rb
|
95
|
+
- lib/qualitysmith_extensions/module/basename.rb
|
96
|
+
- lib/qualitysmith_extensions/module/create_setter.rb
|
97
|
+
- lib/qualitysmith_extensions/module/alias_method_chain.rb
|
98
|
+
- lib/qualitysmith_extensions/module/attribute_accessors.rb
|
99
|
+
- lib/qualitysmith_extensions/module/create.rb
|
100
|
+
- lib/qualitysmith_extensions/module/bool_attr_accessor.rb
|
101
|
+
- lib/qualitysmith_extensions/module/remove_const.rb
|
102
|
+
- lib/qualitysmith_extensions/module/join.rb
|
103
|
+
- lib/qualitysmith_extensions/module/class_methods.rb
|
104
|
+
- lib/qualitysmith_extensions/symbol/constantize.rb
|
105
|
+
- lib/qualitysmith_extensions/symbol/match.rb
|
106
|
+
- lib/qualitysmith_extensions/enumerable/select_while.rb
|
107
|
+
- lib/qualitysmith_extensions/enumerable/select_until.rb
|
108
|
+
- lib/qualitysmith_extensions/enumerable/enum.rb
|
109
|
+
- lib/qualitysmith_extensions/hash/to_query_string.rb
|
110
|
+
- lib/qualitysmith_extensions/hash/all.rb
|
111
|
+
- lib/qualitysmith_extensions/hash/to_date.rb
|
112
|
+
- lib/qualitysmith_extensions/array/expand_ranges.rb
|
113
|
+
- lib/qualitysmith_extensions/array/shell_escape.rb
|
114
|
+
- lib/qualitysmith_extensions/array/classify.rb
|
115
|
+
- lib/qualitysmith_extensions/array/to_query_string.rb
|
116
|
+
- lib/qualitysmith_extensions/array/sequence.rb
|
117
|
+
- lib/qualitysmith_extensions/array/to_a_recursive.rb
|
118
|
+
- lib/qualitysmith_extensions/array/all.rb
|
119
|
+
- lib/qualitysmith_extensions/array/average.rb
|
120
|
+
- lib/qualitysmith_extensions/array/group_by.rb
|
121
|
+
- lib/qualitysmith_extensions/string/digits_only.rb
|
122
|
+
- lib/qualitysmith_extensions/string/shell_escape.rb
|
123
|
+
- lib/qualitysmith_extensions/string/with_knowledge_of_color.rb
|
124
|
+
- lib/qualitysmith_extensions/string/md5.rb
|
125
|
+
- lib/qualitysmith_extensions/string/to_underscored_label.rb
|
126
|
+
- lib/qualitysmith_extensions/string/constantize.rb
|
127
|
+
- lib/qualitysmith_extensions/string/all.rb
|
128
|
+
- lib/qualitysmith_extensions/string/each_char_with_index.rb
|
129
|
+
- test/all.rb
|
130
|
+
- Readme
|
131
|
+
test_files:
|
132
|
+
- test/all.rb
|
133
|
+
rdoc_options:
|
134
|
+
- --title
|
135
|
+
- quality_extensions
|
136
|
+
- --main
|
137
|
+
- Readme
|
138
|
+
- --line-numbers
|
139
|
+
extra_rdoc_files:
|
140
|
+
- Readme
|
141
|
+
executables: []
|
142
|
+
|
143
|
+
extensions: []
|
144
|
+
|
145
|
+
requirements: []
|
146
|
+
|
147
|
+
dependencies: []
|
148
|
+
|