ruby-nuggets 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to ruby-nuggets version 0.4.1
5
+ This documentation refers to ruby-nuggets version 0.4.2
6
6
 
7
7
 
8
8
  == DESCRIPTION
data/Rakefile CHANGED
@@ -18,3 +18,13 @@ Hen.lay! {{
18
18
  :extra_files => FileList['[A-Z]*'].to_a
19
19
  }
20
20
  }}
21
+
22
+ desc "Run all examples"
23
+ task :examples do
24
+ ruby = "#{Config::CONFIG['RUBY_INSTALL_NAME']}#{Config::CONFIG['EXEEXT']}"
25
+
26
+ Dir['lib/nuggets/*/**/*.rb'].each { |file|
27
+ puts ">>>>> #{file} <<<<<"
28
+ system(ruby, '-I', 'lib', file)
29
+ }
30
+ end
@@ -37,8 +37,7 @@ class Hash
37
37
  def only(relax = size == 1, split = false)
38
38
  raise IndexError, 'not a single-element hash' unless relax
39
39
 
40
- return *first if split
41
- first
40
+ split ? Array(*first) : first
42
41
  end
43
42
 
44
43
  # call-seq:
@@ -1,2 +1,2 @@
1
1
  # whatever you prefer to call it...
2
- require 'nuggets/singleton_class'
2
+ require 'nuggets/object/singleton_class'
@@ -1,2 +1,2 @@
1
1
  # whatever you prefer to call it...
2
- require 'nuggets/singleton_class'
2
+ require 'nuggets/object/singleton_class'
@@ -1,2 +1,2 @@
1
1
  # whatever you prefer to call it...
2
- require 'nuggets/singleton_class'
2
+ require 'nuggets/object/singleton_class'
@@ -1,2 +1,2 @@
1
1
  # whatever you prefer to call it...
2
- require 'nuggets/singleton_class'
2
+ require 'nuggets/object/singleton_class'
@@ -1,2 +1,2 @@
1
1
  # whatever you prefer to call it...
2
- require 'nuggets/singleton_class'
2
+ require 'nuggets/object/singleton_class'
@@ -51,7 +51,7 @@ class String
51
51
  #
52
52
  # Destructive version of #msub.
53
53
  def msub!(*substitutions)
54
- substitutions = *substitutions # Handle hashes and arrays alike
54
+ substitutions = substitutions.first if substitutions.first.is_a?(Hash)
55
55
  keys, subs, cache = [], [], {}
56
56
 
57
57
  substitutions.each { |key, value|
@@ -77,6 +77,6 @@ if $0 == __FILE__
77
77
  p s.gsub(/a/, 'o').gsub(/o/, 'a')
78
78
  p s.msub('a' => 'o', 'o' => 'a')
79
79
 
80
- s.msub!('a' => 'o','o' => 'a')
80
+ s.msub!('a' => 'o', 'o' => 'a')
81
81
  p s
82
82
  end
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  #--
2
4
  ###############################################################################
3
5
  # #
@@ -4,7 +4,7 @@ module Nuggets
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 4
7
- TINY = 1
7
+ TINY = 2
8
8
 
9
9
  class << self
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-nuggets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Wille
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-16 00:00:00 +01:00
12
+ date: 2009-01-22 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -90,11 +90,11 @@ homepage: http://prometheus.rubyforge.org/ruby-nuggets
90
90
  post_install_message:
91
91
  rdoc_options:
92
92
  - --line-numbers
93
+ - --main
94
+ - README
93
95
  - --inline-source
94
96
  - --title
95
97
  - ruby-nuggets Application documentation
96
- - --main
97
- - README
98
98
  - --charset
99
99
  - UTF-8
100
100
  - --all