ben_string 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
File without changes
@@ -1,5 +1,15 @@
1
1
  # ben_string Changelog
2
2
 
3
+ ### 1.2.0 / 2011-03-01
4
+
5
+ * Add BenString.in_use? to detect whether there are any BenStrings in
6
+ use (Nathan Witmer)
7
+ * Thorough fisting, courtesy of Aaron Patterson
8
+ * clean up and clarify version constant
9
+ * general spacing cleanupo
10
+
11
+ This changelog message thoroughly not reviewed by Ryan Davis.
12
+
3
13
  ### 1.1.0 / 2010-11-17
4
14
 
5
15
  * clean up formatting (John Barnette)
data/README.md CHANGED
@@ -20,13 +20,17 @@ Awesomeness.
20
20
 
21
21
  ## CONTRIBUTORS:
22
22
 
23
+ * [Aaron Patterson][tenderlove]
23
24
  * [John Barnette][jbarnette]
24
25
  * [Leigh Caplan][texel]
26
+ * [Nathan Witmer][aniero]
25
27
  * [Yossef Mendelssohn][ymendel]
26
28
 
29
+ [tenderlove]: http://github.com/tenderlove
27
30
  [jbarnette]: http://github.com/jbarnette
28
- [ymendel]: http://github.com/ymendel
29
31
  [texel]: http://github.com/texel
32
+ [aniero]: http://github.com/aniero
33
+ [ymendel]: http://github.com/ymendel
30
34
 
31
35
  ## LICENSE:
32
36
 
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'rubygems'
2
2
  require 'hoe'
3
3
 
4
+ Hoe.plugin :doofus, :git, :seattlrb
5
+
4
6
  Hoe.spec 'ben_string' do
5
7
  developer 'Ben Bleything', 'ben@bleything.net'
6
8
 
@@ -1,14 +1,48 @@
1
1
  class BenString < String
2
- VERSION = '1.1.0'
2
+ module Version
3
+ # FIXME: Refactor this to be read from a YAML file
4
+ MAJOR = 1
5
+ MINOR = 2
6
+ BUGFX = 0
3
7
 
4
- public
5
-
6
- def to_bool()
7
- !!self
8
+ class << self
9
+ def version(sep = '.')
10
+ return [MAJOR, MINOR, BUGFX].join(sep)
11
+ end
8
12
  end
9
13
 
10
- def to_ben_s()
14
+ VERSION = ::BenString::Version.version.freeze
15
+ end
16
+
17
+ include Version
18
+ # Workaround for Hoe
19
+ # VERSION = '1.2.0'
20
+
21
+ class << self
22
+ public
23
+ def in_use?
24
+ counts = Hash.new(0)
25
+ ObjectSpace.each_object { |o| counts[o.class] += 1 }
26
+ counts[self] > 0
27
+ end
28
+ end
29
+
30
+ public
31
+
32
+ def to_bool( )
33
+ return !!self
34
+ end
35
+ def to_ben_s()
11
36
  return self
12
37
  end
13
-
14
38
  end
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
@@ -11,4 +11,15 @@ class TestBenString < Test::Unit::TestCase
11
11
  str = BenString.new
12
12
  assert_equal str, str.to_ben_s
13
13
  end
14
+
15
+ def test_not_in_use
16
+ GC.start
17
+ assert !BenString.in_use?
18
+ end
19
+
20
+ def test_in_use
21
+ str = BenString.new
22
+ assert BenString.in_use?
23
+ end
24
+
14
25
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ben_string
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
- prerelease: false
4
+ hash: 31
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 1.1.0
10
+ version: 1.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ben Bleything
@@ -15,41 +15,25 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-17 00:00:00 -08:00
18
+ date: 2011-03-01 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: rubyforge
22
+ name: hoe
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- hash: 7
29
+ hash: 41
30
30
  segments:
31
31
  - 2
32
- - 0
33
- - 4
34
- version: 2.0.4
32
+ - 9
33
+ - 1
34
+ version: 2.9.1
35
35
  type: :development
36
36
  version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: hoe
39
- prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 19
46
- segments:
47
- - 2
48
- - 6
49
- - 2
50
- version: 2.6.2
51
- type: :development
52
- version_requirements: *id002
53
37
  description: It's my special string.
54
38
  email:
55
39
  - ben@bleything.net
@@ -66,6 +50,7 @@ files:
66
50
  - Rakefile
67
51
  - lib/ben_string.rb
68
52
  - test/test_ben_string.rb
53
+ - .gemtest
69
54
  has_rdoc: true
70
55
  homepage: http://github.com/bleything/ben_string
71
56
  licenses: []
@@ -97,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
82
  requirements: []
98
83
 
99
84
  rubyforge_project: ben_string
100
- rubygems_version: 1.3.7
85
+ rubygems_version: 1.4.2
101
86
  signing_key:
102
87
  specification_version: 3
103
88
  summary: It's my special string.