local-openid 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  GVF=GIT-VERSION-FILE
4
- DEF_VER=v0.3.0.GIT
4
+ DEF_VER=v0.4.0.GIT
5
5
 
6
6
  LF='
7
7
  '
data/Rakefile CHANGED
@@ -76,12 +76,15 @@ task :fm_update do
76
76
  require 'net/netrc'
77
77
  require 'json'
78
78
  version = ENV['VERSION'] or abort "VERSION= needed"
79
- uri = URI.parse('http://freshmeat.net/projects/local-openid/releases.json')
79
+ uri = URI.parse('https://freecode.com/projects/local-openid/releases.json')
80
80
  rc = Net::Netrc.locate('local-openid-fm') or abort "~/.netrc not found"
81
81
  api_token = rc.password
82
- changelog = tags.find { |t| t[:tag] == "v#{version}" }[:body]
82
+ _, subject, body = `git cat-file tag v#{version}`.split(/\n\n/, 3)
83
83
  tmp = Tempfile.new('fm-changelog')
84
- tmp.syswrite(changelog)
84
+ tmp.puts subject
85
+ tmp.puts
86
+ tmp.puts body
87
+ tmp.flush
85
88
  system(ENV["VISUAL"], tmp.path) or abort "#{ENV["VISUAL"]} failed: #$?"
86
89
  changelog = File.read(tmp.path).strip
87
90
 
@@ -93,7 +96,12 @@ task :fm_update do
93
96
  "changelog" => changelog,
94
97
  },
95
98
  }.to_json
96
- Net::HTTP.start(uri.host, uri.port) do |http|
97
- p http.post(uri.path, req, {'Content-Type'=>'application/json'})
99
+
100
+ if ! changelog.strip.empty? && version =~ %r{\A[\d\.]+\d+\z}
101
+ Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |http|
102
+ p http.post(uri.path, req, {'Content-Type'=>'application/json'})
103
+ end
104
+ else
105
+ warn "not updating freshmeat for v#{version}"
98
106
  end
99
107
  end
@@ -160,11 +160,8 @@ class LocalOpenID < Sinatra::Base
160
160
  finalize_response(oidresp)
161
161
  end
162
162
 
163
- # we're the provider for exactly one identity. However, we do rely on
164
- # being proxied and being hit with an appropriate HTTP Host: header.
165
- # Don't expect OpenID consumers to handle port != 80.
166
163
  def server_root
167
- "http://#{request.host}/"
164
+ "#{request.base_url}/"
168
165
  end
169
166
 
170
167
  def server
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.summary = summary
21
21
  s.rdoc_options = rdoc_options
22
22
  s.rubyforge_project = %q{qrp}
23
+ s.add_dependency(%q<rack>, ["~> 1.3"])
23
24
  s.add_dependency(%q<sinatra>, ["~> 1.0"])
24
25
  s.add_dependency(%q<ruby-openid>, ["~> 2.1.7"])
25
26
  # s.licenses = %w(AGPLv3) # accessor not compatible with older RubyGems
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: local-openid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-01 00:00:00.000000000 Z
12
+ date: 2013-03-12 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rack
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.3'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.3'
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: sinatra
16
32
  requirement: !ruby/object:Gem::Requirement