zucker 13.1 → 100.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +17 -2
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +22 -0
  5. data/Rakefile +17 -58
  6. data/doc/{zucker_doc.rb → create_documentation.rb} +67 -129
  7. data/doc/zucker.html +1774 -0
  8. data/lib/zucker.rb +12 -42
  9. data/lib/zucker/alias_for.rb +9 -16
  10. data/lib/zucker/all.rb +0 -2
  11. data/lib/zucker/array_op.rb +15 -0
  12. data/lib/zucker/blank.rb +39 -21
  13. data/lib/zucker/camel_snake.rb +15 -0
  14. data/lib/zucker/constantize.rb +29 -0
  15. data/lib/zucker/dir_extras.rb +20 -0
  16. data/lib/zucker/egonil.rb +13 -24
  17. data/lib/zucker/file_extras.rb +33 -0
  18. data/lib/zucker/hash_extras.rb +11 -0
  19. data/lib/zucker/hash_op.rb +28 -0
  20. data/lib/zucker/instance_variables_from.rb +34 -0
  21. data/lib/zucker/iterate.rb +24 -21
  22. data/lib/zucker/marshal_copy.rb +11 -0
  23. data/lib/zucker/mash.rb +22 -0
  24. data/lib/zucker/ords.rb +17 -0
  25. data/lib/zucker/regexp_union.rb +17 -0
  26. data/lib/zucker/square_brackets_for.rb +12 -15
  27. data/lib/zucker/string_extras.rb +15 -0
  28. data/lib/zucker/string_op.rb +20 -0
  29. data/lib/zucker/tap.rb +13 -8
  30. data/lib/zucker/unary_conversion.rb +25 -0
  31. data/spec/alias_for_spec.rb +11 -73
  32. data/spec/array_op_spec.rb +17 -0
  33. data/spec/blank_spec.rb +2 -0
  34. data/spec/camel_snake_spec.rb +15 -0
  35. data/spec/constantize_spec.rb +33 -0
  36. data/spec/dir_extras_spec.rb +32 -0
  37. data/spec/egonil_spec.rb +1 -0
  38. data/spec/file_extras_spec.rb +57 -0
  39. data/spec/hash_extras_spec.rb +11 -0
  40. data/spec/hash_op_spec.rb +28 -0
  41. data/spec/instance_variables_from_spec.rb +24 -0
  42. data/spec/iterate_spec.rb +2 -0
  43. data/spec/{mcopy_spec.rb → marshal_copy_spec.rb} +5 -3
  44. data/spec/mash_spec.rb +17 -0
  45. data/spec/ords_spec.rb +15 -0
  46. data/spec/{union_spec.rb → regexp_union_spec.rb} +4 -2
  47. data/spec/square_brackets_for_spec.rb +4 -12
  48. data/spec/string_extras_spec.rb +20 -0
  49. data/spec/string_op_spec.rb +22 -0
  50. data/spec/tap_spec.rb +2 -0
  51. data/spec/{unary_spec.rb → unary_conversion_spec.rb} +4 -2
  52. data/zucker.gemspec +8 -18
  53. metadata +75 -147
  54. data/.gemtest +0 -0
  55. data/README +0 -7
  56. data/desc/alias_for.yaml +0 -17
  57. data/desc/aliases.yaml +0 -18
  58. data/desc/array.yaml +0 -11
  59. data/desc/array_to_proc.yaml +0 -16
  60. data/desc/binding.yaml +0 -22
  61. data/desc/blank.yaml +0 -11
  62. data/desc/case.yaml +0 -9
  63. data/desc/cc.yaml +0 -10
  64. data/desc/class_to_proc.yaml +0 -11
  65. data/desc/dd.yaml +0 -23
  66. data/desc/egonil.yaml +0 -15
  67. data/desc/engine.yaml +0 -15
  68. data/desc/enumerable.yaml +0 -10
  69. data/desc/file.yaml +0 -14
  70. data/desc/hash.yaml +0 -14
  71. data/desc/hash_to_proc.yaml +0 -10
  72. data/desc/info.yaml +0 -20
  73. data/desc/iterate.yaml +0 -16
  74. data/desc/ivars.yaml +0 -19
  75. data/desc/kernel.yaml +0 -15
  76. data/desc/mcopy.yaml +0 -11
  77. data/desc/mm.yaml +0 -15
  78. data/desc/not.yaml +0 -11
  79. data/desc/oo.yaml +0 -10
  80. data/desc/os.yaml +0 -19
  81. data/desc/qq.yaml +0 -11
  82. data/desc/regexp_to_proc.yaml +0 -12
  83. data/desc/regexp_visualize.yaml +0 -23
  84. data/desc/ruby_version.yaml +0 -28
  85. data/desc/sandbox.yaml +0 -13
  86. data/desc/square_brackets_for.yaml +0 -22
  87. data/desc/string.yaml +0 -22
  88. data/desc/tap.yaml +0 -17
  89. data/desc/unary.yaml +0 -15
  90. data/desc/union.yaml +0 -10
  91. data/doc/zucker_doc.html +0 -3042
  92. data/lib/zucker/aliases.rb +0 -52
  93. data/lib/zucker/array.rb +0 -15
  94. data/lib/zucker/array_to_proc.rb +0 -19
  95. data/lib/zucker/binding.rb +0 -35
  96. data/lib/zucker/case.rb +0 -14
  97. data/lib/zucker/cc.rb +0 -31
  98. data/lib/zucker/class_to_proc.rb +0 -13
  99. data/lib/zucker/control.rb +0 -4
  100. data/lib/zucker/dd.rb +0 -24
  101. data/lib/zucker/debug.rb +0 -4
  102. data/lib/zucker/default.rb +0 -4
  103. data/lib/zucker/engine.rb +0 -70
  104. data/lib/zucker/enumerable.rb +0 -15
  105. data/lib/zucker/env.rb +0 -4
  106. data/lib/zucker/extensions.rb +0 -4
  107. data/lib/zucker/file.rb +0 -28
  108. data/lib/zucker/hash.rb +0 -28
  109. data/lib/zucker/hash_to_proc.rb +0 -17
  110. data/lib/zucker/info.rb +0 -193
  111. data/lib/zucker/ivars.rb +0 -29
  112. data/lib/zucker/kernel.rb +0 -42
  113. data/lib/zucker/mcopy.rb +0 -11
  114. data/lib/zucker/mm.rb +0 -41
  115. data/lib/zucker/not.rb +0 -20
  116. data/lib/zucker/object.rb +0 -4
  117. data/lib/zucker/oo.rb +0 -18
  118. data/lib/zucker/os.rb +0 -55
  119. data/lib/zucker/qq.rb +0 -13
  120. data/lib/zucker/regexp_to_proc.rb +0 -13
  121. data/lib/zucker/regexp_visualize.rb +0 -31
  122. data/lib/zucker/ruby_version.rb +0 -120
  123. data/lib/zucker/sandbox.rb +0 -17
  124. data/lib/zucker/shortcuts.rb +0 -4
  125. data/lib/zucker/string.rb +0 -55
  126. data/lib/zucker/to_proc.rb +0 -4
  127. data/lib/zucker/unary.rb +0 -25
  128. data/lib/zucker/union.rb +0 -17
  129. data/spec/aliases_spec.rb +0 -13
  130. data/spec/array_spec.rb +0 -16
  131. data/spec/array_to_proc_spec.rb +0 -12
  132. data/spec/binding_spec.rb +0 -6
  133. data/spec/case_spec.rb +0 -15
  134. data/spec/cc_spec.rb +0 -6
  135. data/spec/class_to_proc_spec.rb +0 -9
  136. data/spec/dd_spec.rb +0 -37
  137. data/spec/engine_spec.rb +0 -11
  138. data/spec/enumerable_spec.rb +0 -8
  139. data/spec/file_spec.rb +0 -46
  140. data/spec/hash_spec.rb +0 -25
  141. data/spec/hash_to_proc_spec.rb +0 -12
  142. data/spec/info_spec.rb +0 -8
  143. data/spec/ivars_spec.rb +0 -20
  144. data/spec/kernel_spec.rb +0 -42
  145. data/spec/mm_spec.rb +0 -6
  146. data/spec/not_spec.rb +0 -10
  147. data/spec/oo_spec.rb +0 -6
  148. data/spec/os_spec.rb +0 -37
  149. data/spec/qq_spec.rb +0 -19
  150. data/spec/regexp_to_proc_spec.rb +0 -9
  151. data/spec/regexp_visualize_spec.rb +0 -38
  152. data/spec/ruby_version_spec.rb +0 -55
  153. data/spec/sandbox_spec.rb +0 -14
  154. data/spec/string_spec.rb +0 -65
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f8bb75403057690cfed951ee4e2762cf1357e591
4
+ data.tar.gz: d311619cb79f5f27d0a508a730f2898f5804cdd2
5
+ SHA512:
6
+ metadata.gz: 4cb68f3789887e3840c2f1ef48c1ee4e0d67e86004b70694e326de42fa700acf21a99f68d9bbc3180bbddb583d4fb8a30ad97cc7411f38abc925ed07014d5438
7
+ data.tar.gz: 25093ae6399628b5ef854341381e33bfbb7cbc525c8382a556cb3c2ddca0135058ddcfa2be6c0029b154aa802ad2511929f564618e69474317eb5b45e7eebc23
data/CHANGELOG CHANGED
@@ -1,11 +1,26 @@
1
- 2013-04-30 | Zucker 13.1
1
+ 2014-04-01 | Zucker 100.0.0
2
+ * drop Ruby 1.8 support
3
+ * rewrite zucker to use refinements!
4
+ * use usual semantic versioning
5
+ * remove all "debug" cubes, use the "debugging" gem instead!
6
+ * remove "ruby_version" cube, use the "ruby_version" gem instead!
7
+ * remove "engine" cube, use the "ruby_engine" gem instead!
8
+ * remove "info" cube, use the "ruby_info" gem instead!
9
+ * remove "os" cube, use rdp's "os" gem instead!
10
+ * remove "*_to_proc" cubes, use the "procstar" gem instead!
11
+ * remove "sandbox" cube, since sandboxing is not recommended and removed from Ruby 2.1
12
+ * remove "kernel" and "not" cube completely
13
+ * tweaks to most other cubes
14
+
15
+
16
+ 2013-04-30 | Zucker 13
2
17
  * fix alias_for bug
