hatenaapigraph 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +8 -0
- data/Rakefile +94 -74
- data/lib/hatena/api/graph.rb +5 -2
- data/test/hatenaapigraph_test.rb +11 -0
- data/test/test_helper.rb +2 -0
- metadata +30 -28
- data/VERSION +0 -1
data/CHANGELOG
ADDED
data/Rakefile
CHANGED
@@ -1,83 +1,103 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/clean'
|
4
|
+
require 'rake/testtask'
|
5
|
+
require 'rake/packagetask'
|
1
6
|
require 'rake/gempackagetask'
|
2
|
-
|
3
|
-
require '
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
require 'rake/rdoctask'
|
8
|
+
require 'rake/contrib/rubyforgepublisher'
|
9
|
+
require 'fileutils'
|
10
|
+
include FileUtils
|
11
|
+
require File.join(File.dirname(__FILE__), 'lib', 'hatena', 'api', 'graph')
|
12
|
+
|
13
|
+
AUTHOR = "gorou"
|
14
|
+
EMAIL = "your contact email for bug fixes and info"
|
15
|
+
DESCRIPTION = "description of gem"
|
16
|
+
RUBYFORGE_PROJECT = "hatenaapigraph"
|
17
|
+
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
18
|
+
BIN_FILES = %w( )
|
19
|
+
|
20
|
+
|
21
|
+
NAME = "hatenaapigraph"
|
22
|
+
REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
|
23
|
+
VERS = ENV['VERSION'] || (Hatena::API::Graph::VERSION::STRING + (REV ? ".#{REV}" : ""))
|
24
|
+
CLEAN.include ['**/.*.sw?', '*.gem', '.config']
|
25
|
+
RDOC_OPTS = ['--quiet', '--title', "hatenaapigraph documentation",
|
26
|
+
"--opname", "index.html",
|
27
|
+
"--line-numbers",
|
28
|
+
"--main", "README",
|
29
|
+
"--inline-source"]
|
30
|
+
|
31
|
+
desc "Packages up hatenaapigraph gem."
|
32
|
+
task :default => [:test]
|
33
|
+
task :package => [:clean]
|
34
|
+
|
35
|
+
Rake::TestTask.new("test") { |t|
|
36
|
+
t.libs << "test"
|
37
|
+
t.pattern = "test/**/*_test.rb"
|
38
|
+
t.verbose = true
|
39
|
+
}
|
40
|
+
|
41
|
+
spec =
|
42
|
+
Gem::Specification.new do |s|
|
43
|
+
s.name = NAME
|
44
|
+
s.version = VERS
|
45
|
+
s.platform = Gem::Platform::RUBY
|
46
|
+
s.has_rdoc = true
|
47
|
+
s.extra_rdoc_files = ["README", "CHANGELOG"]
|
48
|
+
s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)/']
|
49
|
+
s.summary = DESCRIPTION
|
50
|
+
s.description = DESCRIPTION
|
51
|
+
s.author = AUTHOR
|
52
|
+
s.email = EMAIL
|
53
|
+
s.homepage = HOMEPATH
|
54
|
+
s.executables = BIN_FILES
|
55
|
+
s.rubyforge_project = RUBYFORGE_PROJECT
|
56
|
+
s.bindir = "bin"
|
57
|
+
s.require_path = "lib"
|
58
|
+
s.autorequire = "hatenaapigraph"
|
59
|
+
|
60
|
+
#s.add_dependency('activesupport', '>=1.3.1')
|
61
|
+
s.required_ruby_version = '>= 1.8.4'
|
62
|
+
|
63
|
+
s.files = %w(README CHANGELOG Rakefile) +
|
64
|
+
Dir.glob("{bin,doc,test,lib,templates,generator,extras,website,script}/**/*") +
|
65
|
+
Dir.glob("ext/**/*.{h,c,rb}") +
|
66
|
+
Dir.glob("examples/**/*.rb") +
|
67
|
+
Dir.glob("tools/*.rb")
|
68
|
+
|
69
|
+
# s.extensions = FileList["ext/**/extconf.rb"].to_a
|
70
|
+
end
|
71
|
+
|
72
|
+
Rake::GemPackageTask.new(spec) do |p|
|
73
|
+
p.need_tar = true
|
74
|
+
p.gem_spec = spec
|
18
75
|
end
|
19
76
|
|
20
|
-
|
21
|
-
|
22
|
-
|
77
|
+
task :install do
|
78
|
+
name = "#{NAME}-#{VERS}.gem"
|
79
|
+
sh %{rake package}
|
80
|
+
sh %{sudo gem install pkg/#{name}}
|
23
81
|
end
|
24
82
|
|
25
|
-
|
26
|
-
|
27
|
-
sh 'rdoc -d -S -o doc README lib/hatena/api/graph.rb'
|
28
|
-
end
|
29
|
-
|
30
|
-
spec = Gem::Specification.new do |s|
|
31
|
-
#### Basic information.
|
32
|
-
|
33
|
-
s.name = 'hatenaapigraph'
|
34
|
-
s.version = PKG_VERSION
|
35
|
-
s.summary = "Hatena Graph API."
|
36
|
-
s.description = ""
|
37
|
-
|
38
|
-
#### Dependencies and requirements.
|
39
|
-
|
40
|
-
s.add_dependency('json', '>= 0.4.1')
|
41
|
-
s.requirements << "json"
|
42
|
-
|
43
|
-
s.files = PKG_FILES
|
44
|
-
|
45
|
-
#### C code extensions.
|
46
|
-
|
47
|
-
#s.extensions << "ext/extconf.rb"
|
48
|
-
|
49
|
-
#### Load-time details: library and application (you will need one or both).
|
50
|
-
|
51
|
-
s.require_path = 'lib' # Use these for libraries.
|
52
|
-
s.autorequire = 'hatena/api/graph'
|
53
|
-
|
54
|
-
# s.bindir = "bin" # Use these for applications.
|
55
|
-
# s.executables = ["hatenaapigraph.rb"]
|
56
|
-
# s.default_executable = "hatenaapigraph.rb"
|
57
|
-
|
58
|
-
#### Documentation and testing.
|
59
|
-
|
60
|
-
s.has_rdoc = true
|
61
|
-
#s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
|
62
|
-
s.extra_rdoc_files = 'README'
|
63
|
-
s.rdoc_options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
|
64
|
-
#s.rdoc_options <<
|
65
|
-
# '--title' << 'Rake -- Ruby Make' <<
|
66
|
-
# '--main' << 'README' <<
|
67
|
-
# '--line-numbers'
|
68
|
-
#s.test_files << 'test/method_test.rb'
|
69
|
-
|
70
|
-
#### Author and project details.
|
71
|
-
|
72
|
-
s.author = "Yuichi Tateno"
|
73
|
-
s.email = "secondlife@no.spam@hatena.ne.jp"
|
74
|
-
s.homepage = "http://hatenaapigraph.rubyforge.net"
|
75
|
-
s.rubyforge_project = "hatenaapigraph"
|
83
|
+
task :uninstall => [:clean] do
|
84
|
+
sh %{sudo gem uninstall #{NAME}}
|
76
85
|
end
|
77
86
|
|
78
|
-
Rake::
|
79
|
-
|
80
|
-
|
87
|
+
Rake::RDocTask.new { |rdoc|
|
88
|
+
rdoc.rdoc_dir = 'html'
|
89
|
+
rdoc.options += RDOC_OPTS
|
90
|
+
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
91
|
+
if ENV['DOC_FILES']
|
92
|
+
rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
|
93
|
+
else
|
94
|
+
rdoc.rdoc_files.include('README', 'CHANGELOG')
|
95
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
96
|
+
end
|
97
|
+
}
|
98
|
+
|
99
|
+
desc "Publish to RubyForge"
|
100
|
+
task :rubyforge => [:rdoc, :package] do
|
101
|
+
Rake::RubyForgePublisher.new(RUBYFORGE_PROJECT, 'secondlife').upload
|
81
102
|
end
|
82
103
|
|
83
|
-
task :release => [ :clean, :package ]
|
data/lib/hatena/api/graph.rb
CHANGED
@@ -26,7 +26,7 @@ module Hatena
|
|
26
26
|
'X-WSSE' => wsse(@username, @password),
|
27
27
|
}
|
28
28
|
params = {
|
29
|
-
:graphname =>
|
29
|
+
:graphname => graphname,
|
30
30
|
:date => date,
|
31
31
|
:value => value,
|
32
32
|
}
|
@@ -40,7 +40,10 @@ module Hatena
|
|
40
40
|
req = ::Net::HTTP::Post.new(url.path, headers)
|
41
41
|
req.form_data = params
|
42
42
|
req.basic_auth url.user, url.password if url.user
|
43
|
-
|
43
|
+
proxy_host, proxy_port = (ENV['HTTP_PROXY'] || '').split(/:/)
|
44
|
+
::Net::HTTP::Proxy(proxy_host, proxy_port.to_i).start(url.host, url.port) {|http|
|
45
|
+
http.request(req)
|
46
|
+
}
|
44
47
|
end
|
45
48
|
|
46
49
|
def wsse(username, password)
|
data/test/test_helper.rb
ADDED
metadata
CHANGED
@@ -1,62 +1,64 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.1
|
3
3
|
specification_version: 1
|
4
4
|
name: hatenaapigraph
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date:
|
8
|
-
summary:
|
6
|
+
version: 0.1.1
|
7
|
+
date: 2007-05-17 00:00:00 +09:00
|
8
|
+
summary: description of gem
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
|
-
email:
|
12
|
-
homepage: http://hatenaapigraph.rubyforge.
|
11
|
+
email: your contact email for bug fixes and info
|
12
|
+
homepage: http://hatenaapigraph.rubyforge.org
|
13
13
|
rubyforge_project: hatenaapigraph
|
14
|
-
description:
|
15
|
-
autorequire:
|
14
|
+
description: description of gem
|
15
|
+
autorequire: hatenaapigraph
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
18
18
|
has_rdoc: true
|
19
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
20
|
requirements:
|
21
|
-
- - "
|
21
|
+
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
23
|
+
version: 1.8.4
|
24
24
|
version:
|
25
25
|
platform: ruby
|
26
26
|
signing_key:
|
27
27
|
cert_chain:
|
28
|
+
post_install_message:
|
28
29
|
authors:
|
29
|
-
-
|
30
|
+
- gorou
|
30
31
|
files:
|
31
|
-
- lib
|
32
|
-
- test
|
33
|
-
- Rakefile
|
34
32
|
- README
|
35
|
-
-
|
33
|
+
- CHANGELOG
|
34
|
+
- Rakefile
|
35
|
+
- test/hatenaapigraph_test.rb
|
36
|
+
- test/test_helper.rb
|
36
37
|
- lib/hatena
|
37
38
|
- lib/hatena/api
|
38
39
|
- lib/hatena/api/graph.rb
|
39
40
|
test_files: []
|
40
41
|
|
41
42
|
rdoc_options:
|
43
|
+
- --quiet
|
44
|
+
- --title
|
45
|
+
- hatenaapigraph documentation
|
46
|
+
- --opname
|
47
|
+
- index.html
|
42
48
|
- --line-numbers
|
49
|
+
- --main
|
50
|
+
- README
|
43
51
|
- --inline-source
|
44
|
-
-
|
52
|
+
- --exclude
|
53
|
+
- ^(examples|extras)/
|
45
54
|
extra_rdoc_files:
|
46
55
|
- README
|
56
|
+
- CHANGELOG
|
47
57
|
executables: []
|
48
58
|
|
49
59
|
extensions: []
|
50
60
|
|
51
|
-
requirements:
|
52
|
-
|
53
|
-
dependencies:
|
54
|
-
|
55
|
-
name: json
|
56
|
-
version_requirement:
|
57
|
-
version_requirements: !ruby/object:Gem::Version::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.4.1
|
62
|
-
version:
|
61
|
+
requirements: []
|
62
|
+
|
63
|
+
dependencies: []
|
64
|
+
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.1.0
|