armstrong 0.2.6 → 0.2.8

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.
Files changed (4) hide show
  1. data/README.md +1 -1
  2. data/armstrong.gemspec +1 -1
  3. data/bin/armstrong +42 -3
  4. metadata +3 -3
data/README.md CHANGED
@@ -40,7 +40,7 @@ There's a sample `mongrel2.conf` and `config.sqlite` in the `demo` folder, feel
40
40
  require './lib/armstrong'
41
41
 
42
42
  get "/" do
43
- output_string "hello world"
43
+ reply_string "hello world"
44
44
  end
45
45
 
46
46
  Just like in Sinatra, we state the verb we want to use, the path, and give it a block with the relevant code to execute. So far only 'GET' requests are supported but more will come out in later builds.
data/armstrong.gemspec CHANGED
@@ -1,4 +1,4 @@
1
- Gem::Specification.new 'armstrong', '0.2.6' do |s|
1
+ Gem::Specification.new 'armstrong', '0.2.8' do |s|
2
2
  s.description = "Armstrong is an Mongrel2 fronted, actor-based web development framework similar in style to sinatra. With natively-threaded interpreters (Rubinius2), Armstrong provides true concurrency and high stability, by design."
3
3
  s.summary = "Highly concurrent, sinatra-like framework"
4
4
  s.author = "Artem Titoulenko"
data/bin/armstrong CHANGED
@@ -13,12 +13,27 @@ def inform
13
13
  usage: armstrong <command>
14
14
 
15
15
  commands:
16
- create <name> Creates an armstrong app with a sample mongrel2.conf and config.sqlite
16
+ create <name> [port] Creates an armstrong app with a sample
17
+ mongrel2.conf and config.sqlite running on
18
+ [port] or the default 6767.
19
+
20
+ start [host] [db.sqlite] Starts a mongrel2 server in this directory
21
+ and then runs the app called by the current
22
+ directorys name. This is equivalent to:
23
+ $m2sh start -host localhost -db config.sqlite >> /dev/null &
24
+ $ruby app.rb
25
+
26
+ stop [host] Kills the default running mongrel2
27
+ server or [host]. This is like:
28
+ $m2sh stop -host localhost
29
+
30
+ short commands:
31
+ c = create
32
+ s = start
33
+ t = stop
17
34
  """
18
35
  end
19
36
 
20
- port = 6767
21
-
22
37
  mongrel2_conf = """
23
38
  armstrong_handler = Handler(
24
39
  send_spec='tcp://127.0.0.1:9999',
@@ -57,8 +72,10 @@ servers = [armstrong_serv]
57
72
  inform if ARGV.empty?
58
73
 
59
74
  case ARGV[0]
75
+ when 'c'
60
76
  when 'create'
61
77
  inform if ARGV[1].nil?
78
+ port = (ARGV[2].nil? ? 6767 : ARGV[2])
62
79
  mkdir ARGV[1]
63
80
  cd ARGV[1]
64
81
  %w[log run tmp].map(&method(:mkdir))
@@ -67,4 +84,26 @@ when 'create'
67
84
  puts `m2sh load -config mongrel2.conf -db config.sqlite`
68
85
  File.open("#{ARGV[1]}.rb", 'w') {|file| file.puts "require 'rubygems'\nrequire 'armstrong'\n\n"}
69
86
  puts "Created app #{ARGV[1]} that will run on port #{port}"
87
+
88
+ when 's'
89
+ when 'start'
90
+ host = (ARGV[1].nil? ? 'localhost' : ARGV[1])
91
+ db = (ARGV[2].nil? ? 'config.sqlite' : ARGV[2])
92
+
93
+ output = `m2sh start -host #{host} -config #{db} > /dev/null &`
94
+ if output.match /Aborting/
95
+ puts "Error starting up mongrel2.\n\nTrace:\n#{output}"
96
+ break
97
+ end
98
+ puts "Started #{host} using the #{db} db"
99
+
100
+ file = Dir.pwd.split('/').last
101
+ puts "now running #{file}.rb"
102
+ puts `ruby #{file}.rb`
103
+
104
+ when 't'
105
+ when 'stop'
106
+ host = (ARGV[1].nil? ? 'localhost' : ARGV[1])
107
+ puts `m2sh stop -host #{host}`
108
+ puts "Stopped #{host}, I think"
70
109
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: armstrong
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1408122028129865489
4
+ hash: 2499712927119017196
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 6
10
- version: 0.2.6
9
+ - 8
10
+ version: 0.2.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Artem Titoulenko