soxer 0.9.6 → 0.9.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +8 -0
- data/bin/soxer +70 -72
- data/lib/soxer/skel/empty/app.rb +0 -8
- data/lib/soxer/skel/empty/config.ru +1 -2
- data/lib/soxer/skel/empty/content/index.yaml +2 -1
- data/lib/soxer/skel/empty/views/{css.sass → css/css.sass} +0 -0
- data/soxer.gemspec +1 -1
- metadata +4 -3
data/CHANGES
CHANGED
data/bin/soxer
CHANGED
@@ -9,103 +9,101 @@ def h
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def err message
|
12
|
-
|
13
|
-
#{h}
|
14
|
-
#{b message}
|
15
|
-
Type #{b 'soxer help'} to get help.
|
16
|
-
|
17
|
-
Soxer usage:
|
18
|
-
#{b "soxer [action] [parameters]"}
|
12
|
+
<<-END.gsub /^\s\s/, ''
|
13
|
+
#{h}
|
14
|
+
#{b "ERROR: "+message}
|
15
|
+
Type #{b 'soxer help'} to get help.
|
19
16
|
|
20
|
-
|
17
|
+
Soxer usage:
|
18
|
+
#{b "soxer [action] [parameters]"}
|
19
|
+
|
20
|
+
END
|
21
21
|
end
|
22
22
|
|
23
23
|
def notice message
|
24
|
-
|
25
|
-
#{h}
|
26
|
-
#{b message}
|
27
|
-
|
28
|
-
END
|
24
|
+
<<-END.gsub /^\s\s/, ''
|
25
|
+
#{h}
|
26
|
+
#{b message}
|
27
|
+
|
28
|
+
END
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
Soxer usage:
|
35
|
-
#{b "soxer [action] [parameters]"}
|
31
|
+
def help
|
32
|
+
<<-END.gsub /^\s\s/, ''
|
33
|
+
#{h}
|
36
34
|
|
37
|
-
|
38
|
-
|
39
|
-
#{b 'create'}
|
40
|
-
Creates a new soxer project directory with default sinatra/soxer layout.
|
41
|
-
All aspects can be later customized to suite project's needs.
|
35
|
+
Soxer usage:
|
36
|
+
#{b "soxer [action] [parameters]"}
|
42
37
|
|
43
|
-
|
44
|
-
|
45
|
-
|
38
|
+
Actions:
|
39
|
+
|
40
|
+
#{b 'create'}
|
41
|
+
Creates a new soxer project directory with default sinatra/soxer layout.
|
42
|
+
All aspects can be later customized to suite project's needs.
|
46
43
|
|
47
|
-
|
48
|
-
#{b '
|
44
|
+
First parameter:
|
45
|
+
#{b 'empty'} - Creates an empty project
|
46
|
+
More project templates are in the making
|
47
|
+
|
48
|
+
Other parameters:
|
49
|
+
#{b '[name]'} - The name of the project directory
|
50
|
+
|
51
|
+
#{b 'test'}
|
52
|
+
Runs the developement server (in the foreground) on your computer.
|
53
|
+
Point your browser to #{b 'http://localhost:9394'} to view the result.
|
54
|
+
You can exit with standard [ctrl]+c.
|
49
55
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
Parameters:
|
56
|
-
#{b '[int]'} - Port number you wish to run developement on
|
57
|
-
|
58
|
-
#{b 'help'}
|
59
|
-
Displays this help.
|
60
|
-
|
61
|
-
Examples:
|
62
|
-
|
63
|
-
#{b '$ soxer create blog myblog'}
|
64
|
-
This command would create a new project directory 'myblog' with a mockup blog
|
65
|
-
soxer/sinatra application in it. You can tweak the design and parameters to
|
66
|
-
acheve the desired experience.
|
56
|
+
Parameters:
|
57
|
+
#{b '[int]'} - Port number you wish to run developement on
|
58
|
+
|
59
|
+
#{b 'help'}
|
60
|
+
Displays this help.
|
67
61
|
|
68
|
-
|
69
|
-
This command (when executed within the soxer project directory root) will
|
70
|
-
run the developement server on local machine on port 8907.
|
62
|
+
Examples:
|
71
63
|
|
72
|
-
|
64
|
+
#{b '$ soxer create blog myblog'}
|
65
|
+
This command would create a new project directory 'myblog' with a mockup blog
|
66
|
+
soxer/sinatra application in it. You can tweak the design and parameters to
|
67
|
+
acheve the desired experience.
|
68
|
+
|
69
|
+
#{b '$ soxer test 8907'}
|
70
|
+
This command (when executed within the soxer project directory root) will
|
71
|
+
run the developement server on local machine on port 8907.
|
72
|
+
|
73
|
+
END
|
74
|
+
end
|
73
75
|
|
74
|
-
def create
|
75
|
-
template = $*[1]
|
76
|
-
# Define skeleton parent directory
|
76
|
+
def create template, dir
|
77
77
|
skel = File.dirname(__FILE__)+"/../lib/soxer/skel"
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
return notice "Successfuly created '"+dir+"' Directory."
|
78
|
+
case true
|
79
|
+
when template==nil then
|
80
|
+
return err "You did not enter the project type skeleton."
|
81
|
+
when dir==nil then
|
82
|
+
return err "You did not enter destination application directory."
|
83
|
+
when !File.exist?(skel+'/'+template) then
|
84
|
+
return err "The project skeleton directory does not exist."
|
85
|
+
when File.exist?(dir) then
|
86
|
+
return err "The destination directory exists."
|
88
87
|
else
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
return err 'The project skeleton directory does not exist.'
|
88
|
+
FileUtils.mkdir(dir)
|
89
|
+
FileUtils.cp_r( Dir.glob( File.join(skel, template, '*') ), dir)
|
90
|
+
return notice "Successfuly created '#{dir}' application directory from '#{template}'."
|
93
91
|
end
|
94
92
|
end
|
95
93
|
|
96
|
-
def test
|
97
|
-
port =
|
94
|
+
def test port
|
95
|
+
port = 9394 unless port!=nil
|
98
96
|
server = 'webrick'
|
99
97
|
ENV['PATH'].split(':').each {|folder| server = 'thin' if File.exists?(folder+'/thin')}
|
100
|
-
|
98
|
+
system("rackup -s #{server} -p #{port}")
|
101
99
|
return "Developement mode ends."
|
102
100
|
end
|
103
101
|
|
104
102
|
case $*[0]
|
105
|
-
when 'create' then printf create
|
106
|
-
when 'test' then printf test
|
103
|
+
when 'create' then printf create $*[1], $*[2]
|
104
|
+
when 'test' then printf test $*[1]
|
107
105
|
when 'prank' then printf prank
|
108
|
-
when 'help' then printf
|
106
|
+
when 'help' then printf help
|
109
107
|
else printf err 'You did not specify an action!'
|
110
108
|
end
|
111
109
|
|
data/lib/soxer/skel/empty/app.rb
CHANGED
@@ -5,13 +5,5 @@ require "soxer"
|
|
5
5
|
|
6
6
|
class SoxerApp < Sinatra::Base
|
7
7
|
register Sinatra::Soxer
|
8
|
-
|
9
|
-
# Only for sending forms... not a part of Soxer per se...
|
10
|
-
post '*/?' do
|
11
|
-
content_type "text/html", :charset => "utf-8"
|
12
|
-
page = get_page
|
13
|
-
page['layout'] ||= 'layout'
|
14
|
-
haml page['content'], :layout => page['layout'].to_sym, :locals => { :page => page }
|
15
|
-
end
|
16
8
|
|
17
9
|
end
|
@@ -4,7 +4,6 @@ require "app"
|
|
4
4
|
|
5
5
|
disable :run
|
6
6
|
set :server, %w[thin mongrel webrick]
|
7
|
-
set :origin, "content"
|
8
7
|
set :haml, {:format => :html5,
|
9
8
|
:attr_wrapper => '"'}
|
10
9
|
set :haml, {:encoding => 'utf-8'} if RUBY_VERSION=~/1\.9/
|
@@ -21,6 +20,6 @@ end
|
|
21
20
|
|
22
21
|
set :environment, :production
|
23
22
|
|
24
|
-
map '/'
|
23
|
+
map '/' do
|
25
24
|
run SoxerApp
|
26
25
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
uuid: 151af640-c35a-012d-f6b7-001e378a2988
|
2
2
|
date: 2010-10-26T20:03:43+02:00
|
3
|
-
title:
|
3
|
+
title: Hello world!
|
4
4
|
content: |
|
5
5
|
%h1= page['title']
|
6
|
+
%h2 Congratulations!
|
6
7
|
%p You have just created your first #{link_to 'soxer', 'http://soxer.mutsu.org'} application.
|
File without changes
|
data/soxer.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soxer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
9
|
- 6
|
10
|
-
|
10
|
+
- 1
|
11
|
+
version: 0.9.6.1
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Toni Anzlovar
|
@@ -83,7 +84,7 @@ files:
|
|
83
84
|
- lib/soxer/skel/empty/config.yml
|
84
85
|
- lib/soxer/skel/empty/config.ru
|
85
86
|
- lib/soxer/skel/empty/views/layout.haml
|
86
|
-
- lib/soxer/skel/empty/views/css.sass
|
87
|
+
- lib/soxer/skel/empty/views/css/css.sass
|
87
88
|
- lib/soxer/skel/empty/app.rb
|
88
89
|
has_rdoc: true
|
89
90
|
homepage: http://soxer.mutsu.org
|