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 ADDED
@@ -0,0 +1,8 @@
1
+ * 0.1.1* (May 16th, 2007)
2
+ Multibyte graphname Bug Fix
3
+ - http://d.hatena.ne.jp/takatoh/20070502/hatenagraph (thanks!)
4
+ use proxy
5
+ - http://sho.tdiary.net/20070112.html#p01 (thanks!)
6
+
7
+ * 0.1.0*
8
+ first release
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 'rbconfig'
4
- include Config
5
-
6
- PKG_NAME = 'hatenaapigraph'
7
- PKG_VERSION = File.read('VERSION').chomp
8
- PKG_FILES = FileList["**/*"].exclude(".svn").exclude("pkg")
9
-
10
- desc "Installing library"
11
- task :install do
12
- ruby 'install.rb'
13
- end
14
-
15
- desc "Testing library"
16
- task :test do
17
- # ruby 'test/method_test.rb'
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
- desc "Removing generated files"
21
- task :clean do
22
- rm_rf 'doc'
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
- # Create RDOC documentation.
26
- task :doc do
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::GemPackageTask.new(spec) do |pkg|
79
- pkg.need_tar = true
80
- pkg.package_files += PKG_FILES
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 ]
@@ -26,7 +26,7 @@ module Hatena
26
26
  'X-WSSE' => wsse(@username, @password),
27
27
  }
28
28
  params = {
29
- :graphname => URI::encode(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
- ::Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
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)
@@ -0,0 +1,11 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class HatenaapigraphTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ end
7
+
8
+ def test_truth
9
+ assert true
10
+ end
11
+ end
@@ -0,0 +1,2 @@
1
+ require 'test/unit'
2
+ require File.dirname(__FILE__) + '/../lib/hatena/api/graph'
metadata CHANGED
@@ -1,62 +1,64 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
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.0
7
- date: 2006-10-12 00:00:00 +09:00
8
- summary: Hatena Graph API.
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: secondlife@no.spam@hatena.ne.jp
12
- homepage: http://hatenaapigraph.rubyforge.net
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: hatena/api/graph
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: 0.0.0
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
- - Yuichi Tateno
30
+ - gorou
30
31
  files:
31
- - lib
32
- - test
33
- - Rakefile
34
32
  - README
35
- - VERSION
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
- - -A cattr_accessor=object
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
- - json
53
- dependencies:
54
- - !ruby/object:Gem::Dependency
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