erlnixify 0.0.3 → 0.0.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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzMyZjgxN2IxNDliNTAyOWY2MGI0MzQ5MzQyMDkzZTcyNTAwNDE4OQ==
4
+ MGRkYTU3OWUxYmRkYjQ3OTk3NzYwYTgwYTMzNjAwOGFhMDNjMjhiMg==
5
5
  data.tar.gz: !binary |-
6
- NTU4NDIzMDA0NDFmNGYzMGNhNTY1MmNlNmMzM2UwZWJmMjY0MTkxZQ==
6
+ MjA5YmJjYTcxOGVlMzVlNTJjNzkwMWIzZDY4MWVlZTkwN2UzYWQ2NA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- N2IxYTAxODg4YWM1MThiYWRjMTcwYzI4NzRkZGNjOTY3NDQ5Njk1ZjEyMGFm
10
- ZDFkOGMzNjRlNDdlMzMwNGIzY2U0NTUzNTc5MDI1OTI1YWZlNjVjZTYxOWY3
11
- ODIzODQ1ZTBkNTdkZmU1YWVjZGZlZjkyZmM4YzZhMTY4MzE0ODQ=
9
+ YmVjNzIyNTNhODgwODk1YjlhYTgwYmM2MjM1OTIxZDdmZTNhZjExZGExNzI5
10
+ ZTBkODM3NmI5MTVhMjY4ZDliMmRjYTc5NTlhM2QzMzk1ODBmY2RhZWJjMGYx
11
+ NzQzYmQ2OWJlZmJjMjg3YjRiOWRlODM5YTQwYWZjNDNhN2VhNGE=
12
12
  data.tar.gz: !binary |-
13
- MWMyNWY2ZWQ4MTNiMjMzMjgwMzU0ZGZlMzZkNjk1Yjk2NjI4OTBmZTVlMWFj
14
- ODhlNWZiNGMwOTk2YTlhNDY1MTYwNzNiNmMzMTc2Y2I2MGZlYjg1MTU3ZWUw
15
- NmY1OGRhMzVlNDdiMmFjNzY1NmIwOWMyODQ5NDcwMWQzNzU2ODU=
13
+ YTMxYjg0ZmJkNWRiOWYwNWRjZmE0Nzk4YmZhODBlMjBjMDUwZmVlN2Y2MDcz
14
+ MmNmZWQ1YmYzYzZjMzRlYjY1Y2VkMTllNTYyM2YzM2FhNTcxMDNhNTlmODRh
15
+ NDQxZTFjN2RiMjdhOGQxOGU0NmFmYmIxYjVhZTEwOTI3Y2QwNTk=
data/Rakefile CHANGED
@@ -18,5 +18,5 @@ task :console do
18
18
  exec 'irb -I lib -r startingscript.rb'
19
19
  end
20
20
 
21
- task :quality => [:reek, :features] do
21
+ task :quality => [:features] do
22
22
  end
@@ -27,9 +27,3 @@ Feature: Node
27
27
  And the erlang node is started
28
28
  When the check command times out
29
29
  Then the erlang node is halted
30
-
31
- Scenario: Signal TERM
32
- Given a valid configuration
33
- And the erlang node is started
34
- When a term signal is recieved
35
- Then the erlang node is halted
@@ -1,14 +1,12 @@
1
-
2
-
3
1
  Given(/^a valid configuration$/) do
4
2
  hostname = `hostname -f`.strip
