httpattack-lib 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,5 +3,5 @@ $LOAD_PATH.unshift File.dirname(__FILE__)
3
3
  require 'httpattack/items'
4
4
 
5
5
  module HTTPAttack
6
- VERSION = '0.2.0'
6
+ VERSION = '0.2.1'
7
7
  end
@@ -39,6 +39,20 @@ module HTTPAttack
39
39
  @stats = self.reload_stats(*args)
40
40
  end
41
41
 
42
+ #
43
+ # Class info methods (some basic defaults).
44
+ #
45
+
46
+ class << self
47
+ def name
48
+ self.to_s.split('::').last
49
+ end
50
+
51
+ def desc
52
+ 'A basic item.'
53
+ end
54
+ end # self
55
+
42
56
  end # Base
43
57
 
44
58
  end # Items
@@ -20,6 +20,13 @@ module HTTPAttack
20
20
  URI.parse("http://github.com/api/v2/json/user/show/#{@username}").to_s
21
21
  end
22
22
 
23
+ # Class info methods.
24
+ class << self
25
+ def desc
26
+ 'The social power of code.'
27
+ end
28
+ end # self
29
+
23
30
  end # Github
24
31
 
25
32
  end # Items
@@ -27,6 +27,13 @@ module HTTPAttack
27
27
  URI.parse("http://#{@options[:api_root]}/users/show/#{@username}.json").to_s
28
28
  end
29
29
 
30
+ # Class info methods.
31
+ class << self
32
+ def desc
33
+ 'Open Source microblogging software.'
34
+ end
35
+ end # self
36
+
30
37
  end # StatusNet
31
38
 
32
39
  end # Items
@@ -20,6 +20,13 @@ module HTTPAttack
20
20
  URI.parse("http://twitter.com/users/show/#{@username}.json").to_s
21
21
  end
22
22
 
23
+ # Class info methods.
24
+ class << self
25
+ def desc
26
+ 'Even your mom is on Twitter.'
27
+ end
28
+ end # self
29
+
23
30
  end # Twitter
24
31
 
25
32
  end # Items
@@ -47,4 +47,14 @@ describe Base do
47
47
  @item.stat
48
48
  end.should raise_error(HTTPAttack::Items::MustOverrideMethod)
49
49
  end
50
+
51
+ describe 'class info methods' do
52
+ it 'should have a default name' do
53
+ Base.name.should == 'Base'
54
+ end
55
+
56
+ it 'should have a default description' do
57
+ Base.desc.should_not be_empty
58
+ end
59
+ end
50
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpattack-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Campbell