erlnixify 0.0.1 → 0.0.2

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjRmMzY3YmU4NDA2MDMxZjgyMWQ3OWFlZTRiZmNmMDQwNDdiMjAzNQ==
4
+ ZDgwYzhmNGFiZDhjMzllYWE2ZjBmZDQ4NjQyM2RmOTA3NzE5MmY1Ng==
5
5
  data.tar.gz: !binary |-
6
- NzgxZTQ3OWU5MGExNGZkM2U2ODY4ZGNmOWY2Yjk1OTJhZTJkNzlkNg==
6
+ MDRjNmJjNjVmYmViNWE2ZTliMDJjMmRiOTJhYTM1ZmY5NTU4YThhYQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NjBiYzEyZDYyZjc2ZDY5ZGMwMGEwOTUwMzAyYTBjNTVmMTc1M2I1ZWEyZjhh
10
- OTdmOTg5NzJmM2Q2NGE4MjJlNDlhYjFlN2UwNzBjOTgyOWE4NjQwZjBkZmZk
11
- MTE3ZjE1YTJiZDk0NzJhN2IyYTIzM2UwNjY2YzBjMjdmY2U4MWI=
9
+ YzJjMTA4NzQ3OTRhODgzNTBkOTBkZGJlY2NlNmM2ZGY3OGRmZGMzZjBjNzUw
10
+ YWJkNjI5NmFiODJhY2MzZWI1ZmRiNzQ0MGIxOTdiYTkxNzY5YjVhNDYzZGJh
11
+ M2VkODEzNjNjZjk5YmVlMGIxYjMxM2NhZjk4YzJkNjdiNzVjMDE=
12
12
  data.tar.gz: !binary |-
13
- OTI3ZmNiMmQ1YmQ0NjYwYTU5NzI4ZjZkNDE4YjU4OTQyNDA4NDVkMDE5YTdi
14
- MWE5NTMwMmJjOTgyOTQxZmE1NWE0MjFkZWE2ZThkZDNiMWU4ZTlkZGYxZDBi
15
- OTYwOWUzODllMTk5YjEyZTQ1MWVlN2Q0ZWU5YTQ2ODA0NGM2MDg=
13
+ MWY4YWExN2I0ZTBmNzg1M2Y3ZWZhNzcwOGFkY2EzZGI4ZmYxZjY1YjFiMzdl
14
+ YjdiMDhiMzdkMDdmMTk1ZmFlMTcxNGQyMzdiNTIzOTljZmEzOWEwYjQ2MmNk
15
+ OTZhNGEzNmRjM2E5ZWMzYTg3M2QwMTE1ZDhhNWYzZmI4YmViNTI=
data/bin/erlnixify ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'erlnixify'
4
+ Erlnixify::Main.main(ARGV)
@@ -8,10 +8,10 @@ module Erlnixify
8
8
  #
9
9
  class Opts
10
10
 
11
- attr_reader :options
11
+ attr_reader :options, :opts
12
12
 
13
13
  def initialize(args)
14
- opts = Slop.parse(args) do
14
+ @opts = Slop.parse(args) do
15
15
 
16
16
  banner = "Usage: erlnixify [options]"
17
17
 
@@ -1,3 +1,3 @@
1
1
  module Erlnixify
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/erlnixify.rb CHANGED
@@ -5,20 +5,41 @@ require "erlnixify/node"
5
5
 
6
6
  module Erlnixify
7
7
 
8
- def main(args)
9
- @opts = Opts.new(args)
8
+ # The main entry point for erlnixify
9
+ class Main
10
+ def self.main(args)
11
+ @opts = Erlnixify::Opts.new(args)
10
12
 
11
- if opts.version?
12
- puts Erlnixify::VERSION
13
- exit 0
14
- end
13
+ if @opts.opts.version?
14
+ puts Erlnixify::VERSION
15
+ exit 0
16
+ end
17
+
18
+ if not @opts.opts.command?
19
+ puts "missing command option, this is required"
20
+ puts @opts.opts.help
21
+ exit 1
22
+ end
23
+
24
+ if not @opts.opts.name?
25
+ puts "missing name option"
26
+ puts @opts.opts.help
27
+ exit 1
28
+ end
29
+
30
+ if not (@opts.opts.cookie? || @opts.opts.cookiefile?)
31
+ puts "missing both cookie and cookiefile options, at least one is required"
32
+ puts @opts.opts.help
33
+ exit 1
34
+ end
15
35
 
16
- @settings = Settings.new(opts)
17
- @process = Process.new(@settings)
18
- begin
19
- @process.start
20
- rescue Erlnixify::NodeError
21
- exit 127
36
+ @settings = Erlnixify::Settings.new(@opts)
37
+ @process = Erlnixify::Node.new(@settings)
38
+ begin
39
+ @process.start
40
+ rescue Erlnixify::NodeError
41
+ exit 127
42
+ end
22
43
  end
23
44
  end
24
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erlnixify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Merritt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-21 00:00:00.000000000 Z
11
+ date: 2013-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -102,7 +102,8 @@ description: ! "Erlnixify's purpose is to rectify a problem in Erlang. At the mo
102
102
  them\ninto something that the erlang vm can understand.\n"
103
103
  email:
104
104
  - ericbmerritt@gmail.com
105
- executables: []
105
+ executables:
106
+ - erlnixify
106
107
  extensions: []
107
108
  extra_rdoc_files: []
108
109
  files:
@@ -112,6 +113,7 @@ files:
112
113
  - LICENSE.md
113
114
  - README.md
114
115
  - Rakefile
116
+ - bin/erlnixify
115
117
  - erlnixify.gemspec
116
118
  - features/node.feature
117
119
  - features/settings.feature