alexa 0.1.0 → 0.1.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.
- data/.gitignore +3 -5
- data/Gemfile +5 -0
- data/Gemfile.lock +23 -0
- data/README.rdoc +1 -1
- data/Rakefile +6 -54
- data/alexa.gemspec +18 -53
- data/lib/alexa.rb +3 -4
- data/lib/alexa/url_info.rb +6 -6
- data/lib/alexa/version.rb +3 -0
- data/test/config_test.rb +1 -1
- data/test/helper.rb +15 -0
- data/test/url_info_test.rb +1 -1
- metadata +62 -23
- data/.document +0 -5
- data/VERSION +0 -1
- data/test/test_helper.rb +0 -14
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
alexa (0.1.1)
|
5
|
+
xml-simple
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
rake (0.8.7)
|
11
|
+
shoulda (2.11.3)
|
12
|
+
test-unit (2.1.1)
|
13
|
+
xml-simple (1.0.12)
|
14
|
+
|
15
|
+
PLATFORMS
|
16
|
+
ruby
|
17
|
+
|
18
|
+
DEPENDENCIES
|
19
|
+
alexa!
|
20
|
+
rake
|
21
|
+
shoulda
|
22
|
+
test-unit
|
23
|
+
xml-simple
|
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -1,60 +1,12 @@
|
|
1
|
-
|
1
|
+
require "bundler"
|
2
|
+
Bundler::GemHelper.install_tasks
|
3
|
+
Bundler.setup
|
2
4
|
|
3
|
-
require
|
4
|
-
require 'rake'
|
5
|
-
|
6
|
-
begin
|
7
|
-
require 'jeweler'
|
8
|
-
Jeweler::Tasks.new do |gem|
|
9
|
-
gem.name = "alexa"
|
10
|
-
gem.description = %Q{Alexa Web Information Service library (AWIS)}
|
11
|
-
gem.summary = %Q{Alexa Web Information Service library}
|
12
|
-
gem.email = "w.wnetrzak@gmail.com"
|
13
|
-
gem.homepage = "http://github.com/morgoth/alexa"
|
14
|
-
gem.authors = ["Wojciech Wnętrzak"]
|
15
|
-
gem.add_dependency('xml-simple')
|
16
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
|
-
end
|
18
|
-
|
19
|
-
rescue LoadError
|
20
|
-
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
21
|
-
end
|
22
|
-
|
23
|
-
require 'rake/testtask'
|
5
|
+
require "rake/testtask"
|
24
6
|
Rake::TestTask.new(:test) do |test|
|
25
|
-
test.libs <<
|
26
|
-
test.pattern =
|
7
|
+
test.libs << "lib" << "test"
|
8
|
+
test.pattern = "test/**/*_test.rb"
|
27
9
|
test.verbose = true
|
28
10
|
end
|
29
11
|
|
30
|
-
begin
|
31
|
-
require 'rcov/rcovtask'
|
32
|
-
Rcov::RcovTask.new do |test|
|
33
|
-
test.libs << 'test'
|
34
|
-
test.pattern = 'test/**/*_test.rb'
|
35
|
-
test.verbose = true
|
36
|
-
end
|
37
|
-
rescue LoadError
|
38
|
-
task :rcov do
|
39
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
12
|
task :default => :test
|
45
|
-
|
46
|
-
require 'rake/rdoctask'
|
47
|
-
Rake::RDocTask.new do |rdoc|
|
48
|
-
if File.exist?('VERSION.yml')
|
49
|
-
config = YAML.load(File.read('VERSION.yml'))
|
50
|
-
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
51
|
-
else
|
52
|
-
version = ""
|
53
|
-
end
|
54
|
-
|
55
|
-
rdoc.rdoc_dir = 'rdoc'
|
56
|
-
rdoc.title = "alexa #{version}"
|
57
|
-
rdoc.rdoc_files.include('README*')
|
58
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
59
|
-
end
|
60
|
-
|
data/alexa.gemspec
CHANGED
@@ -1,61 +1,26 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "alexa/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
9
|
-
|
10
|
-
s.
|
11
|
-
s.
|
12
|
-
s.
|
6
|
+
s.name = "alexa"
|
7
|
+
s.version = Alexa::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Wojciech Wnętrzak"]
|
10
|
+
s.email = ["w.wnetrzak@gmail.com"]
|
11
|
+
s.homepage = "https://github.com/morgoth/alexa"
|
12
|
+
s.summary = %q{Alexa Web Information Service library}
|
13
13
|
s.description = %q{Alexa Web Information Service library (AWIS)}
|
14
|
-
|
15
|
-
s.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
s.files
|
20
|
-
".document",
|
21
|
-
".gitignore",
|
22
|
-
"LICENSE",
|
23
|
-
"README.rdoc",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION",
|
26
|
-
"alexa.gemspec",
|
27
|
-
"lib/alexa.rb",
|
28
|
-
"lib/alexa/config.rb",
|
29
|
-
"lib/alexa/url_info.rb",
|
30
|
-
"test/config_test.rb",
|
31
|
-
"test/fixtures/empty.xml",
|
32
|
-
"test/fixtures/polsl.xml",
|
33
|
-
"test/fixtures/polsl_small.xml",
|
34
|
-
"test/test_helper.rb",
|
35
|
-
"test/url_info_test.rb"
|
36
|
-
]
|
37
|
-
s.homepage = %q{http://github.com/morgoth/alexa}
|
38
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
14
|
+
|
15
|
+
s.rubyforge_project = "alexa"
|
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) }
|
39
20
|
s.require_paths = ["lib"]
|
40
|
-
s.rubygems_version = %q{1.3.5}
|
41
|
-
s.summary = %q{Alexa Web Information Service library}
|
42
|
-
s.test_files = [
|
43
|
-
"test/url_info_test.rb",
|
44
|
-
"test/config_test.rb",
|
45
|
-
"test/test_helper.rb"
|
46
|
-
]
|
47
21
|
|
48
|
-
|
49
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
50
|
-
s.specification_version = 3
|
22
|
+
s.add_dependency "xml-simple"
|
51
23
|
|
52
|
-
|
53
|
-
|
54
|
-
else
|
55
|
-
s.add_dependency(%q<xml-simple>, [">= 0"])
|
56
|
-
end
|
57
|
-
else
|
58
|
-
s.add_dependency(%q<xml-simple>, [">= 0"])
|
59
|
-
end
|
24
|
+
s.add_development_dependency "test-unit"
|
25
|
+
s.add_development_dependency "shoulda"
|
60
26
|
end
|
61
|
-
|
data/lib/alexa.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#/usr/bin/ruby
|
2
1
|
require "cgi"
|
3
2
|
require "base64"
|
4
3
|
require "openssl"
|
@@ -8,8 +7,9 @@ require "net/https"
|
|
8
7
|
require "xmlsimple"
|
9
8
|
require "time"
|
10
9
|
|
11
|
-
require
|
12
|
-
require
|
10
|
+
require "alexa/config"
|
11
|
+
require "alexa/url_info"
|
12
|
+
require "alexa/version"
|
13
13
|
|
14
14
|
module Alexa
|
15
15
|
def self.url_info(options = {})
|
@@ -19,4 +19,3 @@ module Alexa
|
|
19
19
|
url_info
|
20
20
|
end
|
21
21
|
end
|
22
|
-
|
data/lib/alexa/url_info.rb
CHANGED
@@ -84,12 +84,12 @@ module Alexa
|
|
84
84
|
url = URI.parse(
|
85
85
|
"http://awis.amazonaws.com/?" +
|
86
86
|
{
|
87
|
-
"Action"
|
88
|
-
"AWSAccessKeyId"
|
89
|
-
"Signature"
|
90
|
-
"Timestamp"
|
91
|
-
"ResponseGroup"
|
92
|
-
"Url"
|
87
|
+
"Action" => action,
|
88
|
+
"AWSAccessKeyId" => access_key_id,
|
89
|
+
"Signature" => signature,
|
90
|
+
"Timestamp" => timestamp,
|
91
|
+
"ResponseGroup" => response_group,
|
92
|
+
"Url" => host
|
93
93
|
}.to_a.collect{ |item| item.first + "=" + CGI::escape(item.last) }.sort.join("&")
|
94
94
|
)
|
95
95
|
end
|
data/test/config_test.rb
CHANGED
data/test/helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Bundler.require
|
2
|
+
require "test/unit"
|
3
|
+
require "shoulda"
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
6
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
7
|
+
require 'alexa'
|
8
|
+
|
9
|
+
class Test::Unit::TestCase
|
10
|
+
def fixture_file(filename)
|
11
|
+
return '' if filename == ''
|
12
|
+
file_path = File.expand_path(File.dirname(__FILE__) + '/fixtures/' + filename)
|
13
|
+
File.read(file_path)
|
14
|
+
end
|
15
|
+
end
|
data/test/url_info_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alexa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- "Wojciech Wn\xC4\x99trzak"
|
@@ -9,74 +14,108 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-11-15 00:00:00 +01:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: xml-simple
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
17
30
|
type: :runtime
|
18
|
-
|
19
|
-
version_requirements:
|
31
|
+
prerelease: false
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: test-unit
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
20
37
|
requirements:
|
21
38
|
- - ">="
|
22
39
|
- !ruby/object:Gem::Version
|
40
|
+
segments:
|
41
|
+
- 0
|
23
42
|
version: "0"
|
24
|
-
|
43
|
+
type: :development
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: *id002
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: shoulda
|
48
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
segments:
|
54
|
+
- 0
|
55
|
+
version: "0"
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *id003
|
25
59
|
description: Alexa Web Information Service library (AWIS)
|
26
|
-
email:
|
60
|
+
email:
|
61
|
+
- w.wnetrzak@gmail.com
|
27
62
|
executables: []
|
28
63
|
|
29
64
|
extensions: []
|
30
65
|
|
31
|
-
extra_rdoc_files:
|
32
|
-
|
33
|
-
- README.rdoc
|
66
|
+
extra_rdoc_files: []
|
67
|
+
|
34
68
|
files:
|
35
|
-
- .document
|
36
69
|
- .gitignore
|
70
|
+
- Gemfile
|
71
|
+
- Gemfile.lock
|
37
72
|
- LICENSE
|
38
73
|
- README.rdoc
|
39
74
|
- Rakefile
|
40
|
-
- VERSION
|
41
75
|
- alexa.gemspec
|
42
76
|
- lib/alexa.rb
|
43
77
|
- lib/alexa/config.rb
|
44
78
|
- lib/alexa/url_info.rb
|
79
|
+
- lib/alexa/version.rb
|
45
80
|
- test/config_test.rb
|
46
81
|
- test/fixtures/empty.xml
|
47
82
|
- test/fixtures/polsl.xml
|
48
83
|
- test/fixtures/polsl_small.xml
|
49
|
-
- test/
|
84
|
+
- test/helper.rb
|
50
85
|
- test/url_info_test.rb
|
51
86
|
has_rdoc: true
|
52
|
-
homepage:
|
87
|
+
homepage: https://github.com/morgoth/alexa
|
53
88
|
licenses: []
|
54
89
|
|
55
90
|
post_install_message:
|
56
|
-
rdoc_options:
|
57
|
-
|
91
|
+
rdoc_options: []
|
92
|
+
|
58
93
|
require_paths:
|
59
94
|
- lib
|
60
95
|
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
61
97
|
requirements:
|
62
98
|
- - ">="
|
63
99
|
- !ruby/object:Gem::Version
|
100
|
+
hash: 3607547385087715805
|
101
|
+
segments:
|
102
|
+
- 0
|
64
103
|
version: "0"
|
65
|
-
version:
|
66
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
67
106
|
requirements:
|
68
107
|
- - ">="
|
69
108
|
- !ruby/object:Gem::Version
|
109
|
+
hash: 3607547385087715805
|
110
|
+
segments:
|
111
|
+
- 0
|
70
112
|
version: "0"
|
71
|
-
version:
|
72
113
|
requirements: []
|
73
114
|
|
74
|
-
rubyforge_project:
|
75
|
-
rubygems_version: 1.3.
|
115
|
+
rubyforge_project: alexa
|
116
|
+
rubygems_version: 1.3.7
|
76
117
|
signing_key:
|
77
118
|
specification_version: 3
|
78
119
|
summary: Alexa Web Information Service library
|
79
|
-
test_files:
|
80
|
-
|
81
|
-
- test/config_test.rb
|
82
|
-
- test/test_helper.rb
|
120
|
+
test_files: []
|
121
|
+
|
data/.document
DELETED
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.1.0
|
data/test/test_helper.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'test/unit'
|
3
|
-
require 'shoulda'
|
4
|
-
|
5
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
6
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
7
|
-
require 'alexa'
|
8
|
-
|
9
|
-
def fixture_file(filename)
|
10
|
-
return '' if filename == ''
|
11
|
-
file_path = File.expand_path(File.dirname(__FILE__) + '/fixtures/' + filename)
|
12
|
-
File.read(file_path)
|
13
|
-
end
|
14
|
-
|