urban 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +10 -2
- data/HISTORY.rdoc +33 -18
- data/Manifest.txt +25 -0
- data/README.rdoc +16 -15
- data/Rakefile +14 -31
- data/bin/urban +1 -1
- data/lib/urban.rb +4 -1
- data/lib/urban/cli.rb +64 -74
- data/lib/urban/dictionary.rb +11 -11
- data/lib/urban/web.rb +27 -15
- data/script/test +10 -0
- data/test/fixtures/impromptu.html +1039 -0
- data/test/{data → fixtures}/missing.html +0 -0
- data/test/fixtures/screens/definition.txt +5 -0
- data/test/fixtures/screens/definition_with_url.txt +7 -0
- data/test/fixtures/screens/definitions.txt +9 -0
- data/test/fixtures/screens/help.txt +19 -0
- data/test/fixtures/screens/invalid_option_error.txt +2 -0
- data/test/fixtures/screens/missing_phrase_error.txt +1 -0
- data/test/fixtures/screens/no_internet_error.txt +1 -0
- data/test/test_helper.rb +27 -20
- data/test/urban/cli_test.rb +77 -135
- data/test/urban/dictionary_test.rb +29 -19
- data/test/urban/web_test.rb +27 -45
- metadata +113 -102
- data/.gitignore +0 -26
- data/Gemfile +0 -4
- data/lib/urban/version.rb +0 -3
- data/test/data/impromptu.html +0 -463
- data/test/minitest/stop_light.rb +0 -57
- data/urban.gemspec +0 -25
data/test/minitest/stop_light.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
class MiniTest::StopLight
|
2
|
-
ESC = "\e["
|
3
|
-
NND = "#{ESC}0m"
|
4
|
-
|
5
|
-
attr_reader :io
|
6
|
-
|
7
|
-
def initialize io
|
8
|
-
@io = io
|
9
|
-
end
|
10
|
-
|
11
|
-
def red str
|
12
|
-
normal_color(31, str)
|
13
|
-
end
|
14
|
-
|
15
|
-
def yellow str
|
16
|
-
normal_color(33, str)
|
17
|
-
end
|
18
|
-
|
19
|
-
def green str
|
20
|
-
normal_color(32, str)
|
21
|
-
end
|
22
|
-
|
23
|
-
def normal_color(color_code, str)
|
24
|
-
"#{ESC}#{color_code}m#{str}#{NND}"
|
25
|
-
end
|
26
|
-
|
27
|
-
def print(o)
|
28
|
-
case o
|
29
|
-
when '.'; io.print green(o)
|
30
|
-
when 'E', 'F'; io.print red(o)
|
31
|
-
when 'S'; io.print yellow(o)
|
32
|
-
else; io.print o
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def puts(*o)
|
37
|
-
o.map! do |str|
|
38
|
-
case str
|
39
|
-
when /Failure:/, /Error:/, /[1-9]+ failures/, /[1-9]+ errors/;
|
40
|
-
red(str)
|
41
|
-
when /Skipped:/
|
42
|
-
yellow(str)
|
43
|
-
when /0 failures, 0 errors/;
|
44
|
-
green(str).gsub(/([1-9]+ skips)/, yellow('\1'))
|
45
|
-
else;
|
46
|
-
str.gsub(/([1-9]+ skips)/, yellow('\1'))
|
47
|
-
end
|
48
|
-
end
|
49
|
-
super
|
50
|
-
end
|
51
|
-
|
52
|
-
def method_missing(msg, *args)
|
53
|
-
io.send(msg, *args)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
MiniTest::Unit.output = MiniTest::StopLight.new(MiniTest::Unit.output)
|
data/urban.gemspec
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path('../lib', __FILE__)
|
3
|
-
require 'urban/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = 'urban'
|
7
|
-
s.version = Urban::VERSION
|
8
|
-
s.authors = ['Thomas Miller']
|
9
|
-
s.email = ['jackerran@gmail.com']
|
10
|
-
s.licenses = ['MIT']
|
11
|
-
s.homepage = 'https://github.com/tmiller/urban'
|
12
|
-
s.summary = %q{A command line tool that interfaces with Urban Dictionary.}
|
13
|
-
s.description = %q{Urban is a command line tool that allows you to look up definitions or pull a random definition from Urban Dictionary.}
|
14
|
-
|
15
|
-
s.rubyforge_project = 'urban'
|
16
|
-
|
17
|
-
s.files = `git ls-files`.split("\n")
|
18
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
-
s.require_paths = ['lib']
|
21
|
-
|
22
|
-
s.add_dependency 'nokogiri', '~> 1.5.0'
|
23
|
-
s.add_development_dependency 'rake', '~> 0.8'
|
24
|
-
s.add_development_dependency 'minitest', '~> 2.0'
|
25
|
-
end
|