benschwarz-smoke 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +47 -0
- data/VERSION.yml +2 -2
- data/lib/core_ext/string.rb +6 -0
- data/lib/smoke/cache.rb +38 -23
- data/lib/smoke/request.rb +4 -8
- data/lib/smoke.rb +7 -2
- data/rdoc/classes/Smoke/Origin.html +340 -0
- data/rdoc/classes/Smoke/Source/Data.html +126 -0
- data/rdoc/classes/Smoke/Source/Feed.html +117 -0
- data/rdoc/classes/Smoke/Source/YQL.html +223 -0
- data/rdoc/classes/Smoke.html +260 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/README_markdown.html +180 -0
- data/rdoc/files/lib/core_ext/hash_rb.html +49 -0
- data/rdoc/files/lib/smoke/origin_rb.html +49 -0
- data/rdoc/files/lib/smoke/request_rb.html +49 -0
- data/rdoc/files/lib/smoke/source/data_rb.html +49 -0
- data/rdoc/files/lib/smoke/source/feed_rb.html +49 -0
- data/rdoc/files/lib/smoke/source/join_rb.html +49 -0
- data/rdoc/files/lib/smoke/source/yql_rb.html +49 -0
- data/rdoc/files/lib/smoke_rb.html +65 -0
- data/rdoc/fr_class_index.html +21 -0
- data/rdoc/fr_file_index.html +28 -0
- data/rdoc/fr_method_index.html +4459 -0
- data/rdoc/index.html +15 -0
- data/rdoc/rdoc-style.css +319 -0
- data/spec/smoke/cache_spec.rb +28 -6
- data/vendor/crack/History +15 -0
- data/vendor/crack/LICENSE +20 -0
- data/vendor/crack/README.rdoc +42 -0
- data/vendor/crack/Rakefile +49 -0
- data/vendor/crack/VERSION.yml +4 -0
- data/vendor/crack/crack.gemspec +61 -0
- data/vendor/crack/lib/crack/core_extensions.rb +128 -0
- data/vendor/crack/lib/crack/json.rb +68 -0
- data/vendor/crack/lib/crack/xml.rb +214 -0
- data/vendor/crack/lib/crack.rb +7 -0
- data/vendor/crack/test/crack_test.rb +4 -0
- data/vendor/crack/test/data/twittersearch-firefox.json +1 -0
- data/vendor/crack/test/data/twittersearch-ie.json +1 -0
- data/vendor/crack/test/hash_test.rb +56 -0
- data/vendor/crack/test/json_test.rb +66 -0
- data/vendor/crack/test/string_test.rb +31 -0
- data/vendor/crack/test/test_helper.rb +12 -0
- data/vendor/crack/test/xml_test.rb +489 -0
- data/vendor/dependencies/README.markdown +113 -0
- data/vendor/dependencies/Rakefile +5 -0
- data/vendor/dependencies/bin/dep +83 -0
- data/vendor/dependencies/dependencies.gemspec +15 -0
- data/vendor/dependencies/dependencies.gemspec.erb +27 -0
- data/vendor/dependencies/lib/dependencies/dep.rb +99 -0
- data/vendor/dependencies/lib/dependencies.rb +5 -0
- data/vendor/dependencies/test/dependencies_test.rb +228 -0
- data/vendor/dependencies/test/foobaz-0.3.gem +0 -0
- data/vendor/fakeweb/CHANGELOG +163 -0
- data/vendor/fakeweb/LICENSE.txt +281 -0
- data/vendor/fakeweb/README.rdoc +193 -0
- data/vendor/fakeweb/Rakefile +76 -0
- data/vendor/fakeweb/fakeweb.gemspec +21 -0
- data/vendor/fakeweb/lib/fake_web/ext/net_http.rb +71 -0
- data/vendor/fakeweb/lib/fake_web/registry.rb +103 -0
- data/vendor/fakeweb/lib/fake_web/responder.rb +113 -0
- data/vendor/fakeweb/lib/fake_web/response.rb +10 -0
- data/vendor/fakeweb/lib/fake_web/stub_socket.rb +15 -0
- data/vendor/fakeweb/lib/fake_web/utility.rb +22 -0
- data/vendor/fakeweb/lib/fake_web.rb +172 -0
- data/vendor/fakeweb/lib/fakeweb.rb +2 -0
- data/vendor/fakeweb/test/fixtures/google_response_from_curl +12 -0
- data/vendor/fakeweb/test/fixtures/google_response_with_transfer_encoding +17 -0
- data/vendor/fakeweb/test/fixtures/google_response_without_transfer_encoding +11 -0
- data/vendor/fakeweb/test/fixtures/test_example.txt +1 -0
- data/vendor/fakeweb/test/fixtures/test_txt_file +3 -0
- data/vendor/fakeweb/test/test_allow_net_connect.rb +85 -0
- data/vendor/fakeweb/test/test_deprecations.rb +54 -0
- data/vendor/fakeweb/test/test_fake_authentication.rb +92 -0
- data/vendor/fakeweb/test/test_fake_web.rb +535 -0
- data/vendor/fakeweb/test/test_fake_web_open_uri.rb +58 -0
- data/vendor/fakeweb/test/test_helper.rb +74 -0
- data/vendor/fakeweb/test/test_missing_open_uri.rb +25 -0
- data/vendor/fakeweb/test/test_precedence.rb +51 -0
- data/vendor/fakeweb/test/test_query_string.rb +45 -0
- data/vendor/fakeweb/test/test_regexes.rb +103 -0
- data/vendor/fakeweb/test/test_response_headers.rb +73 -0
- data/vendor/fakeweb/test/test_trailing_slashes.rb +53 -0
- data/vendor/fakeweb/test/test_utility.rb +70 -0
- data/vendor/json-1.1.3/CHANGES +93 -0
- data/vendor/json-1.1.3/GPL +340 -0
- data/vendor/json-1.1.3/README +78 -0
- data/vendor/json-1.1.3/RUBY +58 -0
- data/vendor/json-1.1.3/Rakefile +309 -0
- data/vendor/json-1.1.3/TODO +1 -0
- data/vendor/json-1.1.3/VERSION +1 -0
- data/vendor/json-1.1.3/benchmarks/benchmark.txt +133 -0
- data/vendor/json-1.1.3/benchmarks/benchmark_generator.rb +48 -0
- data/vendor/json-1.1.3/benchmarks/benchmark_parser.rb +26 -0
- data/vendor/json-1.1.3/benchmarks/benchmark_rails.rb +26 -0
- data/vendor/json-1.1.3/bin/edit_json.rb +10 -0
- data/vendor/json-1.1.3/bin/prettify_json.rb +76 -0
- data/vendor/json-1.1.3/data/example.json +1 -0
- data/vendor/json-1.1.3/data/index.html +38 -0
- data/vendor/json-1.1.3/data/prototype.js +4184 -0
- data/vendor/json-1.1.3/ext/json/ext/generator/extconf.rb +9 -0
- data/vendor/json-1.1.3/ext/json/ext/generator/generator.c +875 -0
- data/vendor/json-1.1.3/ext/json/ext/generator/unicode.c +182 -0
- data/vendor/json-1.1.3/ext/json/ext/generator/unicode.h +53 -0
- data/vendor/json-1.1.3/ext/json/ext/parser/extconf.rb +9 -0
- data/vendor/json-1.1.3/ext/json/ext/parser/parser.c +1758 -0
- data/vendor/json-1.1.3/ext/json/ext/parser/parser.rl +638 -0
- data/vendor/json-1.1.3/ext/json/ext/parser/unicode.c +154 -0
- data/vendor/json-1.1.3/ext/json/ext/parser/unicode.h +58 -0
- data/vendor/json-1.1.3/install.rb +26 -0
- data/vendor/json-1.1.3/lib/json/Array.xpm +21 -0
- data/vendor/json-1.1.3/lib/json/FalseClass.xpm +21 -0
- data/vendor/json-1.1.3/lib/json/Hash.xpm +21 -0
- data/vendor/json-1.1.3/lib/json/Key.xpm +73 -0
- data/vendor/json-1.1.3/lib/json/NilClass.xpm +21 -0
- data/vendor/json-1.1.3/lib/json/Numeric.xpm +28 -0
- data/vendor/json-1.1.3/lib/json/String.xpm +96 -0
- data/vendor/json-1.1.3/lib/json/TrueClass.xpm +21 -0
- data/vendor/json-1.1.3/lib/json/add/core.rb +135 -0
- data/vendor/json-1.1.3/lib/json/add/rails.rb +58 -0
- data/vendor/json-1.1.3/lib/json/common.rb +354 -0
- data/vendor/json-1.1.3/lib/json/editor.rb +1362 -0
- data/vendor/json-1.1.3/lib/json/ext.rb +13 -0
- data/vendor/json-1.1.3/lib/json/json.xpm +1499 -0
- data/vendor/json-1.1.3/lib/json/pure/generator.rb +394 -0
- data/vendor/json-1.1.3/lib/json/pure/parser.rb +259 -0
- data/vendor/json-1.1.3/lib/json/pure.rb +75 -0
- data/vendor/json-1.1.3/lib/json/version.rb +9 -0
- data/vendor/json-1.1.3/lib/json.rb +235 -0
- data/vendor/json-1.1.3/tests/fixtures/fail1.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail10.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail11.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail12.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail13.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail14.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail18.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail19.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail2.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail20.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail21.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail22.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail23.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail24.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail25.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail27.json +2 -0
- data/vendor/json-1.1.3/tests/fixtures/fail28.json +2 -0
- data/vendor/json-1.1.3/tests/fixtures/fail3.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail4.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail5.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail6.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail7.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail8.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail9.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/pass1.json +56 -0
- data/vendor/json-1.1.3/tests/fixtures/pass15.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/pass16.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/pass17.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/pass2.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/pass26.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/pass3.json +6 -0
- data/vendor/json-1.1.3/tests/runner.rb +25 -0
- data/vendor/json-1.1.3/tests/test_json.rb +293 -0
- data/vendor/json-1.1.3/tests/test_json_addition.rb +161 -0
- data/vendor/json-1.1.3/tests/test_json_fixtures.rb +30 -0
- data/vendor/json-1.1.3/tests/test_json_generate.rb +100 -0
- data/vendor/json-1.1.3/tests/test_json_rails.rb +118 -0
- data/vendor/json-1.1.3/tests/test_json_unicode.rb +61 -0
- data/vendor/json-1.1.3/tools/fuzz.rb +140 -0
- data/vendor/json-1.1.3/tools/server.rb +62 -0
- data/vendor/moneta/LICENSE +20 -0
- data/vendor/moneta/README +51 -0
- data/vendor/moneta/Rakefile +60 -0
- data/vendor/moneta/TODO +4 -0
- data/vendor/moneta/benchmarks/various.rb +234 -0
- data/vendor/moneta/lib/moneta/basic_file.rb +111 -0
- data/vendor/moneta/lib/moneta/berkeley.rb +53 -0
- data/vendor/moneta/lib/moneta/couch.rb +63 -0
- data/vendor/moneta/lib/moneta/datamapper.rb +117 -0
- data/vendor/moneta/lib/moneta/file.rb +91 -0
- data/vendor/moneta/lib/moneta/lmc.rb +52 -0
- data/vendor/moneta/lib/moneta/memcache.rb +53 -0
- data/vendor/moneta/lib/moneta/memory.rb +11 -0
- data/vendor/moneta/lib/moneta/mongodb.rb +58 -0
- data/vendor/moneta/lib/moneta/redis.rb +49 -0
- data/vendor/moneta/lib/moneta/rufus.rb +41 -0
- data/vendor/moneta/lib/moneta/s3.rb +162 -0
- data/vendor/moneta/lib/moneta/sdbm.rb +33 -0
- data/vendor/moneta/lib/moneta/tyrant.rb +58 -0
- data/vendor/moneta/lib/moneta/xattr.rb +58 -0
- data/vendor/moneta/lib/moneta.rb +76 -0
- data/vendor/moneta/moneta.gemspec +32 -0
- data/vendor/moneta/script/destroy +14 -0
- data/vendor/moneta/script/generate +14 -0
- data/vendor/moneta/spec/moneta_basic_file_spec.rb +50 -0
- data/vendor/moneta/spec/moneta_berkeley_spec.rb +20 -0
- data/vendor/moneta/spec/moneta_couch_spec.rb +22 -0
- data/vendor/moneta/spec/moneta_datamapper_spec.rb +79 -0
- data/vendor/moneta/spec/moneta_file_spec.rb +21 -0
- data/vendor/moneta/spec/moneta_lmc_spec.rb +24 -0
- data/vendor/moneta/spec/moneta_memcache_spec.rb +16 -0
- data/vendor/moneta/spec/moneta_memory_spec.rb +12 -0
- data/vendor/moneta/spec/moneta_mongodb_spec.rb +16 -0
- data/vendor/moneta/spec/moneta_redis_spec.rb +16 -0
- data/vendor/moneta/spec/moneta_rufus_spec.rb +15 -0
- data/vendor/moneta/spec/moneta_s3_spec.rb +19 -0
- data/vendor/moneta/spec/moneta_sdbm_spec.rb +21 -0
- data/vendor/moneta/spec/moneta_tyrant_spec.rb +15 -0
- data/vendor/moneta/spec/moneta_xattr_spec.rb +21 -0
- data/vendor/moneta/spec/shared.rb +122 -0
- data/vendor/moneta/spec/spec_helper.rb +7 -0
- data/vendor/rest-client/README.rdoc +151 -0
- data/vendor/rest-client/Rakefile +58 -0
- data/vendor/rest-client/VERSION +1 -0
- data/vendor/rest-client/bin/restclient +87 -0
- data/vendor/rest-client/lib/rest_client.rb +2 -0
- data/vendor/rest-client/lib/restclient/exceptions.rb +88 -0
- data/vendor/rest-client/lib/restclient/mixin/response.rb +43 -0
- data/vendor/rest-client/lib/restclient/raw_response.rb +30 -0
- data/vendor/rest-client/lib/restclient/request.rb +238 -0
- data/vendor/rest-client/lib/restclient/resource.rb +146 -0
- data/vendor/rest-client/lib/restclient/response.rb +20 -0
- data/vendor/rest-client/lib/restclient.rb +99 -0
- data/vendor/rest-client/rest-client.gemspec +66 -0
- data/vendor/rest-client/spec/base.rb +4 -0
- data/vendor/rest-client/spec/exceptions_spec.rb +65 -0
- data/vendor/rest-client/spec/mixin/response_spec.rb +46 -0
- data/vendor/rest-client/spec/raw_response_spec.rb +17 -0
- data/vendor/rest-client/spec/request_spec.rb +476 -0
- data/vendor/rest-client/spec/resource_spec.rb +75 -0
- data/vendor/rest-client/spec/response_spec.rb +16 -0
- data/vendor/rest-client/spec/restclient_spec.rb +53 -0
- data/vendor/simple-rss/LICENSE +429 -0
- data/vendor/simple-rss/README +43 -0
- data/vendor/simple-rss/Rakefile +212 -0
- data/vendor/simple-rss/install.rb +40 -0
- data/vendor/simple-rss/lib/simple-rss.rb +150 -0
- data/vendor/simple-rss/simple-rss.gemspec +12 -0
- data/vendor/simple-rss/test/base/base_test.rb +51 -0
- data/vendor/simple-rss/test/data/atom.xml +45 -0
- data/vendor/simple-rss/test/data/not-rss.xml +8 -0
- data/vendor/simple-rss/test/data/rss09.rdf +79 -0
- data/vendor/simple-rss/test/data/rss20.xml +818 -0
- data/vendor/simple-rss/test/test_helper.rb +4 -0
- metadata +314 -40
@@ -0,0 +1,15 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "dependencies"
|
3
|
+
s.version = "0.0.6"
|
4
|
+
s.summary = "Specify your project's dependencies in one file."
|
5
|
+
s.authors = ["Damian Janowski", "Michel Martens"]
|
6
|
+
s.email = ["djanowski@dimaion.com", "michel@soveran.com"]
|
7
|
+
|
8
|
+
s.rubyforge_project = "dependencies"
|
9
|
+
|
10
|
+
s.executables << "dep"
|
11
|
+
|
12
|
+
s.files = ["README.markdown", "Rakefile", "bin/dep", "dependencies.gemspec", "lib/dependencies/dep.rb", "lib/dependencies.rb", "test/dependencies_test.rb", "test/foobaz-0.3.gem", "test/vendor/bar/lib", "test/vendor/barz-2.0/lib", "test/vendor/baz-1.0/lib"]
|
13
|
+
|
14
|
+
s.add_dependency("wycats-thor", "~> 0.11")
|
15
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "dependencies"
|
3
|
+
s.version = "0.0.6"
|
4
|
+
s.summary = "Specify your project's dependencies in one file."
|
5
|
+
s.authors = ["Damian Janowski", "Michel Martens"]
|
6
|
+
s.email = ["djanowski@dimaion.com", "michel@soveran.com"]
|
7
|
+
|
8
|
+
s.rubyforge_project = "dependencies"
|
9
|
+
|
10
|
+
s.executables << "dep"
|
11
|
+
|
12
|
+
s.files = <%= Dir[
|
13
|
+
"LICENSE",
|
14
|
+
"README*",
|
15
|
+
"Rakefile",
|
16
|
+
"Thorfile",
|
17
|
+
"bin/*",
|
18
|
+
"*.gemspec",
|
19
|
+
"lib/**/*.rb",
|
20
|
+
"test/*.*",
|
21
|
+
"test/vendor/bar/**/*",
|
22
|
+
"test/vendor/barz-2.0/**/*",
|
23
|
+
"test/vendor/baz-1.0/**/*"
|
24
|
+
].inspect %>
|
25
|
+
|
26
|
+
s.add_dependency("wycats-thor", "~> 0.11")
|
27
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
class Dep
|
2
|
+
class Dependency
|
3
|
+
attr :name
|
4
|
+
attr :version
|
5
|
+
attr :environment
|
6
|
+
attr :url
|
7
|
+
|
8
|
+
def initialize(name, version = nil, environment = nil, url = nil)
|
9
|
+
@name = name
|
10
|
+
@version = version if version && !version.empty?
|
11
|
+
@environment = environment ? environment.split(/\, ?/) : []
|
12
|
+
@url = url
|
13
|
+
end
|
14
|
+
|
15
|
+
def for_environment?(env)
|
16
|
+
environment.empty? || environment.include?(env)
|
17
|
+
end
|
18
|
+
|
19
|
+
def version_number
|
20
|
+
version[/([\d\.]+)$/, 1]
|
21
|
+
end
|
22
|
+
|
23
|
+
def vendor_name
|
24
|
+
version ? "#{name}-#{version_number}" : name
|
25
|
+
end
|
26
|
+
|
27
|
+
def vendor_path
|
28
|
+
Dir[File.join("vendor", "#{vendor_name}*", "lib")].first ||
|
29
|
+
Dir[File.join("vendor", name, "lib")].first
|
30
|
+
end
|
31
|
+
|
32
|
+
def require_vendor
|
33
|
+
$:.unshift(File.expand_path(vendor_path)) if vendor_path
|
34
|
+
end
|
35
|
+
|
36
|
+
def require_gem
|
37
|
+
return unless defined?(Gem)
|
38
|
+
|
39
|
+
begin
|
40
|
+
gem(*[name, version].compact)
|
41
|
+
true
|
42
|
+
rescue Gem::LoadError => e
|
43
|
+
false
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def require
|
48
|
+
require_vendor || require_gem
|
49
|
+
end
|
50
|
+
|
51
|
+
def to_s
|
52
|
+
[name, version, ("(#{environment.join(", ")})" unless environment.empty?)].compact.join(" ")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
include Enumerable
|
57
|
+
|
58
|
+
attr :dependencies
|
59
|
+
|
60
|
+
def initialize(dependencies)
|
61
|
+
@dependencies = []
|
62
|
+
@missing = []
|
63
|
+
|
64
|
+
dependencies.each_line do |line|
|
65
|
+
next unless line =~ /^([\w\-_]+) ?([<~=> \d\.]+)?(?: \(([\w, ]+)\))?(?: ([a-z]+:\/\/.+?))?$/
|
66
|
+
@dependencies << Dependency.new($1, $2, $3, $4)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def filter(environment)
|
71
|
+
@dependencies.select do |dep|
|
72
|
+
dep.for_environment?(environment)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def require(environment)
|
77
|
+
filter(environment).each do |dep|
|
78
|
+
@missing << dep unless dep.require
|
79
|
+
end
|
80
|
+
|
81
|
+
if !@missing.empty?
|
82
|
+
$stderr.puts "\nMissing dependencies:\n\n"
|
83
|
+
|
84
|
+
@missing.each do |dep|
|
85
|
+
$stderr.puts " #{dep}"
|
86
|
+
end
|
87
|
+
|
88
|
+
$stderr.puts
|
89
|
+
$stderr.puts "Run `dep list` to view missing dependencies or `dep vendor --all` if you want to vendor them.\n\n"
|
90
|
+
exit(1)
|
91
|
+
end
|
92
|
+
|
93
|
+
$:.unshift File.expand_path("lib")
|
94
|
+
end
|
95
|
+
|
96
|
+
def each(&block)
|
97
|
+
@dependencies.each(&block)
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,228 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "open3"
|
3
|
+
|
4
|
+
require "contest"
|
5
|
+
|
6
|
+
require "pp"
|
7
|
+
require "stringio"
|
8
|
+
require "fileutils"
|
9
|
+
|
10
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
11
|
+
|
12
|
+
class Dep
|
13
|
+
# Override exit to allow the tests to keep running.
|
14
|
+
def exit(*attrs)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class DependenciesTest < Test::Unit::TestCase
|
19
|
+
def do_require
|
20
|
+
load "dependencies.rb"
|
21
|
+
end
|
22
|
+
|
23
|
+
def ensure_gem_home
|
24
|
+
gem_path = File.expand_path(File.join(File.dirname(__FILE__), "..", "tmp"))
|
25
|
+
|
26
|
+
flunk "GEM_HOME should be #{gem_path}. Run with env GEM_HOME=#{gem_path}." unless gem_path == ENV["GEM_HOME"]
|
27
|
+
end
|
28
|
+
|
29
|
+
def with_dependencies(deps)
|
30
|
+
File.open("dependencies", "w") do |f|
|
31
|
+
f.write(deps)
|
32
|
+
end
|
33
|
+
|
34
|
+
yield
|
35
|
+
ensure
|
36
|
+
FileUtils.rm("dependencies")
|
37
|
+
end
|
38
|
+
|
39
|
+
context "lib" do
|
40
|
+
setup do
|
41
|
+
@load_path = $LOAD_PATH.dup
|
42
|
+
end
|
43
|
+
|
44
|
+
test "loads dependencies from ./vendor" do
|
45
|
+
with_dependencies "bar" do
|
46
|
+
do_require
|
47
|
+
assert_equal File.expand_path("vendor/bar/lib"), $:[1]
|
48
|
+
end
|
49
|
+
|
50
|
+
with_dependencies "bar 1.0" do
|
51
|
+
do_require
|
52
|
+
assert_equal File.expand_path("vendor/bar/lib"), $:[1]
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
test "honors the version number for the vendor directory" do
|
57
|
+
with_dependencies "foo 2.0" do
|
58
|
+
do_require
|
59
|
+
assert_equal File.expand_path("vendor/foo-2.0/lib"), $:[1]
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
test "add ./lib to the load path" do
|
64
|
+
with_dependencies "" do
|
65
|
+
do_require
|
66
|
+
assert_equal File.expand_path("lib"), $:.first
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
test "alert about missing dependencies" do
|
71
|
+
with_dependencies "foo 1.0" do
|
72
|
+
err = capture_stderr do
|
73
|
+
do_require
|
74
|
+
end
|
75
|
+
|
76
|
+
assert err.include?("Missing dependencies:\n\n foo 1.0")
|
77
|
+
assert err.include?("Run `dep list` to view missing dependencies or `dep vendor --all` if you want to vendor them.")
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
test "load environment-specific dependencies" do
|
82
|
+
begin
|
83
|
+
ENV["RACK_ENV"] = "integration"
|
84
|
+
|
85
|
+
with_dependencies "bar\nbarz 2.0 (test)\nbaz 1.0 (integration)" do
|
86
|
+
do_require
|
87
|
+
|
88
|
+
assert $:.include?(File.expand_path("vendor/bar/lib"))
|
89
|
+
assert $:.include?(File.expand_path("vendor/baz-1.0/lib"))
|
90
|
+
assert !$:.include?(File.expand_path("vendor/barz-2.0/lib"))
|
91
|
+
end
|
92
|
+
|
93
|
+
ensure
|
94
|
+
ENV.delete "RACK_ENV"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
teardown do
|
99
|
+
$LOAD_PATH.replace(@load_path)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
context "binary" do
|
104
|
+
def dep(args = nil)
|
105
|
+
out, err = nil
|
106
|
+
|
107
|
+
Open3.popen3("#{File.expand_path(File.join("../bin/dep"))} #{args}") do |stdin, stdout, stderr|
|
108
|
+
out = stdout.read
|
109
|
+
err = stderr.read
|
110
|
+
end
|
111
|
+
|
112
|
+
[out, err]
|
113
|
+
end
|
114
|
+
|
115
|
+
context "list" do
|
116
|
+
test "prints all dependencies" do
|
117
|
+
with_dependencies "foo ~> 1.0\nbar" do
|
118
|
+
out, err = dep "list"
|
119
|
+
assert_equal "foo ~> 1.0\nbar\n", out
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
test "prints dependencies based on given environment" do
|
124
|
+
with_dependencies "foo 1.0 (test)\nbar (development)\nbarz 2.0\nbaz 0.1 (test)" do
|
125
|
+
out, err = dep "list test"
|
126
|
+
assert_equal "foo 1.0 (test)\nbarz 2.0\nbaz 0.1 (test)\n", out
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
test "complains when no dependencies file found" do
|
131
|
+
out, err = dep "list"
|
132
|
+
assert_equal "No dependencies file found.\n", err
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
context "vendor" do
|
137
|
+
setup do
|
138
|
+
@dir = create_repo("foobar")
|
139
|
+
end
|
140
|
+
|
141
|
+
test "vendors dependencies" do
|
142
|
+
with_dependencies "foobar file://#{@dir}" do
|
143
|
+
out, err = dep "vendor foobar"
|
144
|
+
|
145
|
+
assert File.exist?("vendor/foobar/lib/foobar.rb")
|
146
|
+
assert !File.exist?("vendor/foobar/.git")
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
test "vendors using RubyGems when given a version" do
|
151
|
+
ensure_gem_home
|
152
|
+
|
153
|
+
system "gem install foobaz-0.3.gem > /dev/null"
|
154
|
+
|
155
|
+
with_dependencies "foobaz 0.3" do
|
156
|
+
out, err = dep "vendor foobaz"
|
157
|
+
|
158
|
+
assert File.exist?("vendor/foobaz-0.3/lib/foobaz.rb")
|
159
|
+
assert !File.exist?("vendor/foobaz-0.3/.git")
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
test "complains when no URL given" do
|
164
|
+
with_dependencies "foobar" do
|
165
|
+
out, err = dep "vendor foobar"
|
166
|
+
|
167
|
+
assert_match %r{Don't know where to vendor foobar from \(no version or URL given...\)}, err
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
test "complains when the dependency is not found" do
|
172
|
+
with_dependencies "foobar 1.0" do
|
173
|
+
out, err = dep "vendor qux"
|
174
|
+
|
175
|
+
assert_match %r{Dependency qux not found.}, err
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
test "vendors everything with --all" do
|
180
|
+
with_dependencies "foobar file://#{@dir}\nbarbar file://#{create_repo "barbar"}" do
|
181
|
+
out, err = dep "vendor --all"
|
182
|
+
|
183
|
+
assert File.exist?("vendor/foobar/lib/foobar.rb")
|
184
|
+
assert !File.exist?("vendor/foobar/.git")
|
185
|
+
|
186
|
+
assert File.exist?("vendor/barbar/lib/barbar.rb")
|
187
|
+
assert !File.exist?("vendor/barbar/.git")
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
teardown do
|
192
|
+
FileUtils.rm_rf(@dir)
|
193
|
+
end
|
194
|
+
|
195
|
+
def create_repo(name)
|
196
|
+
dir = File.expand_path(File.join(File.dirname(__FILE__), "tmp", name))
|
197
|
+
|
198
|
+
FileUtils.rm_rf(dir)
|
199
|
+
FileUtils.rm_rf("vendor/#{name}")
|
200
|
+
FileUtils.mkdir_p(dir)
|
201
|
+
|
202
|
+
Dir.chdir(dir) do
|
203
|
+
`git init`
|
204
|
+
|
205
|
+
FileUtils.mkdir("lib")
|
206
|
+
FileUtils.touch("lib/#{name}.rb")
|
207
|
+
|
208
|
+
`git add lib`
|
209
|
+
`git commit -m 'Lorem.'`
|
210
|
+
end
|
211
|
+
|
212
|
+
dir
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
protected
|
218
|
+
|
219
|
+
def capture_stderr
|
220
|
+
begin
|
221
|
+
err, $stderr = $stderr, StringIO.new
|
222
|
+
yield
|
223
|
+
ensure
|
224
|
+
$stderr, err = err, $stderr
|
225
|
+
end
|
226
|
+
err.string
|
227
|
+
end
|
228
|
+
end
|
Binary file
|
@@ -0,0 +1,163 @@
|
|
1
|
+
fakeweb (1.2.5)
|
2
|
+
|
3
|
+
* fix handling of userinfo strings that contain percent-encoded unsafe
|
4
|
+
characters [Chris Kampmeier, Ken Mayer]
|
5
|
+
|
6
|
+
* fix that exact matches against strings/URIs with the :any method had a lower
|
7
|
+
precedence than regex matches using a real HTTP method (exact matches now
|
8
|
+
always take precedence) [Chris Kampmeier]
|
9
|
+
|
10
|
+
* change request handling to raise an exception when more than one registered
|
11
|
+
regex matches a request URI [Chris Kampmeier]
|
12
|
+
|
13
|
+
|
14
|
+
fakeweb (1.2.4)
|
15
|
+
|
16
|
+
* add experimental support for matching URIs via regular expressions
|
17
|
+
[Jacqui Maher, Tiago Albineli Motta, Peter Wagene]
|
18
|
+
|
19
|
+
* fix an exception when registering with the :response option and a string that
|
20
|
+
is the same as the name of a directory in the current path [Chris Kampmeier]
|
21
|
+
|
22
|
+
* DEPRECATION: Calling FakeWeb.register_uri with a :string or :file option is
|
23
|
+
now deprecated. Both options have been replaced with a unified :body option,
|
24
|
+
since they supply the response body (as opposed to :response, which supplies
|
25
|
+
the full response including headers) [Chris Kampmeier]
|
26
|
+
|
27
|
+
* add support for specifying HTTP headers as options to FakeWeb.register_uri
|
28
|
+
when using the :string or :file response types, since those methods only
|
29
|
+
specify a response body [David Michael, Chris Kampmeier]
|
30
|
+
|
31
|
+
* DEPRECATION: Calling FakeWeb.register_uri and FakeWeb.registered_uri? without
|
32
|
+
an HTTP method as the first argument is now deprecated. To match against any
|
33
|
+
HTTP method (the pre-1.2.0 behavior), use :any [Chris Kampmeier]
|
34
|
+
|
35
|
+
|
36
|
+
fakeweb (1.2.3)
|
37
|
+
|
38
|
+
* fix the #http_version of :file and :string responses, which was returning the
|
39
|
+
request URI instead of something sensible like "1.0" [Chris Kampmeier]
|
40
|
+
|
41
|
+
* add method aliases in the Net::HTTP patch to eliminate warnings when running
|
42
|
+
with -w [Joshua Clingenpeel]
|
43
|
+
|
44
|
+
* fix that removing the redefinition of OpenURI::HTTPError in 1.2.0 caused
|
45
|
+
:exception responses to raise when OpenURI isn't available [Chris Kampmeier]
|
46
|
+
|
47
|
+
* fix registering an :exception response with classes that require arguments for
|
48
|
+
instantiation, like Interrupt's subclasses [Chris Kampmeier]
|
49
|
+
|
50
|
+
|
51
|
+
fakeweb (1.2.2)
|
52
|
+
|
53
|
+
* fix that HTTP Digest and OAuth requests could raise URI::InvalidURIErrors
|
54
|
+
[Bill Kocik, Chris Kampmeier]
|
55
|
+
|
56
|
+
|
57
|
+
fakeweb (1.2.1)
|
58
|
+
|
59
|
+
* fix that query parameters are handled correctly when registering with a URI
|
60
|
+
object [Anselmo Alves, Chris Kampmeier]
|
61
|
+
|
62
|
+
* fix an exception when registering with the :response option and a string
|
63
|
+
containing "\0" [Jonathan Baudanza, Chris Kampmeier]
|
64
|
+
|
65
|
+
* fix that trailing slashes were considered significant for requests to the root
|
66
|
+
of a domain [Chris Kampmeier]
|
67
|
+
|
68
|
+
* add support for HTTP basic authentication via userinfo strings in URIs
|
69
|
+
[Michael Bleigh]
|
70
|
+
|
71
|
+
|
72
|
+
fakeweb (1.2.0)
|
73
|
+
|
74
|
+
* add lib/fakeweb.rb so you can require "fakeweb" as well [Chris Kampmeier]
|
75
|
+
|
76
|
+
* fix compatibility with Ruby 1.9.1 [Chris Kampmeier]
|
77
|
+
|
78
|
+
* fix that newlines in file-based responses could be doubled in the response
|
79
|
+
object's body [Mark Menard, Chris Kampmeier]
|
80
|
+
|
81
|
+
* fix unnecessary munging of the transfer-encoding header, which improves
|
82
|
+
compatibility with mechanize [Mark Menard]
|
83
|
+
|
84
|
+
* fix a test and the RCov dependency to be compatible with JRuby [Mark Menard]
|
85
|
+
|
86
|
+
* remove an unnecessary redefinition of OpenURI::HTTPError [Josh Nichols]
|
87
|
+
|
88
|
+
* rearrange implementation code into separate files, one per class [Josh Nichols]
|
89
|
+
|
90
|
+
* fix a bug where FakeWeb.response_for would raise if the request wasn't
|
91
|
+
registered [Chris Kampmeier]
|
92
|
+
|
93
|
+
* add HTTP method support, so FakeWeb takes both the URI and method into
|
94
|
+
account for registration, requests, and responses. Backwards-compatible with
|
95
|
+
the old method signatures, which didn't have a method param. [Chris Kampmeier]
|
96
|
+
|
97
|
+
* start work on Ruby 1.9 compatibility [Chris Kampmeier]
|
98
|
+
|
99
|
+
* add FakeWeb.allow_net_connect= to enable/disable the pass-through to
|
100
|
+
Net::HTTP for unregistered URIs [Mislav Marohnić, Chris Kampmeier]
|
101
|
+
|
102
|
+
* remove setup.rb, since most people use RubyGems [Mislav Marohnić]
|
103
|
+
|
104
|
+
* fix that 'http://example.com/?' (empty query) matches a registered
|
105
|
+
'http://example.com/', and vice-versa [Mislav Marohnić]
|
106
|
+
|
107
|
+
* improve the test suite to not rely on an internet connection [Chris Kampmeier]
|
108
|
+
|
109
|
+
* use `rake test` instead of `rake tests` [Josh Nichols]
|
110
|
+
|
111
|
+
* fix an incompatibility with Ruby 1.8.6 p36 where you'd get "Errno::EINTR:
|
112
|
+
Interrupted system call" exceptions in Socket#sysread for any non-faked
|
113
|
+
request [Chris Kampmeier]
|
114
|
+
|
115
|
+
* response rotation: you can now optionally call FakeWeb.register_uri with an
|
116
|
+
array of options hashes; these are used, in order, to respond to
|
117
|
+
repeated requests (to repeat a response more than once before rotating, use
|
118
|
+
the :times option). Once you run out of responses, further requests always
|
119
|
+
receive the last response. [Michael Shapiro]
|
120
|
+
|
121
|
+
* add support for Net::HTTP's undocumented full-URI request style (fixes
|
122
|
+
URI::InvalidURIErrors that you might see in older libraries) [Chris Kampmeier]
|
123
|
+
|
124
|
+
* sort query params before storing internally, so that
|
125
|
+
http://example.com/?a=1&b=2 and http://example.com/?b=2&a=1 are considered the
|
126
|
+
same URL (although this is technically incorrect, it's much more
|
127
|
+
convenient--most web apps work that way, and Net::HTTP's use of a hash to pass
|
128
|
+
query params means that the order in which FakeWeb stores them can be
|
129
|
+
unpredictable) [Chris Kampmeier]
|
130
|
+
|
131
|
+
* add support for ports in URLs, so that http://example.com/ and
|
132
|
+
http://example.com:3000/ are not the same [Chris Kampmeier]
|
133
|
+
|
134
|
+
* fix for non-faked SSL requests failing with "Unable to create local socket"
|
135
|
+
[Chris Kampmeier]
|
136
|
+
|
137
|
+
* update Rakefile to fix warning about deprecated code [Chris Kampmeier]
|
138
|
+
|
139
|
+
|
140
|
+
fakeweb (1.1.2)
|
141
|
+
|
142
|
+
* add required dependencies to GemSpec to ensure that tests pass in firebrigade
|
143
|
+
(http://firebrigade.seattlerb.org/) [Blaine Cook]
|
144
|
+
|
145
|
+
|
146
|
+
fakeweb (1.1.1)
|
147
|
+
|
148
|
+
* fix for non-existence of :string method on File as presented by open-uri
|
149
|
+
[Blaine Cook]
|
150
|
+
|
151
|
+
* fix for curl example test - google redirects to ccTLDs for those outside US
|
152
|
+
[Blaine Cook]
|
153
|
+
|
154
|
+
|
155
|
+
fakeweb (1.1.0)
|
156
|
+
|
157
|
+
* update code to correspond to ruby 1.8.4 (breaks compatibility with ruby 1.8.2)
|
158
|
+
[Blaine Cook]
|
159
|
+
|
160
|
+
|
161
|
+
fakeweb (1.0.0)
|
162
|
+
|
163
|
+
* initial import [Blaine Cook]
|