titech-pubnet-auth 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -11
- data/Rakefile +3 -0
- data/bin/titech-pubnet-auth +1 -1
- data/lib/titech_pubnet_auth.rb +5 -4
- data/lib/titech_pubnet_auth/version.rb +1 -1
- data/titech_pubnet_auth.gemspec +5 -1
- metadata +73 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6d229c5d3acdffa4e0f96fc54a5a588f79687ba
|
4
|
+
data.tar.gz: 41938bad3750c15dc24772dd7a066058b906699e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35f2a9f211ed53a98c978b78f6872f8f3e0bc0074365875f4a26edc85ef6378216960544ac63aabcb61f453d500ac6ca6277172ee7fd86e6bcac2d3689b89a11
|
7
|
+
data.tar.gz: 2d3aaea8844c635ecdbc174514722eb78a42b3fe64786774f22307f77ee97e549f16ac81094c5749b53ee38a0b1d41f1fa1456576297da0e820f52507065b988
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/Altech/titech-pubnet-auth.svg?branch=master)](https://travis-ci.org/Altech/titech-pubnet-auth)
|
2
|
+
|
1
3
|
# Titech-Pubnet-Auth
|
2
4
|
## これはなに?
|
3
5
|
|
4
6
|
titech-pubnet の認証を自動で行なうための gem です。
|
5
7
|
|
6
|
-
Mac OS X Mountain Lion, Ruby1.9.3 で動作確認済みです。たぶん Ruby1.9 じゃないと動きません。
|
7
|
-
|
8
8
|
titech-pubnet の認証の仕様に依存しているため、仕様が変われば動かなくなるかもしれません。主に以下のようなものの内容に依存していると思います。
|
9
9
|
|
10
10
|
- 認証ページのドメイン
|
@@ -18,15 +18,13 @@ titech-pubnet に接続すると自動で認証が行われる(デスクトッ
|
|
18
18
|
|
19
19
|
## 使い方
|
20
20
|
|
21
|
-
参考:
|
21
|
+
参考:Ruby のインストール(Mac OS Xの場合)。
|
22
22
|
|
23
|
-
$
|
24
|
-
$ brew install ruby # Homebrewを使うなら
|
23
|
+
$ brew install ruby # Homebrewを使う場合
|
25
24
|
|
26
|
-
gem のインストール
|
25
|
+
gem のインストール
|
27
26
|
|
28
|
-
$ gem install titech-pubnet-auth
|
29
|
-
$ gem install titech-pubnet-auth -r -p http://131.112.125.238:3128 # titech-pubnetでインストールするなら
|
27
|
+
$ gem install titech-pubnet-auth # titech-pubnet 経由でインストールするなら引数として " -r -p http://131.112.125.238:3128" を追加
|
30
28
|
|
31
29
|
最初に、ユーザー名、パスワードを設定
|
32
30
|
|
@@ -45,9 +43,7 @@ gem のインストール [^1]
|
|
45
43
|
|
46
44
|
### ログイン時に起動する方法(Mac OS X の場合)
|
47
45
|
|
48
|
-
色々あるけど以下だとほぼGUIで完結する。
|
46
|
+
色々あるけど以下だとほぼGUIで完結する。CUIなら launchd など。
|
49
47
|
|
50
48
|
1. 「システム環境設定」→「ユーザとグループ」→「ログイン項目」に起動スクリプト`titech-pubnet-auth-daemon`を追加(`$ which titech-pubnet-auth-daemon`とかで場所を調べて、Finder上で⌘gでパス指定して移動できる)。
|
51
49
|
2. (デフォルトだとプロセス終了時にターミナル.appが閉じない。これが煩わしい場合、)ターミナルを起動して、「環境設定」→「設定タブ」→「シェル」で、「シェルの終了時」の動作を「ウィンドウを閉じる」にする。
|
52
|
-
|
53
|
-
[^1]: 依存している gem の一つである nokogiri(XMLパーサー)が native extension を使っていて必要なものが無いと install で失敗するかも。http://nokogiri.org/tutorials/installing_nokogiri.html を参照。
|
data/Rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
require 'rdoc/task'
|
3
3
|
require "bundler/gem_tasks"
|
4
|
+
require 'rspec/core/rake_task'
|
4
5
|
|
5
6
|
BASE_DIR = File.dirname(__FILE__)
|
6
7
|
|
@@ -9,3 +10,5 @@ require 'yard/rake/yardoc_task'
|
|
9
10
|
YARD::Rake::YardocTask.new do |t|
|
10
11
|
t.files = ['README.md','lib/**/*.rb']
|
11
12
|
end
|
13
|
+
|
14
|
+
RSpec::Core::RakeTask.new(:spec)
|
data/bin/titech-pubnet-auth
CHANGED
data/lib/titech_pubnet_auth.rb
CHANGED
@@ -4,7 +4,7 @@ require 'mechanize'
|
|
4
4
|
require 'uri'
|
5
5
|
require 'yaml'
|
6
6
|
|
7
|
-
$:.unshift(
|
7
|
+
$:.unshift(File.dirname(__FILE__))
|
8
8
|
require 'titech_pubnet_auth/bin_routines'
|
9
9
|
require 'titech_pubnet_auth/extensions'
|
10
10
|
|
@@ -13,7 +13,8 @@ class TitechPubnetAuth
|
|
13
13
|
SAMPLE_URI = URI "http://example.org"
|
14
14
|
HTTP_PROXY = {ip: '131.112.125.238', port: 3128}
|
15
15
|
|
16
|
-
def initialize(opt
|
16
|
+
def initialize(opt)
|
17
|
+
opt = {open_timeout: 5}.merge(opt)
|
17
18
|
@agent, @agent_with_proxy = Mechanize.new, Mechanize.new
|
18
19
|
[@agent, @agent_with_proxy].each{|agent|
|
19
20
|
agent.follow_meta_refresh = true
|
@@ -21,7 +22,7 @@ class TitechPubnetAuth
|
|
21
22
|
}
|
22
23
|
@agent_with_proxy.set_proxy(HTTP_PROXY[:ip], HTTP_PROXY[:port])
|
23
24
|
|
24
|
-
@private = YAML.load_file(
|
25
|
+
@private = opt[:private] || YAML.load_file(File.dirname(__FILE__) + '/../config/private.yml')
|
25
26
|
end
|
26
27
|
|
27
28
|
#
|
@@ -40,7 +41,7 @@ class TitechPubnetAuth
|
|
40
41
|
|
41
42
|
return is_connected?
|
42
43
|
end
|
43
|
-
|
44
|
+
|
44
45
|
#
|
45
46
|
# called if network_available?
|
46
47
|
#
|
data/titech_pubnet_auth.gemspec
CHANGED
@@ -20,5 +20,9 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.add_dependency 'colorize'
|
21
21
|
gem.add_dependency 'mechanize', '~> 2.7'
|
22
22
|
gem.add_dependency 'terminal-notifier', '~> 1.4'
|
23
|
-
|
23
|
+
|
24
|
+
gem.add_development_dependency 'rake'
|
25
|
+
gem.add_development_dependency 'rspec'
|
26
|
+
gem.add_development_dependency 'yard'
|
27
|
+
gem.add_development_dependency 'webmock'
|
24
28
|
end
|
metadata
CHANGED
@@ -1,57 +1,113 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: titech-pubnet-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sohei Takeno
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mechanize
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.7'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.7'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: terminal-notifier
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.4'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.4'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: yard
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: webmock
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
55
111
|
description: This gem provides automatic authentication for titech-pubnet.
|
56
112
|
email:
|
57
113
|
- takeno.sh@gmail.com
|
@@ -61,16 +117,16 @@ executables:
|
|
61
117
|
extensions: []
|
62
118
|
extra_rdoc_files: []
|
63
119
|
files:
|
120
|
+
- Gemfile
|
121
|
+
- README.md
|
122
|
+
- Rakefile
|
123
|
+
- bin/titech-pubnet-auth
|
124
|
+
- bin/titech-pubnet-auth-daemon
|
125
|
+
- config/private.yml.example
|
64
126
|
- lib/titech_pubnet_auth.rb
|
65
127
|
- lib/titech_pubnet_auth/bin_routines.rb
|
66
128
|
- lib/titech_pubnet_auth/extensions.rb
|
67
129
|
- lib/titech_pubnet_auth/version.rb
|
68
|
-
- bin/titech-pubnet-auth
|
69
|
-
- bin/titech-pubnet-auth-daemon
|
70
|
-
- config/private.yml.example
|
71
|
-
- Rakefile
|
72
|
-
- Gemfile
|
73
|
-
- README.md
|
74
130
|
- titech_pubnet_auth.gemspec
|
75
131
|
homepage: http://for-titech.herokuapp.com
|
76
132
|
licenses: []
|
@@ -81,17 +137,17 @@ require_paths:
|
|
81
137
|
- lib
|
82
138
|
required_ruby_version: !ruby/object:Gem::Requirement
|
83
139
|
requirements:
|
84
|
-
- -
|
140
|
+
- - ">="
|
85
141
|
- !ruby/object:Gem::Version
|
86
142
|
version: '0'
|
87
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
144
|
requirements:
|
89
|
-
- -
|
145
|
+
- - ">="
|
90
146
|
- !ruby/object:Gem::Version
|
91
147
|
version: '0'
|
92
148
|
requirements: []
|
93
149
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.0
|
150
|
+
rubygems_version: 2.2.0
|
95
151
|
signing_key:
|
96
152
|
specification_version: 4
|
97
153
|
summary: This gem provides automatic authentication for titech-pubnet.
|