tunnlr 0.0.2 → 0.1.0
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 +28 -0
- data/init.rb +1 -0
- data/lib/{tunnlr/tasks.rb → tasks/tunnlr_connector_tasks.rake} +7 -7
- data/lib/tunnlr/configurator.rb +7 -7
- data/lib/tunnlr/connector.rb +2 -2
- data/lib/tunnlr/railtie.rb +12 -0
- data/lib/tunnlr.rb +9 -0
- data/rails/init.rb +1 -0
- metadata +64 -64
- data/Manifest +0 -13
- data/Rakefile +0 -39
- data/tasks/tunnlr_connector_tasks.rake +0 -4
- data/test/tunnlr_connector_test.rb +0 -8
- data/tunnlr.gemspec +0 -33
- data/tunnlr.yml +0 -4
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -3
data/README
CHANGED
@@ -9,6 +9,34 @@ gem install --source http://gems.jamisbuck.org net-ssh
|
|
9
9
|
|
10
10
|
To run autoconfigure, it also requires the highline gem which is installed as part of capistrano.
|
11
11
|
|
12
|
+
Installation
|
13
|
+
============
|
14
|
+
|
15
|
+
Rails 2
|
16
|
+
-------
|
17
|
+
|
18
|
+
Add the gem to config/development.rb
|
19
|
+
|
20
|
+
config.gem 'tunnlr_connector', :lib => false
|
21
|
+
|
22
|
+
And add the following to the end of Rakefile
|
23
|
+
|
24
|
+
begin
|
25
|
+
require 'tunnlr'
|
26
|
+
Tunnlr.load_tasks if defined?(Tunnlr)
|
27
|
+
rescue LoadError => loaderror
|
28
|
+
$stderr.puts %{Couldn't load tunnlr}
|
29
|
+
end
|
30
|
+
|
31
|
+
Rails 3
|
32
|
+
-------
|
33
|
+
|
34
|
+
Add the gem to the development group of your Gemfile
|
35
|
+
|
36
|
+
gem 'tunnlr_connector', :require => false
|
37
|
+
|
38
|
+
That's it!
|
39
|
+
|
12
40
|
Example
|
13
41
|
=======
|
14
42
|
|
data/init.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'tunnlr'
|
@@ -1,16 +1,16 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), "..", "tunnlr")
|
2
|
-
# desc "Explaining what the task does"
|
3
|
-
# task :tunnlr_connector do
|
4
|
-
# # Task goes here
|
5
|
-
# end
|
6
|
-
desc "Create a tunnel"
|
7
1
|
namespace :tunnlr do
|
2
|
+
|
3
|
+
desc "Create a tunnel"
|
8
4
|
task :start => :environment do
|
9
5
|
Tunnlr::Connector.new.connect!
|
10
6
|
end
|
7
|
+
|
8
|
+
desc "Write the tunnlr.yml file to your apps config directory"
|
11
9
|
task :configure => :environment do
|
12
|
-
Tunnlr::Configurator.new.configure(File.join(
|
10
|
+
Tunnlr::Configurator.new.configure(File.join(Rails.root,"config","tunnlr.yml"))
|
13
11
|
end
|
12
|
+
|
13
|
+
desc "Tunnlr UI requires the rubywx library"
|
14
14
|
task :ui => :environment do
|
15
15
|
require 'tunnlr/ui'
|
16
16
|
Tunnlr::Ui::MainApp.new.main_loop
|
data/lib/tunnlr/configurator.rb
CHANGED
@@ -2,20 +2,19 @@ require 'highline'
|
|
2
2
|
require 'net/ssh'
|
3
3
|
module Tunnlr
|
4
4
|
class Configurator
|
5
|
-
attr_accessor :not_configured
|
5
|
+
attr_accessor :not_configured,:email,:password,:subdomain
|
6
6
|
def initialize
|
7
7
|
@ui = HighLine.new
|
8
8
|
@not_configured=true
|
9
9
|
end
|
10
10
|
|
11
|
-
def fetch(username,
|
12
|
-
url=URI.parse("http://#{
|
11
|
+
def fetch(username,password)
|
12
|
+
url=URI.parse("http://#{subdomain}.tunnlr.com/configuration.yml")
|
13
13
|
req = Net::HTTP::Get.new(url.path)
|
14
14
|
req.basic_auth(username,password)
|
15
15
|
res = Net::HTTP.start(url.host, url.port) {|http|
|
16
16
|
http.request(req)
|
17
17
|
}
|
18
|
-
res.value
|
19
18
|
@configuration = res.body
|
20
19
|
end
|
21
20
|
|
@@ -30,17 +29,18 @@ module Tunnlr
|
|
30
29
|
end
|
31
30
|
|
32
31
|
def get_credentials
|
33
|
-
puts "Enter the email address
|
32
|
+
puts "Enter the email address and password you used to sign up for Tunnlr."
|
33
|
+
self.subdomain = @ui.ask("Subdomain (i.e. elevatedrails for elevatedrails.tunnlr.com): ")
|
34
34
|
self.email = @ui.ask("Email: ")
|
35
35
|
self.password = @ui.ask("Password: ") { |q| q.echo = false }
|
36
|
-
|
36
|
+
fetch(email,password)
|
37
37
|
end
|
38
38
|
|
39
39
|
def configure(path)
|
40
40
|
while not_configured
|
41
41
|
begin
|
42
42
|
get_credentials
|
43
|
-
fetch(email,
|
43
|
+
fetch(subdomain,email,password)
|
44
44
|
add_password
|
45
45
|
write_config(path)
|
46
46
|
puts "Created configuration in #{path}"
|
data/lib/tunnlr/connector.rb
CHANGED
@@ -25,7 +25,7 @@ module Tunnlr
|
|
25
25
|
rescue Interrupt=>e
|
26
26
|
raise
|
27
27
|
rescue Exception=>e
|
28
|
-
puts "Swallowing: #{e.class.to_s}"
|
28
|
+
puts "Swallowing: #{e.class.to_s} => #{e.to_s}"
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -42,7 +42,7 @@ module Tunnlr
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def read_configuration
|
45
|
-
path = File.join(
|
45
|
+
path = File.join(Rails.root, "config/tunnlr.yml")
|
46
46
|
YAML.load(File.read(path))
|
47
47
|
end
|
48
48
|
|
data/lib/tunnlr.rb
CHANGED
@@ -1,3 +1,12 @@
|
|
1
1
|
require 'tunnlr/connector'
|
2
2
|
require 'tunnlr/configurator'
|
3
3
|
|
4
|
+
module Tunnlr
|
5
|
+
puts 'Loaded'
|
6
|
+
def self.load_tasks
|
7
|
+
Dir[File.expand_path("tasks/*.rake", File.dirname(__FILE__))].each { |ext| load ext }
|
8
|
+
end
|
9
|
+
|
10
|
+
require 'tunnlr/railtie' if defined?(Rails) && Rails::VERSION::MAJOR >= 3
|
11
|
+
|
12
|
+
end
|
data/rails/init.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__),'../init.rb')
|
metadata
CHANGED
@@ -1,108 +1,108 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tunnlr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
|
-
- James McCarthy
|
13
|
+
- Mike Mangino, James McCarthy
|
8
14
|
autorequire:
|
9
15
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
- |
|
12
|
-
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRcwFQYDVQQDDA5qYW1l
|
14
|
-
czJtY2NhcnRoeTEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQB
|
15
|
-
GRYDY29tMB4XDTEwMDExNDAyNTcwN1oXDTExMDExNDAyNTcwN1owRTEXMBUGA1UE
|
16
|
-
AwwOamFtZXMybWNjYXJ0aHkxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmS
|
17
|
-
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMSJ
|
18
|
-
dc/DqHygIZLgtd37Zrj3WFxTP2vuDXAn2XsiOzT5nE0RHuempdnyjgDd5w0O5dCs
|
19
|
-
AdhlhjBLKdGTrPCQzd617iPK5J/wPvmhNyfsLdQMPMTT03phur67Z1S5jbbI+jlm
|
20
|
-
1XEum1EmP/9o/0OT4ryDiGrbOxkwMg64rOVMJq97TVv9NsvmbDbfeadpNOgZPXmX
|
21
|
-
VT6vz7xfIwrPmXHY7GX6sgofag65RmZDSRrfEnYiRcndIzuf9XrU4AuDQXeQFScH
|
22
|
-
dc7SbTP3MxcuQBpxznmIsyXqPX9tPkai5/ANvDumSh0r/RtZjZK4GvDf1OA+mf77
|
23
|
-
CvtiGXk4pkqU5YLwU7UCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
24
|
-
HQYDVR0OBBYEFKpxJcjZarHvCZ6l0zBrWAyuiq4MMA0GCSqGSIb3DQEBBQUAA4IB
|
25
|
-
AQCzT8B309wAsEk9pCG9ANtafpl6zBpwcujS7Pf6oJNyEdjGIT10o8/hKIeF9zaj
|
26
|
-
2ph8MKt+Z45YUQX6aBLwzVe+YwDXWD3Kckbgw4k4DDXvxsX8u7yVfeO90lkKDu+y
|
27
|
-
YCjOQPMq6NX5cltDJGuCN8riOr3Z8483xM8cB7J91cgEqMTZ8KV7RIVRDP9i9Ws7
|
28
|
-
TgHLd994oJ7F/eGTtOrmaYwvbKPx1y12OiENMrh/37H/1FAxvOCb2DtmfudvSdCU
|
29
|
-
tj9UO8RHdhDQNHk4s0KDdx0XLLyScip9Cl0zrCnGlwHCtr/LAMcztldKu6MgTTmG
|
30
|
-
592P7ckv8ZwmaiTXGc7jmehg
|
31
|
-
-----END CERTIFICATE-----
|
16
|
+
cert_chain: []
|
32
17
|
|
33
|
-
date: 2010-
|
18
|
+
date: 2010-04-06 00:00:00 +01:00
|
34
19
|
default_executable:
|
35
20
|
dependencies:
|
36
21
|
- !ruby/object:Gem::Dependency
|
37
22
|
name: net-ssh
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 17
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 0
|
33
|
+
- 15
|
34
|
+
version: 2.0.15
|
38
35
|
type: :runtime
|
39
|
-
|
40
|
-
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: highline
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
41
42
|
requirements:
|
42
43
|
- - ">="
|
43
44
|
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
hash: 3
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 5
|
49
|
+
- 0
|
50
|
+
version: 1.5.0
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
description: A simple Rubygem to make your local developnment environment available to the internet using the tunnlr.com service
|
54
|
+
email:
|
55
|
+
- james2mccarthy@gmail.com
|
48
56
|
executables: []
|
49
57
|
|
50
58
|
extensions: []
|
51
59
|
|
52
|
-
extra_rdoc_files:
|
53
|
-
|
54
|
-
- tasks/tunnlr_connector_tasks.rake
|
55
|
-
- lib/tunnlr.rb
|
56
|
-
- lib/tunnlr/configurator.rb
|
57
|
-
- lib/tunnlr/connector.rb
|
58
|
-
- lib/tunnlr/ui.rb
|
59
|
-
- lib/tunnlr/tasks.rb
|
60
|
+
extra_rdoc_files: []
|
61
|
+
|
60
62
|
files:
|
61
|
-
-
|
62
|
-
- Manifest
|
63
|
-
- README
|
64
|
-
- Rakefile
|
65
|
-
- tasks/tunnlr_connector_tasks.rake
|
66
|
-
- lib/tunnlr.rb
|
63
|
+
- lib/tasks/tunnlr_connector_tasks.rake
|
67
64
|
- lib/tunnlr/configurator.rb
|
68
65
|
- lib/tunnlr/connector.rb
|
66
|
+
- lib/tunnlr/railtie.rb
|
69
67
|
- lib/tunnlr/ui.rb
|
70
|
-
- lib/tunnlr
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
68
|
+
- lib/tunnlr.rb
|
69
|
+
- init.rb
|
70
|
+
- README
|
71
|
+
- MIT-LICENSE
|
72
|
+
- rails/init.rb
|
74
73
|
has_rdoc: true
|
75
|
-
homepage: http://
|
74
|
+
homepage: http://tunnlr.com
|
76
75
|
licenses: []
|
77
76
|
|
78
77
|
post_install_message:
|
79
|
-
rdoc_options:
|
80
|
-
|
81
|
-
- --inline-source
|
82
|
-
- --title
|
83
|
-
- Tunnlr
|
84
|
-
- --main
|
85
|
-
- README
|
78
|
+
rdoc_options: []
|
79
|
+
|
86
80
|
require_paths:
|
87
81
|
- lib
|
88
82
|
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
89
84
|
requirements:
|
90
85
|
- - ">="
|
91
86
|
- !ruby/object:Gem::Version
|
87
|
+
hash: 3
|
88
|
+
segments:
|
89
|
+
- 0
|
92
90
|
version: "0"
|
93
|
-
version:
|
94
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
95
93
|
requirements:
|
96
94
|
- - ">="
|
97
95
|
- !ruby/object:Gem::Version
|
98
|
-
|
99
|
-
|
96
|
+
hash: 3
|
97
|
+
segments:
|
98
|
+
- 0
|
99
|
+
version: "0"
|
100
100
|
requirements: []
|
101
101
|
|
102
102
|
rubyforge_project: tunnlr
|
103
|
-
rubygems_version: 1.
|
103
|
+
rubygems_version: 1.4.2
|
104
104
|
signing_key:
|
105
105
|
specification_version: 3
|
106
|
-
summary:
|
107
|
-
test_files:
|
108
|
-
|
106
|
+
summary: Provide access to the tunnlr.com service. This is now just a fork of https://github.com/mmangino/tunnlr_connector with a little extra Rails3 integration. Will drop this gem when my changes are rolled into the mmangino's gem.
|
107
|
+
test_files: []
|
108
|
+
|
data/Manifest
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
MIT-LICENSE
|
2
|
-
Manifest
|
3
|
-
README
|
4
|
-
Rakefile
|
5
|
-
tunnlr.gemspec
|
6
|
-
tasks/tunnlr_connector_tasks.rake
|
7
|
-
lib/tunnlr.rb
|
8
|
-
lib/tunnlr/configurator.rb
|
9
|
-
lib/tunnlr/connector.rb
|
10
|
-
lib/tunnlr/ui.rb
|
11
|
-
lib/tunnlr/tasks.rb
|
12
|
-
test/tunnlr_connector_test.rb
|
13
|
-
tunnlr.yml
|
data/Rakefile
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rake/testtask'
|
3
|
-
require 'rake/rdoctask'
|
4
|
-
require 'rubygems'
|
5
|
-
require 'echoe'
|
6
|
-
|
7
|
-
$LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
|
8
|
-
require 'tunnlr'
|
9
|
-
|
10
|
-
desc 'Default: run unit tests.'
|
11
|
-
task :default => :test
|
12
|
-
|
13
|
-
desc 'Test the tunnlr_connector plugin.'
|
14
|
-
Rake::TestTask.new(:test) do |t|
|
15
|
-
t.libs << 'lib'
|
16
|
-
t.pattern = 'test/**/*_test.rb'
|
17
|
-
t.verbose = true
|
18
|
-
end
|
19
|
-
|
20
|
-
desc 'Generate documentation for the tunnlr_connector plugin.'
|
21
|
-
Rake::RDocTask.new(:rdoc) do |rdoc|
|
22
|
-
rdoc.rdoc_dir = 'rdoc'
|
23
|
-
rdoc.title = 'TunnlrConnector'
|
24
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
25
|
-
rdoc.rdoc_files.include('README')
|
26
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
27
|
-
end
|
28
|
-
|
29
|
-
|
30
|
-
Echoe.new('tunnlr', '0.0.2') do |p|
|
31
|
-
p.description = "A gem version of the tunnlr rails plugin"
|
32
|
-
p.url = "http://github.com/james2m/tunnlr"
|
33
|
-
p.author = "James McCarthy"
|
34
|
-
p.email = "james2mccarthy @nospam@ gmail.com"
|
35
|
-
p.ignore_pattern = ["tmp/*", "script/*"]
|
36
|
-
p.development_dependencies = []
|
37
|
-
end
|
38
|
-
|
39
|
-
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
data/tunnlr.gemspec
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = %q{tunnlr}
|
5
|
-
s.version = "0.0.2"
|
6
|
-
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["James McCarthy"]
|
9
|
-
s.date = %q{2010-01-14}
|
10
|
-
s.description = %q{A gem version of the tunnlr rails plugin}
|
11
|
-
s.email = %q{james2mccarthy @nospam@ gmail.com}
|
12
|
-
s.extra_rdoc_files = ["README", "tasks/tunnlr_connector_tasks.rake", "lib/tunnlr.rb", "lib/tunnlr/configurator.rb", "lib/tunnlr/connector.rb", "lib/tunnlr/ui.rb", "lib/tunnlr/tasks.rb"]
|
13
|
-
s.files = ["MIT-LICENSE", "Manifest", "README", "Rakefile", "tasks/tunnlr_connector_tasks.rake", "lib/tunnlr.rb", "lib/tunnlr/configurator.rb", "lib/tunnlr/connector.rb", "lib/tunnlr/ui.rb", "lib/tunnlr/tasks.rb", "test/tunnlr_connector_test.rb", "tunnlr.yml", "tunnlr.gemspec"]
|
14
|
-
s.homepage = %q{http://github.com/james2m/tunnlr}
|
15
|
-
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Tunnlr", "--main", "README"]
|
16
|
-
s.require_paths = ["lib"]
|
17
|
-
s.rubyforge_project = %q{tunnlr}
|
18
|
-
s.rubygems_version = %q{1.3.5}
|
19
|
-
s.summary = %q{A gem version of the tunnlr rails plugin}
|
20
|
-
s.test_files = ["test/tunnlr_connector_test.rb"]
|
21
|
-
s.add_dependency('net-ssh', ['>= 2.0.0'])
|
22
|
-
s.signing_key = '/Users/james/Secure/Certificates/gem-keys/tunnlr-gem-private_key.pem'
|
23
|
-
s.cert_chain = ['gem-public_cert.pem']
|
24
|
-
if s.respond_to? :specification_version then
|
25
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
26
|
-
s.specification_version = 3
|
27
|
-
|
28
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
29
|
-
else
|
30
|
-
end
|
31
|
-
else
|
32
|
-
end
|
33
|
-
end
|
data/tunnlr.yml
DELETED
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED