usaidwat 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/usaidwat +4 -11
- data/lib/usaidwat/version.rb +1 -1
- data/lib/usaidwat.rb +0 -7
- data/spec/utils_spec.rb +9 -0
- data/usaidwat.gemspec +2 -1
- metadata +19 -6
data/bin/usaidwat
CHANGED
@@ -4,24 +4,17 @@ require 'usaidwat'
|
|
4
4
|
require 'usaidwat/utils'
|
5
5
|
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
def die(code=1)
|
11
|
-
$stderr.puts VERSION
|
12
|
-
$stderr.puts USAGE
|
7
|
+
def die(code=1, stream=STDERR)
|
8
|
+
stream.puts "Usage: #{File.basename $0} <user> [<subreddit>]"
|
13
9
|
exit code
|
14
10
|
end
|
15
11
|
|
16
12
|
die if ARGV.length < 1 or ARGV.length > 2
|
17
13
|
|
18
|
-
if ARGV.first == '--help'
|
19
|
-
puts USAGE
|
20
|
-
exit 0
|
21
|
-
end
|
14
|
+
die(0, STDOUT) if ARGV.first == '--help' || ARGV.first == '-h'
|
22
15
|
|
23
16
|
if ARGV.first == '--version' or ARGV.first == '-V'
|
24
|
-
puts VERSION
|
17
|
+
puts "usaidwat v#{USaidWat::VERSION}"
|
25
18
|
exit 0
|
26
19
|
end
|
27
20
|
|
data/lib/usaidwat/version.rb
CHANGED
data/lib/usaidwat.rb
CHANGED
data/spec/utils_spec.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
2
|
+
require 'usaidwat/utils'
|
3
|
+
|
4
|
+
describe 'USaidWat::Array' do
|
5
|
+
it 'should return the longest string from a list of tuples' do
|
6
|
+
list = [['Short Name', 0], ['Really Long Name', 1], ['Medium Name', 2]]
|
7
|
+
list.longest_subreddit.should == 'Really Long Name'
|
8
|
+
end
|
9
|
+
end
|
data/usaidwat.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = USaidWat::VERSION
|
8
8
|
s.authors = ["Michael Dippery"]
|
9
9
|
s.email = ["michael@monkey-robot.com"]
|
10
|
-
s.homepage = ""
|
10
|
+
s.homepage = "https://github.com/mdippery/usaidwat"
|
11
11
|
s.summary = %q{Answers the age-old question, "Where does a Redditor comment the most?"}
|
12
12
|
s.description = %q{View a user's last 100 Reddit comments, organized by subreddit.}
|
13
13
|
|
@@ -19,4 +19,5 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
21
|
s.add_runtime_dependency 'json', '>= 1.6.5'
|
22
|
+
s.add_development_dependency 'rspec', '~> 2.8.0'
|
22
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: usaidwat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-04-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
16
|
-
requirement: &
|
16
|
+
requirement: &70203417820260 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,18 @@ dependencies:
|
|
21
21
|
version: 1.6.5
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70203417820260
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rspec
|
27
|
+
requirement: &70203417819740 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.8.0
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70203417819740
|
25
36
|
description: View a user's last 100 Reddit comments, organized by subreddit.
|
26
37
|
email:
|
27
38
|
- michael@monkey-robot.com
|
@@ -39,8 +50,9 @@ files:
|
|
39
50
|
- lib/usaidwat/reddit.rb
|
40
51
|
- lib/usaidwat/utils.rb
|
41
52
|
- lib/usaidwat/version.rb
|
53
|
+
- spec/utils_spec.rb
|
42
54
|
- usaidwat.gemspec
|
43
|
-
homepage:
|
55
|
+
homepage: https://github.com/mdippery/usaidwat
|
44
56
|
licenses: []
|
45
57
|
post_install_message:
|
46
58
|
rdoc_options: []
|
@@ -64,4 +76,5 @@ rubygems_version: 1.8.11
|
|
64
76
|
signing_key:
|
65
77
|
specification_version: 3
|
66
78
|
summary: Answers the age-old question, "Where does a Redditor comment the most?"
|
67
|
-
test_files:
|
79
|
+
test_files:
|
80
|
+
- spec/utils_spec.rb
|