3
18
  * let RubyVersion#inspect and RubyEngine#inspect map to #to_s
4
19
  * remove Array#sum
5
20
  * repackage (gh#4)
6
21
 
7
22
 
8
- 2012-01-16 | Zucker 12.1
23
+ 2012-01-16 | Zucker 12
9
24
  * fix a requiring bug
10
25
  * rename zucker/version cube to zucker/ruby_version and Zucker::PACKAGES to Zucker::PACKS
11
26
  * remove more_aliases! (keep it simple...)
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2013 Jan Lelis
1
+ Copyright (c) 2010-2014 Jan Lelis
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # Zucker [![travis](https://travis-ci.org/janlelis/zucker.png?branch=master)](https://travis-ci.org/janlelis/zucker)
2
+
3
+ Lots of small refinements to sweeten your Ruby code. See http://rubyzucker.info for more documentation.
4
+
5
+ ## Example
6
+
7
+ require 'zucker/camel_snake'
8
+ using Zucker::CamelSnake
9
+ 'was_snake_string'.to_camel # => 'WasSnakeString'
10
+ 'WasCamelString'.to_snake # => 'was_camel_string'
11
+
12
+ ## Changes
13
+
14
+ Missing former functionality? It might have been extracted to separate gems:
15
+
16
+ * [debugging](https://github.com/janlelis/debugging)
17
+ * [procstar](https://github.com/janlelis/procstar)
18
+ * [ruby_info](https://github.com/janlelis/ruby_info)
19
+ * [ruby_version](https://github.com/janlelis/ruby_version)
20
+ * [ruby_engine](https://github.com/janlelis/ruby_engine)
21
+
22
+ Copyright (c) 2010-2014 Jan Lelis | http://janlelis.de | Released under the MIT license
data/Rakefile CHANGED
@@ -1,33 +1,31 @@
1
- require 'rspec/core/rake_task'
2
1
  require 'fileutils'
3
-
4
2
  require File.dirname(__FILE__) + '/lib/zucker'
5
3
 
6
- @path = Rake.application.find_rakefile_location[1]
4
+ $path = Rake.application.find_rakefile_location[1]
7
5
 
8
- desc 'Build documentation'
9
- task 'doc' do
10
- ruby File.join(@path, 'doc/zucker_doc.rb'), @path
6
+ def gemspec
7
+ @gemspec ||= eval(File.read( File.join($path, 'zucker.gemspec') ), binding, 'zucker.gemspec')
11
8
  end
12
9
 
10
+ ## SPEC
11
+
13
12
  task 'default' => 'spec'
14
- task 'test' => 'spec'
15
- RSpec::Core::RakeTask.new('spec') do |t|
16
- t.ruby_opts = "-r " + File.join(@path, 'spec', 'spec_helper')
17
- t.rspec_opts = ["--color", "--format documentation"]
13
+ task 'test' => 'spec'
18
14
 
19
- if RUBY_VERSION < '1.9'
20
- t.pattern = File.join(@path, 'spec', '*_spec.rb')
21
- else
22
- t.pattern = File.join(@path, 'spec', '*.rb')
23
- end
15
+ desc 'Run Spec'
16
+ task 'spec' do
17
+ sh %[rspec spec]
24
18
  end
25
19
 
26
- # gem
27
- def gemspec
28
- @gemspec ||= eval(File.read( File.join(@path, 'zucker.gemspec') ), binding, 'zucker.gemspec')
20
+ ## DOC
21
+
22
+ desc 'Build documentation'
23
+ task 'doc' do
24
+ ruby File.join($path, 'doc/create_documentation.rb'), $path
29
25
  end
30
26
 
27
+ ## BUILD
28
+
31
29
  desc "Build the gem"
32
30
  task :gem => :gemspec do
33
31
  sh "gem build zucker.gemspec"
@@ -37,49 +35,10 @@ end
37
35
 
38
36
  desc "Install the gem locally"
39
37
  task :install => :gem do
40
- sh %{gem install pkg/#{gemspec.name}-#{gemspec.version} --no-rdoc --no-ri}
38
+ sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}.gem --no-rdoc --no-ri}
41
39
  end
42
40
 
43
41
  desc "Validate the gemspec"
44
42
  task :gemspec do
45
43
  gemspec.validate
46
44
  end
47
-
48
- # release
49
- desc 'run specs, build doc, bump version, set date and add these changes to git'
50
- task 'prepare_release' => %w[spec] do # run specs
51
- # really want to release?
52
- print 'Do you really want to release? ...then enter release: '
53
- exit if $stdin.gets.chomp != 'release'
54
-
55
- # bump version and date
56
- require 'date'
57
- zucker_rb = File.read('lib/zucker.rb')
58
- zucker_rb.sub! /VERSION\s*=\s*'(\d+)\.(\d+)'$/ do
59
- if $2 == current_year = Date.today.strftime('%y')
60
- @v = "#$2.#{$1.to_i + 1}"
61
- else
62
- @v = "#{current_year}.1"
63
- end
64
- "VERSION = '#{@v}'"
65
- end
66
- zucker_rb.sub! /DATE\s*=.*$/, "DATE = '#{Date.today}'"
67
- File.open 'lib/zucker.rb','w' do |f| f.write zucker_rb end
68
-
69
- system 'rake doc'
70
-
71
- # add changes to git and tag
72
- system 'git add .'
73
- system "git commit -m 'Zucker #@v'"
74
- system "git tag -a v#@v -m 'Zucker #@v'"
75
-
76
- # done
77
- puts "prepared Zucker #@v gem release"
78
- end
79
-
80
- desc 'prepare_release, build gem, and push it to git and display rubygems push command'
81
- task 'release' => %w[gem] do
82
- system 'git push origin master'
83
- system 'git push origin master --tags'
84
- puts "gem push pkg/zucker-#{ Zucker::VERSION }.gem"
85
- end
@@ -1,21 +1,22 @@
1
- # Ruby 1.9, encoding: utf-8
1
+ # encoding: utf-8
2
2
  # creates the documentation for Zucker
3
3
 
4
4
  require 'yaml'
5
5
  require 'coderay'
6
6
 
7
+ require_relative '../lib/zucker/camel_snake'
8
+ using Zucker::CamelSnake
9
+
10
+
7
11
  class ZuckerDoc
8
- ORDER = %w|summary why methods info spec source versions discussion|
12
+ ORDER = %w|summary use methods info spec source|
9
13
  DESCRIPTIONS = {
10
14
  'summary' => 'Summary',
11
- 'why' => 'Why?',
12
- 'methods' => 'Methods/Usage',
15
+ 'use' => 'Activate',
16
+ 'methods' => 'Usage',
13
17
  'info' => 'Information',
14
18
  'spec' => 'Specification',
15
19
  'source' => 'Source',
16
- 'versions' => 'Compatibility',
17
- 'authors' => 'Authors',
18
- 'discussion' => 'Discussion',
19
20
  }
20
21
 
21
22
 
@@ -24,7 +25,6 @@ class ZuckerDoc
24
25
  @path = path
25
26
 
26
27
  # get version / date
27
- require File.join( @path, 'lib/zucker' )
28
28
  @version = Zucker::VERSION
29
29
  @date = Zucker::DATE
30
30
 
@@ -42,26 +42,11 @@ class ZuckerDoc
42
42
  end
43
43
  end
44
44
 
45
- # build package list
46
- @packs = Zucker::PACKS.map{ |pkg, _|
47
- descriptions = {
48
- :env => 'Cubes for collecting information.',
49
- :to_proc => 'Adds some ⇧to_proc⇧ extensions to use with ⇧&amp;⇧.',
50
- :object => 'Extensions for ⇧Object⇧.',
51
- :debug => 'Print debugging tools.',
52
- :extensions => 'More extensions for Ruby base classes.',
53
- :control => 'Cubes that change program behaviour.',
54
- :shortcuts => 'Cubes that save you keystrokes or disambiguate things.',
55
- }
56
- %{ <li><a href="##{pkg}" style="text-decoration:none;font-weight:bold;">#{pkg}</a>: #{ descriptions[pkg] }</li> }
57
- }.join "\n"
58
-
59
-
60
- # collect description files and turn them to html
61
- cubes = Dir[ File.join(path, 'desc', '*.yaml') ].inject({}) do |res, cube_file; a|
45
+ # collect description files and turn them into html
46
+ @cubes = Dir[ File.join(path, 'doc', 'desc', '*.yaml') ].inject({}) do |res, cube_file; a|
62
47
  begin
63
48
  a = YAML.load_file cube_file
64
- rescue
49
+ rescue
65
50
  warn "Could not load the yaml file for #{ cube_file }"
66
51
  end
67
52
  if a.instance_of? Hash
@@ -69,61 +54,38 @@ class ZuckerDoc
69
54
  else
70
55
  res
71
56
  end
72
- end
73
-
74
- output_path = File.join(path, 'doc', 'zucker_doc.html')
75
-
76
- @cubes = Zucker::PACKS.map{ |pkg_name, cube_names|
77
- package pkg_name, cubes.select{|name, _| cube_names.include?( name ) }
78
- }.join
57
+ end.sort.map{ |name, hash| cube name, hash }.join
79
58
 
80
- result = DATA.read
81
-
82
- # substitute vars
83
- result.gsub! /\.\.([a-z]+)\.\./i do eval "@#$1" end
84
- # code needs to be codish ;)
85
- result.gsub! /⇧(.+?)⇧/, '<code>\1</code>'
86
- # strong
87
- result.gsub! /●(.+?)●/, '<strong>\1</strong>'
88
- # hyper→links
89
- result.gsub! /→(.+?)→(.+?)→/, '<a href="\2">\1</a>'
90
-
91
- File.open output_path, 'w' do |file|
92
- file.puts result
93
- end
59
+ output_path = File.join(path, 'doc', 'zucker.html')
60
+ template = DATA.read
61
+ template.gsub! /\.\.([a-z]+)\.\./i do eval "@#$1" end # substitute vars
62
+ template.gsub! /⇧(.+?)⇧/, '<code>\1</code>'
63
+ template.gsub! /●(.+?)●/, '<strong>\1</strong>'
64
+ template.gsub! /→(.+?)→(.+?)→/, '<a href="\2">\1</a>'
65
+ File.open(output_path, 'w'){ |file| file.puts(template) }
94
66
 
95
67
  puts "Created Zucker documentation at #{File.expand_path(output_path)}"
96
68
  end
97
69
 
98
- protected
99
-
100
- def package(name, cubes)
101
- cube_html = cubes.sort.map{ |name, hash|
102
- cube name, hash
103
- }.join
104
-
105
- %{
106
- <h2 title="require 'zucker/#{name}'" id="#{name}">Cubes[#{name}]</h2>
107
- #{ %q|<p class="text">(not included by <code>require 'zucker/default'</code>)</p>| if name == :debug }
108
- <div class="cubes">
109
- #{cube_html}
110
- </div> }
111
- end
70
+ private
112
71
 
113
72
  def cube(name, hash)
114
73
  @cube_name = name
115
- %{ <h3 title="require 'zucker/#{name}'" id="#{name}">#{name}</h3>
74
+ %{ <div class="cubes"><h3 title="require 'zucker/#{name}'" id="#{name}">#{name}</h3>
116
75
  <table class="cube_table"
117
76
  id="#{ name }_cube"
118
77
  title="require 'zucker/#{name}'"> } +
119
78
 
120
79
  ORDER.map{ |th|
121
- if %w|spec source discussion|.include?(th) || td = hash[th]
80
+ if %w|spec use source|.include?(th) || td = hash[th]
122
81
  "<tr><th>#{ DESCRIPTIONS[th] }</th>" +
123
- " <td>#{ send th, td }</td></tr>"
82
+ " <td>#{ send th, td || name }</td></tr>"
124
83
  end
125
- }.join +
126
- '</table>'
84
+ }.join + '</table></div>'
85
+ end
86
+
87
+ def use(n)
88
+ "<div class=\"using source\" style=\"display:block\">#{ syntax_highlight "using Zucker::#{n.to_camel}" }</div>"
127
89
  end
128
90
 
129
91
  def methods(m)
@@ -137,33 +99,10 @@ class ZuckerDoc
137
99
  i.map{|e|convert_html_chars e}.join '<br/>'
138
100
  end
139
101
 
140
- def authors(a)
141
- a.map{ |author|
142
- author +
143
- ( (tmp = @meta[author]) ? " | #{ tmp }" : '' )
144
- }.join '<br/>'
145
- end
146
-
147
- def why(w)
148
- if w.is_a? Array
149
- w.map{|e| "<p>#{convert_html_chars e}</p>"}.join
150
- else
151
- convert_html_chars w
152
- end
153
- end
154
-
155
102
  def summary(s)
156
103
  convert_html_chars s
157
104
  end
158
105
 
159
- def versions(v)
160
- v.join ', '
161
- end
162
-
163
- def discussion(_)
164
- "→github wiki→http://wiki.github.com/janlelis/zucker/#{@cube_name}→"
165
- end
166
-
167
106
  def spec(_)
168
107
  source_helper(:spec, File.join( @path, 'spec/' ), '_spec')
169
108
  end
@@ -188,12 +127,10 @@ class ZuckerDoc
188
127
  end
189
128
 
190
129
  def syntax_highlight(string)
191
- #convert_html_chars
192
130
  CodeRay.scan(string, :ruby).div
193
131
  end
194
132
 
195
133
  def replace_html_special_chars(string)
196
- # remove html special chars
197
134
  string.gsub( /&/, '&amp;' ).
198
135
  gsub( /</, '&lt;' ).
199
136
  gsub( />/, '&gt;' )
@@ -222,7 +159,7 @@ __END__
222
159
  <head>
223
160
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
224
161
 
225
- <title>Ruby Zucker ..version..</title>
162
+ <title>Ruby Zucker</title>
226
163
  <script type="text/javascript">
227
164
  var show = function(snippet){
228
165
  document.getElementById( snippet ).style.display = 'block'
@@ -498,48 +435,49 @@ table.source td { padding: 2px 4px; vertical-align: top; }
498
435
  <body>
499
436
  <div id="world">
500
437
  <img class="rubylogo" alt="ruby" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAADAVgAAwFYBgeEOVwAAAAd0SU1FB9oIHxY1C2ozXR0AABglSURBVGjevZt/sGVVdec/a+9z7q/3o1830N00DQiCQkoQiPgj0UiG8UcyMZNSC82PkdIEqYlaISkTMTPlVEw5IdHRqKEURQ2JSZwaiYijJimnxohMVH42Aml+2dD9ul//fP1+9Lv3nnP23mv+2Puce25DTOI4dtepe+5+7913vnut9V1rfdd+wo/wn/cea+3UWlBFIFfVDOdCsbi/Gj7+CMWePRQH9lEsLlItLjLav0h1fAX1ivqKUDq08njnkNKzYZXDsyb86qoH4KNzXd6xXjztGbIfBdAQAsYYjDFT66q6E7gQeJWIBDXmmKpfN1k2kl4P040X3S6m08FYIyH4TBEQASMYhGGOGWY4CSx+fC5fqZD971gv9gH8wVyHd6+XPxrAJwMVEVR1AFwBnFsdWrrKrSy/TIcbSJ6Tb9tBftpWqiNHML0uptfH9vqYfh/b7+OzHPUBSZ9Ziae0gaGBwggKKBBU7vvAfOfDTuW+69eLBwDes9DjvStj5P8n0JOs+VzgZzcevP9la//wjZ8qnnjslHLP41QH9irjITbLpXP6TmZf+BJmf+Z1VBtjhg/uojx4kGJxkWJxL+X+RdzKKq5yjIoNxtWYEaqViJQqWolIpUZLRBxQij7shPf8l9XyVoDfme/8cAGrKiKTj6zKcpDl+U8A7167+1vP3vvhG7aNdj/UC8cOEdbWMYoai1gBAyoByXoZg4svZ+t7P0i1NuTEvXdTHDigxYH94pYO6OqeJ2Rt9RhOHUHRUkQqIsgK0VKNVBDBo1RC4eGX3rda/PUP1aVDCA1Y59yCMea/icjri4MHOrve/PrOxv13GQkBVLGgYkUUEQXUgBURmyk+KBv3/gMrf34TZ/zxZwiuUn9iXdzanD716INSrq8hB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ORh5OJBTLygTkM87ImwatCRq6QqKi2LUp0LGuq+vonf5M46LefU3VIQyLKMhZkeric8ZUYsmYKjUrJCyQn1lKJURnGiOIFKFIfiUYLRqHyaCLxjLF2b07U5eadL3u9CJ9Ptc1v4xfNfQifLOV6O1piZW52uZoG/ODXPV6v8fU75ba2rVGkOzUgQ6JdeTx15PCDZrGK7ErQSL46gHi+OgMPjpyorL0KwBnILJvKAikzYfbJVqGpsKDCSiSFDyEwkr44YcolAOyajI5aOzehkGXmWkWU53Syn2+nR73TZ8CW7jjx555b+/Btf+eAji41Lf2Khxy8fHVcf35S9TxDv0OtrsAGadLPWMZwy8ipiRaRDSB7QWDlNEppzW5nBpRaN1pRSRJrTc4a6AZaUS9NWCzj1VJL0+jCp3NLw7JCiB71yyAoHBzY/ONvpL83nvY3Ngzl/6sy8O212i7/49HOXrvnmnUeeZuEb5/u8bW3EJxf6vTXPC7yRLwV0QacUfmGu8n77EKvdzSGok4CXoA5PRRBPYQNlZmL8Szrkrc80cdSYN+EYsFeERZB9Jt7vG6s/DuriX+Roc25FwVkRZ0QKIzLOxIy7WTae6wzGb3jyUPlPnb96/2kZv33ETT/Hn8z3efvaCIA/2tSfVfQFCq9T5OeAs1SQTNGz1jOv+SAvpaKUSivjjnqjh73RIwqHgSMicgg4AqwIsiawboQ1i1nvYlaPhaLITdQB4iVqjYQuJsxl3XCwOqEztsfFM9u4/MlH/3V/YfOW/4T59Pue8Wv/F9jGEQFesRfqAAAAAElFTkSuQmCC" />
501
- <h1>Ruby Zucker ..version..</h1>
502
- <h2 style="clear:both">What is it?</h2>
503
- <p class="text">Zucker (<a href="http://www.forvo.com/word/zucker/">pronunciation</a>) is the German word for sugar. It adds syntactic sugar in the form of independent, small scripts that make Ruby even more sweet. It adds a lot of useful helper methods for an improved readability and usage of your every-day Ruby code. Almost every Zucker feature comes with specs. Everything is documented on this page. The source is available at <a href="http://github.com/janlelis/zucker">github</a>.</p>
504
-
505
- <h2>Install</h2>
506
- <p class="text">
507
- <code class="scode">gem install zucker --no-rdoc --no-ri # might need sudo</code>
508
- </p>
509
- <h3 style="padding-left:1.3em">Quickstart</h3>
510
- <p class="text">
511
- <code class="scode">require 'zucker/all'</code>
512
- </p>
513
- <h2>Usage / organisation</h2>
514
- <p class="text">The gem consists of many small snippets, called <em>cubes</em>, which are bundled in <em>packs</em>. Since there aren't any dependencies within the gem, you can easily require only the packs or cubes you want:
515
- <code class="scode">require 'zucker/cube_or_pack_name'</code>
516
- </p>
517
- <h3 style="padding-left:1.3em">Packs</h3>
518
- <ul class="text">
519
- ..packs..
520
- </ul>
521
- <p class="text">
522
- Furthermore, there are two meta packs available: <strong>all</strong> simply requires all cubes and <strong>default</strong> requires all cubes except <strong>debug</strong>.</p>
523
-
524
- <h3 style="padding-left:1.3em">Overview: Which methods and constants are added directly to the global namespace by the <em>default</em> pack?</h3>
525
- <p class="text">
526
-
527
- <code class="scode">Info, RubyVersion, RubyEngine, OS, Infinity, NaN, alias_for, aliases_for, egonil, nn, iterate, instance_variables_from, ivars, activate_warnings!, deactivate_warnings!, executed_directly?, directly_executed?, standalone?, library?, ignore_sigint!, ignore_sigquit!, sandbox, tap_on, make_new, (blank?, present?, mcopy)</code>
528
- </p>
529
-
530
- ..cubes..
531
-
532
- <h2>Changelog</h2>
438
+ <h1>Ruby Zucker</h1>
439
+ <br/>
440
+ <p class="text">Zucker adds syntactic sugar in the form of independent, small scripts that sweeten Ruby even more. It is completely based on Ruby's <a href="#123">refinements</a> feature. You can actively choose for each source file, which features to include. If your Ruby version does not support refinements, plain old core extensions will be used. The source code is available at <a href="https://github.com/janlelis/zucker">github</a>.</p>
441
+
442
+ <h2>Install</h2>
443
+ <p class="text">
444
+ <code class="scode">$ gem install zucker</code>
445
+ Or in your Gemfile:
446
+ <code class="scode">gem 'zucker', require: 'zucker/all'</code>
447
+ </p>
448
+
449
+ <h2>Usage / Organization</h2>
450
+ <p class="text">
451
+ <code class="scode">require 'zucker/all'</code>
452
+ </p>
453
+
454
+ <p class="text">
455
+ Choose which refinements (<em>sugar cubes</em>) you want to use in this Ruby file:
533
456
  <div class="cubes">
534
- <pre class="scode">..changelog..</pre>
457
+ <pre class="scode">using Zucker::CamelSnake
458
+ using Zucker::HashExtras
459
+
460
+ "ClassName".to_snake # => "class_name"
461
+ Hash.zip [1,2,3], [4,5,6] # => {1=>4, 2=>5, 3=>6}</pre>
535
462
  </div>
536
- <br/>
463
+ </p>
464
+
465
+ <h2>Refinements</h2>
466
+
467
+ ..cubes..
468
+
469
+ <h2>Changelog</h2>
470
+ <div class="cubes">
471
+ <pre class="scode">..changelog..</pre>
537
472
  </div>
473
+ <br/>
474
+ </div>
475
+
538
476
  <div id="foot">
539
- <div id="smile"><a href="http://rbjl.net">J-_-L</a></div>
477
+ <div id="smile"><a href="http://janlelis.de">J-_-L</a></div>
540
478
  This is the Ruby Zucker ..version.. documentation (..date..).
541
- The current version is always available at <a href="http://rubyzucker.info">rubyzucker.info</a>.
542
- Source at <a href="http://github.com/janlelis/zucker">github</a>.
479
+ The current documentation is always available at <a href="http://rubyzucker.info">rubyzucker.info</a>.
480
+ Source at <a href="https://github.com/janlelis/zucker">github</a>.
543
481
  Ruby Logo CC-BY-SA Yukihiro Matsumoto.
544
482
  </div>
545
483