twigg-app 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 312409c6268f21629cf59727c1d75cf51c398e6b
4
- data.tar.gz: d990e730d0e7c1683274619a1d83e9b58864a46f
3
+ metadata.gz: ef82e0c0afead33d8d9bdae1f09ee2295e7a088c
4
+ data.tar.gz: b3b8edb7ebead9f68e373b8bb002599a1a68f5c6
5
5
  SHA512:
6
- metadata.gz: 21ff88bc95fa1b9041f0223c37661ff1d3b25ff384966560ccd3644629841e18343c0318650f37d13b6283619846d5d8b80705ab71916525313ea58bd17af5dc
7
- data.tar.gz: 79e35a54350b5713c05929569905507426a9fae1da567d34f199c8ef12b3fea82a833aa4b43fb856a1c279d879fa6aac020e5fb09fa7f078557717cfdad64a17
6
+ metadata.gz: 0bd4d845ae1f6d331efd37ee3f4a35aec7fc5fc627de97dfb8a80a4749cd6ffaefa6e44bcd7bdba629acddf23e8ebc96d2a80c83aaa9de957abac3cd03aa8fac
7
+ data.tar.gz: 21885331285a2c4eaaf44a97694e17d571d171414b960598397daee45f77b70208e6f3630153ece4e7e4ee91704b1fe76128da0ab71cfe7d9ccfc3c62e250ca1
@@ -1,5 +1,5 @@
1
1
  module Twigg
2
2
  module App
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
@@ -0,0 +1,29 @@
1
+ module Twigg
2
+ class Command
3
+ class App < Command
4
+ def initialize(*args)
5
+ super
6
+ @daemon = @args.delete('-D') || @args.delete('--daemon')
7
+ @pidfile = consume_option(%w[-P --pidfile], @args)
8
+ @pidfile_path = File.expand_path(@pidfile) if @pidfile
9
+ ignore @args
10
+ end
11
+
12
+ def run
13
+ stderr 'Daemonizing...' if @daemon
14
+ stderr "Will write to pidfile #{@pidfile}" if @pidfile_path
15
+ die 'Pidfile already exists' if File.exist?(@pidfile_path)
16
+
17
+ Process.daemon if @daemon
18
+
19
+ if @pidfile_path
20
+ flags = File::WRONLY | File::CREAT | File::EXCL
21
+ File.open(@pidfile_path, flags) { |f| f.write Process.pid }
22
+ at_exit { File.unlink(@pidfile_path) }
23
+ end
24
+
25
+ ::Twigg::App::Server.run!
26
+ end
27
+ end
28
+ end
29
+ end
data/lib/twigg-app.rb CHANGED
@@ -1,5 +1,10 @@
1
1
  require 'twigg'
2
+ require 'twigg/command'
2
3
 
3
4
  module Twigg
4
5
  autoload :App, 'twigg-app/app'
6
+
7
+ class Command
8
+ autoload :App, 'twigg-app/command/app'
9
+ end
5
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twigg-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Causes Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-22 00:00:00.000000000 Z
11
+ date: 2013-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 0.0.2
131
+ version: 0.0.3
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 0.0.2
138
+ version: 0.0.3
139
139
  description: Twigg provides stats for activity in Git repositories. This is the web-based
140
140
  interface.
141
141
  email:
@@ -165,6 +165,7 @@ files:
165
165
  - lib/twigg-app/app/server.rb
166
166
  - lib/twigg-app/app/version.rb
167
167
  - lib/twigg-app/app.rb
168
+ - lib/twigg-app/command/app.rb
168
169
  - lib/twigg-app.rb
169
170
  - public/favicon.ico
170
171
  - public/favicon.png