5
- @opts = Erlnixify::Opts.new(["--cookie", "fubachu",
3
+ @opts = Erlnixify::Opts.new(["startdeamon", "--cookie", "fubachu",
6
4
  "--startuptimeout", "10",
7
5
  "--checkinterval", "10",
8
6
  "--name", "foo",
9
7
  "--command", "erl -noshell -setcookie fubachu -name foo@#{hostname}"
10
8
  ])
11
- @settings = Erlnixify::Settings.new(@opts)
9
+ @settings = Erlnixify::Settings.new(@opts.options[:startdeamon])
12
10
  end
13
11
 
14
12
  Then(/^no errors or problems occur$/) do
@@ -38,13 +36,14 @@ end
38
36
 
39
37
  Given(/^a valid configuration with invalid command$/) do
40
38
  hostname = `hostname -f`.strip
41
- @opts = Erlnixify::Opts.new(["--cookie", "fubachu",
39
+ @opts = Erlnixify::Opts.new(["startdeamon",
40
+ "--cookie", "fubachu",
42
41
  "--startuptimeout", "10",
43
42
  "--checkinterval", "10",
44
43
  "--name", "foo",
45
44
  "--command", "this should fail"
46
45
  ])
47
- @settings = Erlnixify::Settings.new(@opts)
46
+ @settings = Erlnixify::Settings.new(@opts.options[:startdeamon])
48
47
  end
49
48
 
50
49
  When(/^the node fails$/) do
@@ -58,7 +57,7 @@ end
58
57
 
59
58
  Given(/^a valid configuration with invalid check command$/) do
60
59
  hostname = `hostname -f`.strip
61
- @opts = Erlnixify::Opts.new(["--cookie", "fubachu",
60
+ @opts = Erlnixify::Opts.new(["startdeamon", "--cookie", "fubachu",
62
61
  "--startuptimeout", "10",
63
62
  "--checkinterval", "10",
64
63
  "--name", "foo",
@@ -66,7 +65,7 @@ Given(/^a valid configuration with invalid check command$/) do
66
65
  "--check", "invalid check",
67
66
 
68
67
  ])
69
- @settings = Erlnixify::Settings.new(@opts)
68
+ @settings = Erlnixify::Settings.new(@opts.options[:startdeamon])
70
69
  end
71
70
 
72
71
  When(/^the check fails$/) do
@@ -81,7 +80,7 @@ end
81
80
  Given(/^a valid configuration with a long running check comamnd$/) do
82
81
  check_time = 60 * 1000 # 60 seconds in milliseconds
83
82
  hostname = `hostname -f`.strip
84
- @opts = Erlnixify::Opts.new(["--cookie", "fubachu",
83
+ @opts = Erlnixify::Opts.new(["startdeamon", "--cookie", "fubachu",
85
84
  "--startuptimeout", "10",
86
85
  "--checkinterval", "10",
87
86
  "--name", "foo",
@@ -89,7 +88,7 @@ Given(/^a valid configuration with a long running check comamnd$/) do
89
88
  "--check", "timer sleep [#{check_time}]",
90
89
 
91
90
  ])
92
- @settings = Erlnixify::Settings.new(@opts)
91
+ @settings = Erlnixify::Settings.new(@opts.options[:startdeamon])
93
92
  end
94
93
 
95
94
  When(/^the check command times out$/) do
@@ -8,11 +8,11 @@ end
8
8
 
9
9
  Given(/^a settings file$/) do
10
10
  file = File.dirname(__FILE__) + '/../test_data/settings_config.yml'
11
- @opts = Erlnixify::Opts.new(["--config", file])
11
+ @opts = Erlnixify::Opts.new(["startdeamon", "--config", file])
12
12
  end
13
13
 
14
14
  When(/^I load that settings file$/) do
15
- @settings = Erlnixify::Settings.new(@opts)
15
+ @settings = Erlnixify::Settings.new(@opts.options[:startdeamon])
16
16
  end
17
17
 
18
18
  Then(/^the settings should be available in the settings object$/) do
@@ -27,14 +27,14 @@ end
27
27
 
28
28
  Given(/^an options object that contains config values$/) do
29
29
  file = File.dirname(__FILE__) + '/../test_data/settings_config.yml'
30
- @opts = Erlnixify::Opts.new(["--config", file,
30
+ @opts = Erlnixify::Opts.new(["startdeamon", "--config", file,
31
31
  "--checkinterval", "100",
32
32
  "--startuptimeout", "500",
33
33
  "--cookie", "fubachu"])
34
34
  end
35
35
 
36
36
  When(/^a new settings file is loaded up using that options$/) do
37
- @settings = Erlnixify::Settings.new(@opts)
37
+ @settings = Erlnixify::Settings.new(@opts.options[:startdeamon])
38
38
  end
39
39
 
40
40
  Then(/^the command line options override the file options$/) do
@@ -47,13 +47,12 @@ Then(/^the command line options override the file options$/) do
47
47
  assert_equal 100, @settings[:checkinterval]
48
48
  end
49
49
 
50
-
51
50
  Given(/^a lack of a config file and command line options$/) do
52
51
  @opts = Erlnixify::Opts.new([])
53
52
  end
54
53
 
55
54
  When(/^a settings are loaded$/) do
56
- @settings = Erlnixify::Settings.new(@opts)
55
+ @settings = Erlnixify::Settings.new(@opts.options[:startdeamon])
57
56
  end
58
57
 
59
58
  Then(/^that settings object contains sane defaults$/) do
@@ -28,7 +28,7 @@ module Erlnixify
28
28
  end
29
29
 
30
30
  def start
31
- self.start_deamon
31
+ self.start_daemon
32
32
 
33
33
  Signal.trap("TERM") do
34
34
  # This is going to propagate to the running erlang
@@ -53,16 +53,16 @@ module Erlnixify
53
53
  self.monitor
54
54
  end
55
55
 
56
- def start_deamon
56
+ def start_daemon
57
57
  begin
58
58
  self.status
59
59
  rescue NodeError => msg
60
- return self.raw_start_deamon
60
+ return self.raw_start_daemon
61
61
  end
62
62
  raise NodeError, "Already started"
63
63
  end
64
64
 
65
- def raw_start_deamon
65
+ def raw_start_daemon
66
66
  @log.debug "starting daemon"
67
67
  env = {}
68
68
  env["HOME"] = @settings[:home] if @settings[:home]
@@ -16,7 +16,7 @@ module Erlnixify
16
16
 
17
17
  banner = "Usage: erlnixify [options]"
18
18
 
19
- command 'startdeamon' do
19
+ command 'startdaemon' do
20
20
  on :b, :release=, 'Release Root Directory'
21
21
  on :e, :erlang=, 'Erlang Root Directory'
22
22
  on :o, :home=, "The home directory to explicitly set"
@@ -40,7 +40,7 @@ module Erlnixify
40
40
  on :v, :version, "Show the Version"
41
41
 
42
42
  run do |opts, args|
43
- cmd = :startdeamon
43
+ cmd = :startdaemon
44
44
  end
45
45
  end
46
46
 
@@ -1,3 +1,3 @@
1
1
  module Erlnixify
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/erlnixify.rb CHANGED
@@ -40,8 +40,8 @@ module Erlnixify
40
40
  case @opts.command
41
41
  when :start
42
42
  @node.start
43
- when :startdeamon
44
- @node.start_deamon
43
+ when :startdaemon
44
+ @node.start_daemon
45
45
  exit 0
46
46
  when :stop
47
47
  @node.stop
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.3
4
+ version: 0.0.4
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-06-12 00:00:00.000000000 Z
11
+ date: 2013-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler