hotspotlogin 0.1.1.2 → 0.1.1.4

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/README.rdoc CHANGED
@@ -1,4 +1,4 @@
1
- = hotspotlogin.rb
1
+ = hotspotlogin
2
2
 
3
3
  == DESCRIPTION:
4
4
 
@@ -12,13 +12,11 @@ http://github.com/gderosa/hotspotlogin.rb
12
12
 
13
13
  Installation:
14
14
 
15
- sudo gem source --add http://rubygems.org
16
-
17
15
  sudo gem install hotspotlogin
18
16
 
19
17
  On the command-line:
20
18
 
21
- $ hotspotlogin.rb [options]
19
+ $ hotspotlogin [options]
22
20
 
23
21
  ==== Options
24
22
 
@@ -50,7 +48,7 @@ See also chilli.conf(5) manual page.
50
48
 
51
49
  (The MIT License)
52
50
 
53
- Copyright (c) 2010 Guido De Rosa <job*guidoderosa.net>
51
+ Copyright (c) 2010 Guido De Rosa <guido.derosa*vemarsas.it>
54
52
 
55
53
  Permission is hereby granted, free of charge, to any person obtaining
56
54
  a copy of this software and associated documentation files (the
data/bin/hotspotlogin ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'sinatra/base'
5
+
6
+ if File.symlink? __FILE__
7
+ file = File.readlink __FILE__
8
+ else
9
+ file = __FILE__
10
+ end
11
+
12
+ require File.expand_path(
13
+ File.dirname(file) + "/../lib/hotspotlogin"
14
+ )
15
+
16
+ config = HotSpotLogin.config!
17
+
18
+ if config['daemon']
19
+ pid = fork do
20
+ if config['log']
21
+ STDOUT.reopen(config['log'], 'a')
22
+ STDERR.reopen(config['log'], 'a')
23
+ Signal.trap('USR1') do
24
+ STDOUT.flush
25
+ STDERR.flush
26
+ end
27
+ end
28
+ HotSpotLogin::App.run!
29
+ FileUtils.rm config['pid'] if config['pid'] and File.exists? config['pid']
30
+ end
31
+ if config['pid'] =~ /\S/
32
+ File.open config['pid'], 'w' do |f|
33
+ f.write pid
34
+ end
35
+ end
36
+ else # run in foreground
37
+ HotSpotLogin::App.run!
38
+ end
@@ -1,6 +1,6 @@
1
1
  module HotSpotLogin
2
2
 
3
- VERSION = '0.1.1.2'
3
+ VERSION = '0.1.1.4'
4
4
 
5
5
  DEFAULT_CONFIG = {
6
6
  'listen-address' => '0.0.0.0',
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 1
8
8
  - 1
9
- - 2
10
- version: 0.1.1.2
9
+ - 4
10
+ version: 0.1.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Guido De Rosa
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-03-08 00:00:00 +01:00
18
+ date: 2010-03-09 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -31,9 +31,9 @@ dependencies:
31
31
  type: :runtime
32
32
  version_requirements: *id001
33
33
  description: Traditionally, a PHP or Perl/CGI web page has been used to login unauthenticated users to a Network Access Controller like ChilliSpot; this hotspotlogin implementation is based on Ruby and Sinatra (the classy web framework).
34
- email: guidoderosa@gmail.com
34
+ email: guido.derosa@vemarsas.it
35
35
  executables:
36
- - hotspotlogin.rb
36
+ - hotspotlogin
37
37
  extensions: []
38
38
 
39
39
  extra_rdoc_files:
@@ -45,7 +45,7 @@ files:
45
45
  - views/hotspotlogin.erb
46
46
  - views/404.erb
47
47
  - views/_login_form.erb
48
- - bin/hotspotlogin.rb
48
+ - bin/hotspotlogin
49
49
  - lib/hotspotlogin.rb
50
50
  - lib/hotspotlogin/constants.rb
51
51
  - lib/hotspotlogin/config.rb
data/bin/hotspotlogin.rb DELETED
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Don'use this hack, since it breaks /proc/<pid>/cmdline
4
- # $0 = 'hotspotlogin.rb'
5
-
6
- require 'rubygems'
7
- require 'sinatra/base'
8
-
9
- if File.symlink? __FILE__
10
- file = File.readlink __FILE__
11
- else
12
- file = __FILE__
13
- end
14
-
15
- require File.expand_path(
16
- File.dirname(file) + "/../lib/hotspotlogin"
17
- )
18
-
19
- # The $0 hack also would break the following code :-/
20
-
21
- # RubyGems sucks 'cause it includes bin/ directories into the $LOAD_PATH
22
- #
23
- # So, this file may be actually used to just 'require' the
24
- # hotspotlogin library (in this case $0 != __FILE__)
25
-
26
- if $0 == __FILE__ # actually start hotspotlogin service
27
- config = HotSpotLogin.config!
28
-
29
- if config['daemon']
30
- pid = fork do
31
- if config['log']
32
- STDOUT.reopen(config['log'], 'a')
33
- STDERR.reopen(config['log'], 'a')
34
- Signal.trap('USR1') do
35
- STDOUT.flush
36
- STDERR.flush
37
- end
38
- end
39
- HotSpotLogin::App.run!
40
- FileUtils.rm config['pid'] if config['pid'] and File.exists? config['pid']
41
- end
42
- if config['pid'] =~ /\S/
43
- File.open config['pid'], 'w' do |f|
44
- f.write pid
45
- end
46
- end
47
- else # run in foreground
48
- HotSpotLogin::App.run!
49
- end
50
- end