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 CHANGED
@@ -1,3 +1,11 @@
1
+ = 0.9.6.1 / 2010-11-01
2
+
3
+ * Soxer binary cleanup
4
+
5
+ * Fixed empty skeleton for proper soxer inclusion
6
+
7
+ * Fixed soxer binary for empty skeleton creation
8
+
1
9
  = 0.9.6 / 2010-10-31
2
10
 
3
11
  * Forgot to include the streamlined empty skeleton for a modular style
data/bin/soxer CHANGED
@@ -9,103 +9,101 @@ def h
9
9
  end
10
10
 
11
11
  def err message
12
- <<END
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
- END
17
+ Soxer usage:
18
+ #{b "soxer [action] [parameters]"}
19
+
20
+ END
21
21
  end
22
22
 
23
23
  def notice message
24
- <<END
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
- @help = <<END
32
- #{h}
33
-
34
- Soxer usage:
35
- #{b "soxer [action] [parameters]"}
31
+ def help
32
+ <<-END.gsub /^\s\s/, ''
33
+ #{h}
36
34
 
37
- Actions:
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
- First parameter:
44
- #{b 'empty'} - Creates an empty project
45
- More project templates are in the making
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
- Other parameters:
48
- #{b '[name]'} - The name of the project directory
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
- #{b 'test'}
51
- Runs the developement server (in the foreground) on your computer.
52
- Point your browser to #{b 'http://localhost:9394'} to view the result.
53
- You can exit with standard [ctrl]+c.
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
- #{b '$ soxer test 8907'}
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
- END
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
- # Define destination or default
79
- dir = $*[2] ? $*[2] : 'soxer-app'
80
- # Copy skeleton to destination or fail if nonexistent
81
- if template!=nil and File.exist?(skel+'/'+template) and !File.exist?(dir)
82
- src = skel+'/'+template
83
- # Check for destination existance
84
- if !File.exist?(dir)
85
- FileUtils.mkdir(dir)
86
- FileUtils.cp_r(src+"/.", dir)
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
- return err 'The destination directory exists.'
90
- end
91
- else
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 = $*[1]!=nil ? $*[1] : '9394'
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
- x = system("rackup -s #{server} -p #{port}")
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 @help
106
+ when 'help' then printf help
109
107
  else printf err 'You did not specify an action!'
110
108
  end
111
109
 
@@ -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: Congratulations!
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.
data/soxer.gemspec CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.7'
5
5
 
6
6
  s.name = 'soxer'
7
- s.version = '0.9.6'
7
+ s.version = '0.9.6.1'
8
8
  s.date = '2010-11-01'
9
9
  s.rubyforge_project = 'soxer'
10
10
 
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: 55
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
9
  - 6
10
- version: 0.9.6
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