rubocoin 0.1.1 → 0.1.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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 365ffd4db337c10f99639d7526883d280435da29
4
- data.tar.gz: a72276059952d79ec186c80508ea74d31fc53b85
3
+ metadata.gz: 8aa4172dacf8effb4c4050bb7a4ef0778bb236f9
4
+ data.tar.gz: ddce33a158d62bf7a3d4598847dfcb550cf8acc1
5
5
  SHA512:
6
- metadata.gz: 1df1a61ec58b94af660462e0ebb66209e3b4d61922a3c0a4387845259d3894fde1c22a2f5df6082426c74a63eac9b8f527f9176e87f5ad7b13f7e1afe18c8170
7
- data.tar.gz: efe627cf10815684d5021bd93a3fc3cabd130aa9e675640b581c6d27dd2f333a3bcc2a6386479107443572d6b56c8e398de62bc1ac749c74d3eefb69fe75c942
6
+ metadata.gz: b442f9a3f79d80061055fe2587ef7c4225f78b17b62e73524a5834a48eb4cc44da901b5a6c226a52bea835ee31f4d793e97a6e54856a6742cfe84dc9cef13077
7
+ data.tar.gz: d1d400b8c6f643855b793cd44d571cd4fa392654a904670b34a784362d09856d016e76452c83e43bdb07083107a8a5fdd3875538ed1f0a39b7b4e75cc2a9791f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocoin (0.1.1)
4
+ rubocoin (0.1.2)
5
5
  colorize
6
6
  sinatra
7
7
 
data/bin/rubocoind CHANGED
@@ -5,6 +5,44 @@ unless $LOAD_PATH.include?(lib)
5
5
  require 'rubocoin'
6
6
  end
7
7
 
8
+ daemonize = false
9
+
10
+ parser = OptionParser.new do |opts|
11
+
12
+ opts.banner = "Usage #{File.basename($PROGRAM_NAME)} [options]"
13
+
14
+ opts.on('-d', '--daemon', 'Run the node in the background') do
15
+ daemonize = true
16
+ end
17
+
18
+ opts.on('-k', '--kill-daemon', 'Kill the rubocoind service if it\'s running') do
19
+ unless File.file?('/tmp/rubocoind.pid')
20
+ puts 'The rubocoin daemon doesn\'t seem to be running'
21
+ exit 0
22
+ end
23
+ pid = File.read('/tmp/rubocoind.pid')
24
+ # Check validity of pid file (no code injection for you)
25
+ if pid.to_s =~ /^[A-Z+$]/i
26
+ puts 'PID file is not in the correct format'
27
+ exit 0
28
+ end
29
+ system("kill #{pid}")
30
+ end
31
+
32
+ opts.on('--version', 'Show the current version and exit') do
33
+ puts Rubocoin::VERSION
34
+ exit 0
35
+ end
36
+
37
+ opts.on_tail('-h', '--help', 'Show this help message and exit') do
38
+ puts opts
39
+ exit 0
40
+ end
41
+ end
42
+
43
+ parser.parse!
44
+
45
+
8
46
  def return_invalid_json
9
47
  { :message => 'ERROR: Please supply valid JSON' }.to_json
10
48
  end
@@ -133,41 +171,6 @@ class Rubocoind < Sinatra::Base
133
171
  end
134
172
 
135
173
 
136
- daemonize = false
137
-
138
- OptionParser.new do |opts|
139
-
140
- opts.banner = "Usage #{File.basename($PROGRAM_NAME) [options]}"
141
-
142
- opts.on('-d', '--daemon', 'Run the node in the background') do
143
- daemonize = true
144
- end
145
-
146
- opts.on('-k', '--kill-daemon', 'Kill the rubocoind service if it\'s running') do
147
- unless File.file?('/tmp/rubocoind.pid')
148
- puts 'The rubocoin daemon doesn\'t seem to be running'
149
- exit 0
150
- end
151
- pid = File.read('/tmp/rubocoind.pid')
152
- # Check validity of pid file (no code injection for you)
153
- if pid ~= /^[A-Z+$]/i
154
- puts 'PID file is not in the correct format'
155
- exit 0
156
- end
157
- system("kill #{pid}")
158
- end
159
-
160
- opts.on('--version', 'Show the current version and exit') do
161
- puts Rubocoin::Version
162
- exit 0
163
- end
164
-
165
- opts.on_tail('-h', '--help', 'SHow this help message and exit') do
166
- puts opts
167
- exit 0
168
- end
169
- end.parse!
170
-
171
174
  if daemonize
172
175
  fork do
173
176
  Rubocoind.run!
@@ -1,3 +1,3 @@
1
1
  module Rubocoin
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocoin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - cbrnrd