zucker 8 → 9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +14 -0
- data/MIT-LICENSE +1 -1
- data/README +1 -1
- data/Rakefile +33 -40
- data/desc/alias_for.yaml +17 -0
- data/desc/aliases.yaml +18 -0
- data/desc/array.yaml +13 -0
- data/desc/array_to_proc.yaml +16 -0
- data/desc/binding.yaml +22 -0
- data/desc/blank.yaml +9 -0
- data/desc/cc.yaml +10 -0
- data/desc/class_to_proc.yaml +11 -0
- data/desc/dd.yaml +23 -0
- data/desc/egonil.yaml +15 -0
- data/desc/engine.yaml +15 -0
- data/desc/enumerable.yaml +10 -0
- data/desc/file.yaml +15 -0
- data/desc/hash.yaml +14 -0
- data/desc/hash_to_proc.yaml +10 -0
- data/desc/info.yaml +20 -0
- data/desc/iterate.yaml +16 -0
- data/desc/ivars.yaml +19 -0
- data/desc/kernel.yaml +14 -0
- data/desc/mcopy.yaml +11 -0
- data/desc/mm.yaml +15 -0
- data/desc/not.yaml +11 -0
- data/desc/oo.yaml +10 -0
- data/desc/os.yaml +19 -0
- data/desc/qq.yaml +11 -0
- data/desc/regexp_to_proc.yaml +12 -0
- data/desc/regexp_visualize.yaml +23 -0
- data/desc/sandbox.yaml +12 -0
- data/desc/square_brackets_for.yaml +22 -0
- data/desc/string.yaml +23 -0
- data/desc/tap.yaml +17 -0
- data/desc/unary.yaml +15 -0
- data/desc/union.yaml +10 -0
- data/desc/version.yaml +28 -0
- data/doc/zucker_doc.html +2688 -0
- data/doc/zucker_doc.rb +553 -0
- data/lib/zucker.rb +10 -9
- data/lib/zucker/array2proc.rb +2 -18
- data/lib/zucker/{2/array2proc.rb → array_to_proc.rb} +0 -0
- data/lib/zucker/binding.rb +4 -5
- data/lib/zucker/cc.rb +7 -2
- data/lib/zucker/class2proc.rb +2 -12
- data/lib/zucker/{1/class2proc.rb → class_to_proc.rb} +0 -0
- data/lib/zucker/file.rb +22 -0
- data/lib/zucker/hash2proc.rb +2 -16
- data/lib/zucker/{1/hash2proc.rb → hash_to_proc.rb} +0 -0
- data/lib/zucker/kernel.rb +4 -2
- data/lib/zucker/mm.rb +14 -8
- data/lib/zucker/regexp2proc.rb +2 -12
- data/lib/zucker/{1/regexp2proc.rb → regexp_to_proc.rb} +0 -0
- data/lib/zucker/regexp_visualize.rb +26 -0
- data/lib/zucker/sandbox.rb +1 -11
- data/spec/alias_for_spec.rb +117 -0
- data/spec/aliases_spec.rb +13 -0
- data/spec/array_spec.rb +23 -0
- data/spec/array_to_proc_spec.rb +12 -0
- data/spec/binding_spec.rb +6 -0
- data/spec/blank_spec.rb +20 -0
- data/spec/cc_spec.rb +6 -0
- data/spec/class_to_proc_spec.rb +9 -0
- data/spec/dd_spec.rb +37 -0
- data/spec/egonil_spec.rb +32 -0
- data/spec/engine_spec.rb +11 -0
- data/spec/enumerable_spec.rb +8 -0
- data/spec/file_spec.rb +30 -0
- data/spec/hash_spec.rb +25 -0
- data/spec/hash_to_proc_spec.rb +12 -0
- data/spec/info_spec.rb +8 -0
- data/spec/iterate_spec.rb +59 -0
- data/spec/ivars_spec.rb +20 -0
- data/spec/kernel_spec.rb +37 -0
- data/spec/mcopy_spec.rb +13 -0
- data/spec/mm_spec.rb +6 -0
- data/spec/not_spec.rb +12 -0
- data/spec/oo_spec.rb +6 -0
- data/spec/os_spec.rb +37 -0
- data/spec/qq_spec.rb +19 -0
- data/spec/regexp_to_proc_spec.rb +9 -0
- data/spec/regexp_visualize_spec.rb +38 -0
- data/spec/sandbox_spec.rb +12 -0
- data/spec/spec_helper.rb +18 -0
- data/spec/square_brackets_for_spec.rb +59 -0
- data/spec/string_spec.rb +65 -0
- data/spec/tap_spec.rb +18 -0
- data/spec/unary_spec.rb +26 -0
- data/spec/union_spec.rb +17 -0
- data/spec/version_spec.rb +55 -0
- data/zucker.gemspec +21 -0
- metadata +139 -323
- data/lib/zucker/1/D.rb +0 -21
- data/lib/zucker/1/aliases.rb +0 -30
- data/lib/zucker/1/all.rb +0 -8
- data/lib/zucker/1/array.rb +0 -19
- data/lib/zucker/1/array2proc.rb +0 -12
- data/lib/zucker/1/binding.rb +0 -27
- data/lib/zucker/1/blank.rb +0 -28
- data/lib/zucker/1/debug.rb +0 -6
- data/lib/zucker/1/default.rb +0 -27
- data/lib/zucker/1/egonil.rb +0 -16
- data/lib/zucker/1/enumerable.rb +0 -14
- data/lib/zucker/1/hash.rb +0 -21
- data/lib/zucker/1/iterate.rb +0 -25
- data/lib/zucker/1/ivars.rb +0 -28
- data/lib/zucker/1/kernel.rb +0 -22
- data/lib/zucker/1/mcopy.rb +0 -11
- data/lib/zucker/1/mm.rb +0 -33
- data/lib/zucker/1/sandbox.rb +0 -17
- data/lib/zucker/1/square_brackets_for.rb +0 -22
- data/lib/zucker/1/string.rb +0 -27
- data/lib/zucker/1/unary.rb +0 -24
- data/lib/zucker/1/union.rb +0 -16
- data/lib/zucker/2/D.rb +0 -21
- data/lib/zucker/2/aliases.rb +0 -30
- data/lib/zucker/2/all.rb +0 -8
- data/lib/zucker/2/array.rb +0 -19
- data/lib/zucker/2/binding.rb +0 -27
- data/lib/zucker/2/blank.rb +0 -28
- data/lib/zucker/2/class2proc.rb +0 -12
- data/lib/zucker/2/debug.rb +0 -6
- data/lib/zucker/2/default.rb +0 -27
- data/lib/zucker/2/egonil.rb +0 -16
- data/lib/zucker/2/enumerable.rb +0 -14
- data/lib/zucker/2/hash.rb +0 -21
- data/lib/zucker/2/hash2proc.rb +0 -16
- data/lib/zucker/2/info.rb +0 -166
- data/lib/zucker/2/iterate.rb +0 -25
- data/lib/zucker/2/ivars.rb +0 -28
- data/lib/zucker/2/kernel.rb +0 -20
- data/lib/zucker/2/mcopy.rb +0 -11
- data/lib/zucker/2/mm.rb +0 -33
- data/lib/zucker/2/regexp2proc.rb +0 -12
- data/lib/zucker/2/sandbox.rb +0 -21
- data/lib/zucker/2/square_brackets_for.rb +0 -22
- data/lib/zucker/2/string.rb +0 -27
- data/lib/zucker/2/unary.rb +0 -24
- data/lib/zucker/2/union.rb +0 -16
- data/lib/zucker/3/D.rb +0 -21
- data/lib/zucker/3/alias_for.rb +0 -21
- data/lib/zucker/3/aliases.rb +0 -30
- data/lib/zucker/3/all.rb +0 -8
- data/lib/zucker/3/array.rb +0 -25
- data/lib/zucker/3/array2proc.rb +0 -18
- data/lib/zucker/3/binding.rb +0 -27
- data/lib/zucker/3/blank.rb +0 -28
- data/lib/zucker/3/class2proc.rb +0 -12
- data/lib/zucker/3/debug.rb +0 -8
- data/lib/zucker/3/default.rb +0 -37
- data/lib/zucker/3/egonil.rb +0 -16
- data/lib/zucker/3/enumerable.rb +0 -14
- data/lib/zucker/3/hash.rb +0 -21
- data/lib/zucker/3/hash2proc.rb +0 -16
- data/lib/zucker/3/info.rb +0 -169
- data/lib/zucker/3/iterate.rb +0 -25
- data/lib/zucker/3/ivars.rb +0 -28
- data/lib/zucker/3/kernel.rb +0 -50
- data/lib/zucker/3/mcopy.rb +0 -10
- data/lib/zucker/3/mm.rb +0 -33
- data/lib/zucker/3/not.rb +0 -19
- data/lib/zucker/3/regexp2proc.rb +0 -12
- data/lib/zucker/3/sandbox.rb +0 -21
- data/lib/zucker/3/square_brackets_for.rb +0 -22
- data/lib/zucker/3/string.rb +0 -49
- data/lib/zucker/3/tap.rb +0 -11
- data/lib/zucker/3/unary.rb +0 -24
- data/lib/zucker/3/union.rb +0 -16
- data/lib/zucker/4/D.rb +0 -21
- data/lib/zucker/4/alias_for.rb +0 -21
- data/lib/zucker/4/aliases.rb +0 -35
- data/lib/zucker/4/all.rb +0 -8
- data/lib/zucker/4/array.rb +0 -25
- data/lib/zucker/4/array2proc.rb +0 -18
- data/lib/zucker/4/binding.rb +0 -27
- data/lib/zucker/4/blank.rb +0 -28
- data/lib/zucker/4/class2proc.rb +0 -12
- data/lib/zucker/4/debug.rb +0 -8
- data/lib/zucker/4/default.rb +0 -40
- data/lib/zucker/4/egonil.rb +0 -16
- data/lib/zucker/4/engine.rb +0 -69
- data/lib/zucker/4/enumerable.rb +0 -14
- data/lib/zucker/4/hash.rb +0 -21
- data/lib/zucker/4/hash2proc.rb +0 -16
- data/lib/zucker/4/info.rb +0 -173
- data/lib/zucker/4/iterate.rb +0 -25
- data/lib/zucker/4/ivars.rb +0 -28
- data/lib/zucker/4/kernel.rb +0 -27
- data/lib/zucker/4/mcopy.rb +0 -10
- data/lib/zucker/4/mm.rb +0 -33
- data/lib/zucker/4/not.rb +0 -19
- data/lib/zucker/4/os.rb +0 -50
- data/lib/zucker/4/q.rb +0 -7
- data/lib/zucker/4/regexp2proc.rb +0 -12
- data/lib/zucker/4/sandbox.rb +0 -23
- data/lib/zucker/4/square_brackets_for.rb +0 -22
- data/lib/zucker/4/string.rb +0 -54
- data/lib/zucker/4/tap.rb +0 -11
- data/lib/zucker/4/unary.rb +0 -24
- data/lib/zucker/4/union.rb +0 -16
- data/lib/zucker/4/version.rb +0 -115
- data/lib/zucker/5/alias_for.rb +0 -21
- data/lib/zucker/5/aliases.rb +0 -51
- data/lib/zucker/5/all.rb +0 -4
- data/lib/zucker/5/array.rb +0 -25
- data/lib/zucker/5/array2proc.rb +0 -18
- data/lib/zucker/5/binding.rb +0 -34
- data/lib/zucker/5/blank.rb +0 -28
- data/lib/zucker/5/cc.rb +0 -25
- data/lib/zucker/5/class2proc.rb +0 -12
- data/lib/zucker/5/control.rb +0 -4
- data/lib/zucker/5/dd.rb +0 -24
- data/lib/zucker/5/debug.rb +0 -4
- data/lib/zucker/5/default.rb +0 -4
- data/lib/zucker/5/egonil.rb +0 -16
- data/lib/zucker/5/engine.rb +0 -69
- data/lib/zucker/5/enumerable.rb +0 -14
- data/lib/zucker/5/env.rb +0 -4
- data/lib/zucker/5/extensions.rb +0 -4
- data/lib/zucker/5/hash.rb +0 -27
- data/lib/zucker/5/hash2proc.rb +0 -16
- data/lib/zucker/5/info.rb +0 -177
- data/lib/zucker/5/iterate.rb +0 -26
- data/lib/zucker/5/ivars.rb +0 -28
- data/lib/zucker/5/kernel.rb +0 -34
- data/lib/zucker/5/mcopy.rb +0 -10
- data/lib/zucker/5/mm.rb +0 -34
- data/lib/zucker/5/not.rb +0 -19
- data/lib/zucker/5/object.rb +0 -4
- data/lib/zucker/5/oo.rb +0 -17
- data/lib/zucker/5/os.rb +0 -49
- data/lib/zucker/5/qq.rb +0 -12
- data/lib/zucker/5/regexp2proc.rb +0 -12
- data/lib/zucker/5/sandbox.rb +0 -25
- data/lib/zucker/5/shortcuts.rb +0 -4
- data/lib/zucker/5/square_brackets_for.rb +0 -21
- data/lib/zucker/5/string.rb +0 -54
- data/lib/zucker/5/tap.rb +0 -11
- data/lib/zucker/5/to_proc.rb +0 -4
- data/lib/zucker/5/unary.rb +0 -24
- data/lib/zucker/5/union.rb +0 -16
- data/lib/zucker/5/version.rb +0 -118
- data/lib/zucker/6/alias_for.rb +0 -21
- data/lib/zucker/6/aliases.rb +0 -51
- data/lib/zucker/6/all.rb +0 -4
- data/lib/zucker/6/array.rb +0 -25
- data/lib/zucker/6/array2proc.rb +0 -18
- data/lib/zucker/6/binding.rb +0 -34
- data/lib/zucker/6/blank.rb +0 -28
- data/lib/zucker/6/cc.rb +0 -25
- data/lib/zucker/6/class2proc.rb +0 -12
- data/lib/zucker/6/control.rb +0 -4
- data/lib/zucker/6/dd.rb +0 -23
- data/lib/zucker/6/debug.rb +0 -4
- data/lib/zucker/6/default.rb +0 -4
- data/lib/zucker/6/egonil.rb +0 -27
- data/lib/zucker/6/engine.rb +0 -68
- data/lib/zucker/6/enumerable.rb +0 -14
- data/lib/zucker/6/env.rb +0 -4
- data/lib/zucker/6/extensions.rb +0 -4
- data/lib/zucker/6/hash.rb +0 -27
- data/lib/zucker/6/hash2proc.rb +0 -16
- data/lib/zucker/6/info.rb +0 -192
- data/lib/zucker/6/iterate.rb +0 -27
- data/lib/zucker/6/ivars.rb +0 -28
- data/lib/zucker/6/kernel.rb +0 -34
- data/lib/zucker/6/mcopy.rb +0 -10
- data/lib/zucker/6/mm.rb +0 -34
- data/lib/zucker/6/not.rb +0 -19
- data/lib/zucker/6/object.rb +0 -4
- data/lib/zucker/6/oo.rb +0 -17
- data/lib/zucker/6/os.rb +0 -54
- data/lib/zucker/6/qq.rb +0 -12
- data/lib/zucker/6/regexp2proc.rb +0 -12
- data/lib/zucker/6/sandbox.rb +0 -25
- data/lib/zucker/6/shortcuts.rb +0 -4
- data/lib/zucker/6/square_brackets_for.rb +0 -21
- data/lib/zucker/6/string.rb +0 -54
- data/lib/zucker/6/tap.rb +0 -11
- data/lib/zucker/6/to_proc.rb +0 -4
- data/lib/zucker/6/unary.rb +0 -24
- data/lib/zucker/6/union.rb +0 -16
- data/lib/zucker/6/version.rb +0 -118
- data/lib/zucker/7/alias_for.rb +0 -21
- data/lib/zucker/7/aliases.rb +0 -51
- data/lib/zucker/7/all.rb +0 -4
- data/lib/zucker/7/array.rb +0 -25
- data/lib/zucker/7/array2proc.rb +0 -18
- data/lib/zucker/7/binding.rb +0 -34
- data/lib/zucker/7/blank.rb +0 -28
- data/lib/zucker/7/cc.rb +0 -25
- data/lib/zucker/7/class2proc.rb +0 -12
- data/lib/zucker/7/control.rb +0 -4
- data/lib/zucker/7/dd.rb +0 -23
- data/lib/zucker/7/debug.rb +0 -4
- data/lib/zucker/7/default.rb +0 -4
- data/lib/zucker/7/egonil.rb +0 -27
- data/lib/zucker/7/engine.rb +0 -68
- data/lib/zucker/7/enumerable.rb +0 -14
- data/lib/zucker/7/env.rb +0 -4
- data/lib/zucker/7/extensions.rb +0 -4
- data/lib/zucker/7/hash.rb +0 -27
- data/lib/zucker/7/hash2proc.rb +0 -16
- data/lib/zucker/7/info.rb +0 -192
- data/lib/zucker/7/iterate.rb +0 -27
- data/lib/zucker/7/ivars.rb +0 -28
- data/lib/zucker/7/kernel.rb +0 -34
- data/lib/zucker/7/mcopy.rb +0 -10
- data/lib/zucker/7/mm.rb +0 -34
- data/lib/zucker/7/not.rb +0 -19
- data/lib/zucker/7/object.rb +0 -4
- data/lib/zucker/7/oo.rb +0 -17
- data/lib/zucker/7/os.rb +0 -54
- data/lib/zucker/7/qq.rb +0 -12
- data/lib/zucker/7/regexp2proc.rb +0 -12
- data/lib/zucker/7/sandbox.rb +0 -25
- data/lib/zucker/7/shortcuts.rb +0 -4
- data/lib/zucker/7/square_brackets_for.rb +0 -21
- data/lib/zucker/7/string.rb +0 -54
- data/lib/zucker/7/tap.rb +0 -11
- data/lib/zucker/7/to_proc.rb +0 -4
- data/lib/zucker/7/unary.rb +0 -24
- data/lib/zucker/7/union.rb +0 -16
- data/lib/zucker/7/version.rb +0 -118
- data/lib/zucker/8/alias_for.rb +0 -21
- data/lib/zucker/8/aliases.rb +0 -51
- data/lib/zucker/8/all.rb +0 -4
- data/lib/zucker/8/array.rb +0 -25
- data/lib/zucker/8/array2proc.rb +0 -18
- data/lib/zucker/8/binding.rb +0 -33
- data/lib/zucker/8/blank.rb +0 -28
- data/lib/zucker/8/cc.rb +0 -25
- data/lib/zucker/8/class2proc.rb +0 -12
- data/lib/zucker/8/control.rb +0 -4
- data/lib/zucker/8/dd.rb +0 -23
- data/lib/zucker/8/debug.rb +0 -4
- data/lib/zucker/8/default.rb +0 -4
- data/lib/zucker/8/egonil.rb +0 -27
- data/lib/zucker/8/engine.rb +0 -68
- data/lib/zucker/8/enumerable.rb +0 -14
- data/lib/zucker/8/env.rb +0 -4
- data/lib/zucker/8/extensions.rb +0 -4
- data/lib/zucker/8/hash.rb +0 -27
- data/lib/zucker/8/hash2proc.rb +0 -16
- data/lib/zucker/8/info.rb +0 -192
- data/lib/zucker/8/iterate.rb +0 -27
- data/lib/zucker/8/ivars.rb +0 -28
- data/lib/zucker/8/kernel.rb +0 -34
- data/lib/zucker/8/mcopy.rb +0 -10
- data/lib/zucker/8/mm.rb +0 -34
- data/lib/zucker/8/not.rb +0 -19
- data/lib/zucker/8/object.rb +0 -4
- data/lib/zucker/8/oo.rb +0 -17
- data/lib/zucker/8/os.rb +0 -54
- data/lib/zucker/8/qq.rb +0 -12
- data/lib/zucker/8/regexp2proc.rb +0 -12
- data/lib/zucker/8/sandbox.rb +0 -25
- data/lib/zucker/8/shortcuts.rb +0 -4
- data/lib/zucker/8/square_brackets_for.rb +0 -21
- data/lib/zucker/8/string.rb +0 -54
- data/lib/zucker/8/tap.rb +0 -11
- data/lib/zucker/8/to_proc.rb +0 -4
- data/lib/zucker/8/unary.rb +0 -24
- data/lib/zucker/8/union.rb +0 -16
- data/lib/zucker/8/version.rb +0 -118
data/CHANGELOG
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
2011-01-22 | Zucker 9
|
2
|
+
* removed history versions (sorry, it caused too much gem/rdoc troubles)
|
3
|
+
* add file cube: File.delete! and File.gsub
|
4
|
+
* debug pack improvements
|
5
|
+
* binding: typos + return nil
|
6
|
+
* cc: support for ripl + return nil
|
7
|
+
* mm: also show eigenclass for modules + nicer displaying + return nil
|
8
|
+
* added Regexp#visualize
|
9
|
+
* removed optional sandbox param
|
10
|
+
* renamed xxx2proc to xxx_to_proc
|
11
|
+
* changed rakefile/rspec/gemspec structure
|
12
|
+
* more minor fixes and improvements
|
13
|
+
|
14
|
+
|
1
15
|
2010-10-06 | Zucker 8
|
2
16
|
* fixed a little alias_for bug
|
3
17
|
* disabled rdoc creation when installing (in favour of the custom docs)
|
data/MIT-LICENSE
CHANGED
data/README
CHANGED
@@ -2,6 +2,6 @@ See http://rubyzucker.info or doc/zucker_doc.html
|
|
2
2
|
|
3
3
|
Please see the github wiki page, for discussion and contributing: http://wiki.github.com/janlelis/zucker
|
4
4
|
|
5
|
-
Copyright (c) 2010 Jan Lelis, http://rbjl.net, released under the MIT license
|
5
|
+
Copyright (c) 2010-2011 Jan Lelis, http://rbjl.net, released under the MIT license
|
6
6
|
|
7
7
|
J-_-L
|
data/Rakefile
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rake'
|
2
|
-
|
3
|
-
require '
|
4
|
-
require 'spec/rake/spectask'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require 'fileutils'
|
5
4
|
|
6
5
|
if RUBY_VERSION >= '1.9.2'
|
7
6
|
require_relative 'lib/zucker'
|
@@ -9,47 +8,49 @@ else
|
|
9
8
|
require 'lib/zucker'
|
10
9
|
end
|
11
10
|
|
11
|
+
@path = Rake.application.find_rakefile_location[1]
|
12
|
+
|
12
13
|
desc 'Build documentation'
|
13
14
|
task 'doc' do
|
14
|
-
|
15
|
-
ruby File.join(zucker_path, 'doc/zucker_doc.rb'), zucker_path
|
15
|
+
ruby File.join(@path, 'doc/zucker_doc.rb'), @path
|
16
16
|
end
|
17
17
|
|
18
18
|
task 'default' => 'spec'
|
19
|
-
|
20
|
-
t.
|
19
|
+
RSpec::Core::RakeTask.new('spec') do |t|
|
20
|
+
t.ruby_opts = "-r " + File.join(@path, 'spec', 'spec_helper')
|
21
|
+
|
21
22
|
if RUBY_VERSION < '1.9'
|
22
|
-
t.
|
23
|
+
t.pattern = File.join(@path, 'spec', '*_spec.rb')
|
24
|
+
else
|
25
|
+
t.pattern = File.join(@path, 'spec', '*.rb')
|
23
26
|
end
|
24
27
|
end
|
25
28
|
|
26
29
|
# gem
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
s.add_development_dependency 'coderay'
|
42
|
-
s.has_rdoc = false
|
43
|
-
s.rdoc_options = '--version' # don't generate
|
30
|
+
def gemspec
|
31
|
+
@gemspec ||= eval(File.read( File.join(@path, 'zucker.gemspec') ), binding, 'zucker.gemspec')
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "Build the gem"
|
35
|
+
task :gem => :gemspec do
|
36
|
+
sh "gem build zucker.gemspec"
|
37
|
+
FileUtils.mkdir_p 'pkg'
|
38
|
+
FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", 'pkg'
|
39
|
+
end
|
40
|
+
|
41
|
+
desc "Install the gem locally"
|
42
|
+
task :install => :gem do
|
43
|
+
sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
|
44
44
|
end
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
desc "Validate the gemspec"
|
47
|
+
task :gemspec do
|
48
|
+
gemspec.validate
|
48
49
|
end
|
49
50
|
|
50
51
|
# release
|
51
52
|
desc 'run specs, build doc, bump version, set date, copy version directories and add these changes to git'
|
52
|
-
task 'prepare_release' => %w[spec
|
53
|
+
task 'prepare_release' => %w[spec] do # run specs
|
53
54
|
# really want to release?
|
54
55
|
print 'Do you really want to release? ...then enter release: '
|
55
56
|
exit if $stdin.gets.chomp != 'release'
|
@@ -61,15 +62,7 @@ task 'prepare_release' => %w[spec doc] do # run specs and doc
|
|
61
62
|
zucker_rb.sub! /DATE\s*=.*$/, "DATE = '#{Date.today}'"
|
62
63
|
File.open 'lib/zucker.rb','w' do |f| f.write zucker_rb end
|
63
64
|
|
64
|
-
|
65
|
-
`mkdir lib/zucker/#@v`
|
66
|
-
`cp lib/zucker/*.* lib/zucker/#@v/`
|
67
|
-
`mkdir desc/#@v`
|
68
|
-
`cp desc/*.* desc/#@v/`
|
69
|
-
`mkdir doc/#@v`
|
70
|
-
`cp doc/*.* doc/#@v/`
|
71
|
-
`mkdir spec/#@v`
|
72
|
-
`cp spec/*.* spec/#@v/`
|
65
|
+
`rake doc`
|
73
66
|
|
74
67
|
# add changes to git and tag
|
75
68
|
`git add .`
|
@@ -80,10 +73,10 @@ task 'prepare_release' => %w[spec doc] do # run specs and doc
|
|
80
73
|
puts "prepared Zucker #@v gem release"
|
81
74
|
end
|
82
75
|
|
83
|
-
desc 'prepare_release, build gem, and push it to git and rubygems'
|
76
|
+
desc 'prepare_release, build gem, and push it to git and display rubygems push command'
|
84
77
|
task 'release' => %w[gem] do
|
78
|
+
`git push origin master`
|
85
79
|
`git push origin master --tags`
|
86
|
-
last_gem = Dir['pkg/zucker-*.gem'].sort[-1] # TODO
|
87
|
-
exit if last_gem =~ /next/ # some error happened, do not pollute rubygems.org
|
80
|
+
last_gem = Dir['pkg/zucker-*.gem'].sort[-1] # TODO read version from lib/zucker.rb for zucker-10
|
88
81
|
puts "gem push pkg/#{last_gem}"
|
89
82
|
end
|
data/desc/alias_for.yaml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
alias_for:
|
2
|
+
summary: 'A different way to create aliases: Reversed order and you can pass multiple alias names.'
|
3
|
+
why: "It's clearer in which order to put the arguments."
|
4
|
+
methods:
|
5
|
+
alias_for, aliases_for: |
|
6
|
+
alias_for :methods, :ms # creates an alias for the method :methods with the name ms
|
7
|
+
module Enumerable
|
8
|
+
aliases_for :zip, :with, :%
|
9
|
+
end # creates multiple aliases
|
10
|
+
Module#method_alias_for, Module#method_aliases_for: |
|
11
|
+
# same as alias_for, but using Module#alias_method instead of alias
|
12
|
+
info:
|
13
|
+
- Thanks to Kristian Mandrup for the idea and alias method specs.
|
14
|
+
versions:
|
15
|
+
- 1.9
|
16
|
+
- 1.8
|
17
|
+
|
data/desc/aliases.yaml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
aliases:
|
2
|
+
summary: Some convenient aliases (and constants) for existing methods.
|
3
|
+
methods:
|
4
|
+
Object#is_an?: Object.is_a?
|
5
|
+
Enumerable#with: Enumerable#zip
|
6
|
+
Enumerable#%: Enumerable#zip
|
7
|
+
Array#**: Array#product
|
8
|
+
Hash#+: Hash#merge
|
9
|
+
Binding#[]: Binding#eval
|
10
|
+
File.filename: File.basename
|
11
|
+
Dir.join: File.join
|
12
|
+
Dir.split: File.split
|
13
|
+
Infinity: 1.0 / 0.0
|
14
|
+
NaN: 0.0 / 0.0
|
15
|
+
versions:
|
16
|
+
- 1.9
|
17
|
+
- 1.8
|
18
|
+
|
data/desc/array.yaml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
array:
|
2
|
+
summary: Methods one could miss for ⇧Array⇧.
|
3
|
+
why:
|
4
|
+
- ⇧Array⇧ has ⇧&⇧ and ⇧|⇧, but why does it not have ⇧^⇧?
|
5
|
+
- ⇧sum⇧ is just needed pretty often..
|
6
|
+
methods:
|
7
|
+
Array#^: "[1,2,3,4] ^ [3,4,5,6] # => [1,2,5,6]"
|
8
|
+
Array#sum: "[1,2,3,4,5].sum # => 15"
|
9
|
+
Array#chrs: "[72, 97, 108, 108, 111].chrs # => 'Hallo'"
|
10
|
+
versions:
|
11
|
+
- 1.9
|
12
|
+
- 1.8
|
13
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
array_to_proc:
|
2
|
+
summary: Calls the method named by the first paramenter and passes the other elements as paramaters.
|
3
|
+
why: When using ⇧Symbol#to_proc⇧, you often wish to pass parameters.
|
4
|
+
methods:
|
5
|
+
Array#to_proc: |
|
6
|
+
[1,2,3,4].map &[:*, 5] # => [5, 10, 15, 20]
|
7
|
+
# you can also chain them, if the first parameter is an Array
|
8
|
+
[1,2,3,4].map &[[:to_s, 2],[:+, 'b']] # => ["1b", "10b", "11b", "100b"]
|
9
|
+
info:
|
10
|
+
- Inspired by →this article→http://www.sanityinc.com/articles/adding-array-to-proc-to-ruby→.
|
11
|
+
- "More about →to_proc→http://rbjl.net/29-become-a-proc-star→."
|
12
|
+
- Chaining inspired by →eregon→http://github.com/eregon/Classes/blob/master/to_proc.rb→.
|
13
|
+
versions:
|
14
|
+
- 1.9
|
15
|
+
- 1.8
|
16
|
+
|
data/desc/binding.yaml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
binding:
|
2
|
+
summary: Adds a ⇧Binding#vars⇧. It gives you information about the current environment variables.
|
3
|
+
methods:
|
4
|
+
Binding#variables, Binding#vars: |
|
5
|
+
# shows your current environment's variables, irb example:
|
6
|
+
>> a=3
|
7
|
+
=> 3
|
8
|
+
>> binding.vars
|
9
|
+
=> #<Binding:0x94c4b50>
|
10
|
+
local variables
|
11
|
+
- a: 3
|
12
|
+
- _: #<Binding:0x94c4b50>
|
13
|
+
(instance variables)
|
14
|
+
- none
|
15
|
+
self
|
16
|
+
- main
|
17
|
+
block_given?
|
18
|
+
- false
|
19
|
+
versions:
|
20
|
+
- 1.9
|
21
|
+
- 1.8
|
22
|
+
|
data/desc/blank.yaml
ADDED
data/desc/cc.yaml
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
class_to_proc:
|
2
|
+
summary: Creates a new instance of the class.
|
3
|
+
methods:
|
4
|
+
Class#to_proc: "[ [1,2],[3,5,6,7,3] ].map(&Set) # => [ Set[1,2], Set[5,6,7,3] ]"
|
5
|
+
info:
|
6
|
+
- Inspired by Ruby Facets.
|
7
|
+
- "More about →to_proc→http://rbjl.net/29-become-a-proc-star→."
|
8
|
+
versions:
|
9
|
+
- 1.9
|
10
|
+
- 1.8
|
11
|
+
|
data/desc/dd.yaml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
dd:
|
2
|
+
summary: Easy debug printing with the ⇧p⇧ alternative ⇧.d⇧. It outputs to stdout and returns ⇧self⇧. Accepts a block.
|
3
|
+
methods:
|
4
|
+
Object#d, Object#dd: |
|
5
|
+
some.d.methods.d.noone.d.knows.d
|
6
|
+
# ...outputs 4 lines with the inspected objects
|
7
|
+
# => (result)
|
8
|
+
|
9
|
+
21+Math.sin(42).d
|
10
|
+
# outputs -0.916521547915634
|
11
|
+
# => 20.0834784520844
|
12
|
+
|
13
|
+
name = 'Earth'
|
14
|
+
'Hello ' + name.d{|e| "The length is: #{e.size}"}
|
15
|
+
# outputs "The length is: 5"
|
16
|
+
# => 'Hello Earth'
|
17
|
+
info:
|
18
|
+
- "This is inspired by the →⇧.tap⇧ method→http://moonbase.rydia.net/mental/blog/programming/eavesdropping-on-expressions→."
|
19
|
+
- There is also ⇧tap⇧ cube with more ⇧tap⇧ methods.
|
20
|
+
versions:
|
21
|
+
- 1.9
|
22
|
+
- 1.8
|
23
|
+
|
data/desc/egonil.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
egonil:
|
2
|
+
summary: Creates a block, where ⇧nil⇧ does not raise ⇧NoMethodError⇧s.
|
3
|
+
methods:
|
4
|
+
egonil, nn: |
|
5
|
+
egonil do
|
6
|
+
nil.some_methods.that[:do].not.exist
|
7
|
+
end # => nil
|
8
|
+
|
9
|
+
nn{ nil.some_methods.that[:do].not.exist } # => nil
|
10
|
+
info:
|
11
|
+
- See →this post→http://rbjl.net/26-the-28-bytes-of-ruby-joy→ for more information and discussion.
|
12
|
+
versions:
|
13
|
+
- 1.9
|
14
|
+
- 1.8
|
15
|
+
|
data/desc/engine.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
engine:
|
2
|
+
summary: Adds a ⇧RubyEngine⇧ class for easy compatibility checks.
|
3
|
+
methods:
|
4
|
+
RubyEngine: |
|
5
|
+
RubyEngine: "# outputs the interpreter name"
|
6
|
+
RubyEngine.mri?: "RubyEngine.mri? # true if using the official Ruby interpreter"
|
7
|
+
RubyEngine.jruby?: "RubyEngine.jruby? # true if using JRuby"
|
8
|
+
RubyEngine.rubinius?: "RubyEngine.rubinius? # true if using rubinius"
|
9
|
+
RubyEngine.ree?: "RubyEngine.ree? # true if using enterprise edition"
|
10
|
+
RubyEngine.ironruby?: "RubyEngine.ironruby? # true if using IronRuby"
|
11
|
+
RubyEngine.macruby?: "RubyEngine.macruby? # true if using MacRuby"
|
12
|
+
RubyEngine.cardinal?: "RubyEngine.cardinal? # true if using parrot"
|
13
|
+
versions:
|
14
|
+
- 1.9
|
15
|
+
- 1.8
|
data/desc/file.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
file:
|
2
|
+
summary: Extensions for ⇧File⇧.
|
3
|
+
methods:
|
4
|
+
File#gsub: |
|
5
|
+
File.gsub 'some_filename', {
|
6
|
+
/hi/ => 'cu',
|
7
|
+
/\d/ => proc do ($&.to_i+1).to_s end
|
8
|
+
} # will read the file and substitute the hash keys with their values
|
9
|
+
File#delete!: "File.delete! 'some_filename' # will delete the file, don't care if it exist."
|
10
|
+
info:
|
11
|
+
- "Idea for ⇧.File#delete!⇧. from sugar-high."
|
12
|
+
versions:
|
13
|
+
- 1.9
|
14
|
+
- 1.8
|
15
|
+
|
data/desc/hash.yaml
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
hash:
|
2
|
+
summary: Some sugar for dealing with hashs.
|
3
|
+
methods:
|
4
|
+
Hash.zip: "Hash.zip [1,2,3], [4,5,6] # => {1=>4, 2=>5, 3=>6}"
|
5
|
+
Hash#<<: |
|
6
|
+
{1=>2} << [3, 4] # => { 1=>2, 3=>4 }
|
7
|
+
{1=>2} << { 5=>6 } # => { 1=>2, 5=>6 }
|
8
|
+
Hash#&: "{ 1=>4, 2=>5, 3=>6 } & { 1=>4, 2=>7 } # => { 1=>4 }"
|
9
|
+
info:
|
10
|
+
- Some of the operators are inspired by Ruby Facets.
|
11
|
+
versions:
|
12
|
+
- 1.9
|
13
|
+
- 1.8
|
14
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
hash_to_proc:
|
2
|
+
summary: Use a hash to apply procs to specific objects.
|
3
|
+
methods:
|
4
|
+
Hash#to_proc: "[1,2,3,4].map(&{\n2 => lambda {|e| e + 1000},\n4 => :to_s,\n}) # => [1, 1002, 3, '4']"
|
5
|
+
info:
|
6
|
+
- "More about →to_proc→http://rbjl.net/29-become-a-proc-star→."
|
7
|
+
versions:
|
8
|
+
- 1.9
|
9
|
+
- 1.8
|
10
|
+
|
data/desc/info.yaml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
info:
|
2
|
+
summary: Access environment information with the ⇧Info⇧ module.
|
3
|
+
why: "You don't need to remember in which global variable, constant or special method the information you are searching for is hidden."
|
4
|
+
methods:
|
5
|
+
Info: |
|
6
|
+
# for example
|
7
|
+
Info.working_directory # Dir.pwd
|
8
|
+
Info.load_path # $:
|
9
|
+
Info.platform # RUBY_PLATFORM
|
10
|
+
Info.current_file # similar to __FILE__
|
11
|
+
# you could also add them to the global namespace with: include Info
|
12
|
+
# see the source file for the list of accessors or
|
13
|
+
Info.list
|
14
|
+
info:
|
15
|
+
- Please note that it is not possible to put some of __THOSE_KEYWORDS__ in methods, so the result might slightly differ. This might affect ⇧current_file⇧, ⇧current_file_directory⇧, ⇧current_line⇧ and ⇧current_method⇧.
|
16
|
+
- Thanks to Facets for the ⇧caller⇧ Regexp.
|
17
|
+
versions:
|
18
|
+
- 1.9
|
19
|
+
- 1.8 (not all information)
|
20
|
+
|
data/desc/iterate.yaml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
iterate:
|
2
|
+
summary: Iterate over one or more collections.
|
3
|
+
why: "It's like ⇧.each⇧ with two differences: It feels more like a control structure and you can easily iterate over multiple objects."
|
4
|
+
methods:
|
5
|
+
iterate: |
|
6
|
+
iterate [1,2], [3,4,5] do |e,f|
|
7
|
+
puts "#{e},#{f}"
|
8
|
+
end
|
9
|
+
# outputs
|
10
|
+
# 1,3
|
11
|
+
# 2,4
|
12
|
+
# ,5
|
13
|
+
versions:
|
14
|
+
- 1.9
|
15
|
+
- 1.8
|
16
|
+
|
data/desc/ivars.yaml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
ivars:
|
2
|
+
summary: This method lets you easily assign lots of instance variables.
|
3
|
+
why: |
|
4
|
+
Often, you have to write boilerplate code for assigning instance variables, for example this one:
|
5
|
+
⇧def initialize(variable1, variable2)
|
6
|
+
@variable1, @variable2 = variable1, variable2
|
7
|
+
end⇧
|
8
|
+
methods:
|
9
|
+
instance_variables_from, ivars: |
|
10
|
+
def a_method(a = 1, b = 2)
|
11
|
+
instance_variables_from binding # assigns @a and @b
|
12
|
+
|
13
|
+
params = {:c => 3, :d => 4}
|
14
|
+
instance_variables_from params # # assigns @c and @d
|
15
|
+
end
|
16
|
+
versions:
|
17
|
+
- 1.9
|
18
|
+
- 1.8
|
19
|
+
|