masquito 1.0 → 1.0.1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 475805dc608ba0ec90ad60fe06e97e808c6df2d4
4
+ data.tar.gz: 064c50eede7608e545e02882de927db547aef397
5
+ SHA512:
6
+ metadata.gz: 2c47cb5b111aadaa9aec0c214c2078b2c2d423b04e4d6a5d8a7f2d026d153dd801d4fcdcb0937d5a20c7158ae768afe4f303a60eb34b5d159f1f5a03b13c8945
7
+ data.tar.gz: b1788664477278498a85ff82db93607c751f3669b10abc2cbf2ee1a8a566f9bd0b7ab131ff1689de060bebfa131daa52438d8d5b14c1f0a65009f8f6f3d76e8f
data/README.md CHANGED
@@ -4,8 +4,14 @@ This gem is for DNS masquerading for rubists. Everyone knows `Pow`, but what
4
4
  I really don't like that it uses `node.js` to run ruby applications. Sometimes
5
5
  we have to run our apps on the certain domain. Masquito allows you to do it,
6
6
  you can create dns records in the similar Pow's way by creating symbolic links
7
- in `.masquito` directory to your apps or just files because masquito doesn't
8
- run rack applications just does dns masquerading.
7
+ to your apps or just files in `.masquito` directory.
8
+
9
+ ## Notice:
10
+
11
+ Masquito doesn't run rack applications. It just masquerads dns records to your
12
+ local IP. Check our another gem
13
+ [https://github.com/route/pump](https://github.com/route/pump) out for full
14
+ replacement of Pow.
9
15
 
10
16
  ## Installation
11
17
 
data/bin/masquito CHANGED
@@ -13,14 +13,12 @@ case command
13
13
  when 'start'
14
14
  Masquito::DNS.new
15
15
  when /daemon|resolver/
16
- require 'masquito/install'
17
16
  options = %w(install uninstall)
18
17
  unless options.include?(subcommand)
19
18
  abort "Usage: #{filename} #{command} #{options.join(' | ')}"
20
19
  end
21
- Masquito.send("#{command}_#{subcommand}")
20
+ Masquito::Install.send("#{command}_#{subcommand}")
22
21
  when 'version'
23
- require 'masquito/version'
24
22
  puts Masquito::VERSION
25
23
  else
26
24
  puts "Usage: #{filename} #{%w(daemon resolver version).join(' | ')}"
@@ -12,70 +12,72 @@ module Masquito
12
12
  RESOLVER_TEMPLATE_PATH = File.join(GEM_PATH, 'config', 'masquito.erb')
13
13
  RESOLVER_PATH = '/etc/resolver/masquito'
14
14
 
15
- class << self
16
- def daemon_install
17
- abort_if_superuser
18
- FileUtils.mkdir_p(CONFIG_PATH)
19
-
20
- plist = ERB.new(File.read(TEMPLATE_PLIST_PATH))
21
- masquito_bin = File.join(GEM_PATH, 'bin', 'masquito')
22
- template = plist.result(binding)
23
-
24
- filename = File.join(Dir.tmpdir, PLIST_NAME)
25
- File.open(filename, 'w') { |f| f.write(template) }
26
- lunchy.install([filename])
27
- lunchy.start([SERVICE_NAME])
28
- File.unlink(filename)
29
-
30
- puts 'Daemon was successfully installed.'
31
- puts 'Run: sudo masquito resolver install'
32
- end
15
+ module Install
16
+ class << self
17
+ def daemon_install
18
+ abort_if_superuser
19
+ FileUtils.mkdir_p(CONFIG_PATH)
20
+
21
+ plist = ERB.new(File.read(TEMPLATE_PLIST_PATH))
22
+ masquito_bin = File.join(GEM_PATH, 'bin', 'masquito')
23
+ template = plist.result(binding)
24
+
25
+ filename = File.join(Dir.tmpdir, PLIST_NAME)
26
+ File.open(filename, 'w') { |f| f.write(template) }
27
+ lunchy.install([filename])
28
+ lunchy.start([SERVICE_NAME])
29
+ File.unlink(filename)
30
+
31
+ puts 'Daemon was successfully installed.'
32
+ puts 'Run: sudo masquito resolver install'
33
+ end
33
34
 
34
- def daemon_uninstall
35
- abort_if_superuser
36
- lunchy.stop([SERVICE_NAME])
37
- lunchy.uninstall([PLIST_NAME])
38
- puts "You can remove #{CONFIG_PATH} if you don't need these settings"
39
- end
35
+ def daemon_uninstall
36
+ abort_if_superuser
37
+ lunchy.stop([SERVICE_NAME])
38
+ lunchy.uninstall([PLIST_NAME])
39
+ puts "You can remove #{CONFIG_PATH} if you don't need these settings"
40
+ end
40
41
 
41
- def resolver_install
42
- abort_unless_superuser
43
- resolver = ERB.new(File.read(RESOLVER_TEMPLATE_PATH))
44
- template = resolver.result(binding)
45
- File.open(RESOLVER_PATH, 'w') { |f| f.write(template) }
46
- end
42
+ def resolver_install
43
+ abort_unless_superuser
44
+ resolver = ERB.new(File.read(RESOLVER_TEMPLATE_PATH))
45
+ template = resolver.result(binding)
46
+ File.open(RESOLVER_PATH, 'w') { |f| f.write(template) }
47
+ end
47
48
 
48
- def resolver_uninstall
49
- abort_unless_superuser
50
- FileUtils.rm_rf(RESOLVER_PATH)
51
- end
49
+ def resolver_uninstall
50
+ abort_unless_superuser
51
+ FileUtils.rm_rf(RESOLVER_PATH)
52
+ end
52
53
 
53
- private
54
+ private
54
55
 
55
- def lunchy
56
- @lunchy ||= Lunchy.new
57
- end
56
+ def lunchy
57
+ @lunchy ||= Lunchy.new
58
+ end
58
59
 
59
- def abort_unless_superuser
60
- unless superuser?
61
- abort 'We need superuser privileges, run this command with sudo'
60
+ def abort_unless_superuser
61
+ unless superuser?
62
+ abort 'We need superuser privileges, run this command with sudo'
63
+ end
62
64
  end
63
- end
64
65
 
65
- def abort_if_superuser
66
- if superuser?
67
- abort 'No need superuser privileges, run this command without sudo'
66
+ def abort_if_superuser
67
+ if superuser?
68
+ abort 'No need superuser privileges, run this command without sudo'
69
+ end
68
70
  end
69
- end
70
71
 
71
- def superuser?
72
- [Process.uid, Process.euid] == [0, 0]
72
+ def superuser?
73
+ [Process.uid, Process.euid] == [0, 0]
74
+ end
73
75
  end
74
76
  end
75
77
  end
76
78
 
77
79
  class Lunchy
78
- CONFIG = { :verbose => false, :write => false }
80
+ CONFIG = { :verbose => false, :write => nil }
79
81
 
80
82
  def uninstall(params)
81
83
  raise ArgumentError, "uninstall [file]" if params.empty?
@@ -1,3 +1,3 @@
1
1
  module Masquito
2
- VERSION = '1.0'
2
+ VERSION = '1.0.1'
3
3
  end
data/lib/masquito.rb CHANGED
@@ -3,5 +3,6 @@ module Masquito
3
3
 
4
4
  autoload :DNS, 'masquito/dns'
5
5
  autoload :Settings, 'masquito/settings'
6
+ autoload :Install, 'masquito/install'
6
7
  autoload :VERSION, 'masquito/version'
7
8
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: masquito
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
5
- prerelease:
4
+ version: 1.0.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Dmitry Vorotilin
@@ -10,22 +9,20 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-04-05 00:00:00.000000000 Z
12
+ date: 2013-08-05 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: lunchy
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - '>='
21
19
  - !ruby/object:Gem::Version
22
20
  version: '0'
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - '>='
29
26
  - !ruby/object:Gem::Version
30
27
  version: '0'
31
28
  description: Masquito is a dns masquerading server for rubists
@@ -56,27 +53,26 @@ files:
56
53
  - test/test_helper.rb
57
54
  homepage: https://github.com/evrone/masquito
58
55
  licenses: []
56
+ metadata: {}
59
57
  post_install_message:
60
58
  rdoc_options: []
61
59
  require_paths:
62
60
  - lib
63
61
  required_ruby_version: !ruby/object:Gem::Requirement
64
- none: false
65
62
  requirements:
66
- - - ! '>='
63
+ - - '>='
67
64
  - !ruby/object:Gem::Version
68
65
  version: '0'
69
66
  required_rubygems_version: !ruby/object:Gem::Requirement
70
- none: false
71
67
  requirements:
72
- - - ! '>='
68
+ - - '>='
73
69
  - !ruby/object:Gem::Version
74
70
  version: '0'
75
71
  requirements: []
76
72
  rubyforge_project:
77
- rubygems_version: 1.8.23
73
+ rubygems_version: 2.0.3
78
74
  signing_key:
79
- specification_version: 3
75
+ specification_version: 4
80
76
  summary: It masquerades your dns records
81
77
  test_files:
82
78
  - test/dns_test.rb