convey 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/convey CHANGED
@@ -26,11 +26,13 @@ if command == "-v" or command == "version"
26
26
  puts "Convey #{Convey::VERSION}"
27
27
  elsif command == "init" or command == "-i"
28
28
  template_path = File.expand_path "#{File.dirname(__FILE__)}/../template"
29
- `mkdir #{options[0]}`
29
+ `mkdir #{options[0] || 'my_site'}`
30
30
  `cp -R #{template_path}/* #{options[0]}`
31
- elsif command == "server" or command == "-s"
31
+ elsif command == "server" or command == "-s" or command.nil?
32
32
  Convey::Server.run!
33
33
  elsif command == "compile" or command == "-c"
34
34
  dir = options[0] || Dir.pwd
35
35
  Convey::Compiler.compile!(dir)
36
+ else
37
+ puts "See `convey help` for more infomation."
36
38
  end
@@ -1,7 +1,7 @@
1
1
  module Convey
2
2
  class Compiler
3
3
  include Convey
4
-
4
+
5
5
  def self.compile!(base_path)
6
6
  `rm -rf #{base_path}/compiled`
7
7
  Dir.mkdir("#{base_path}/compiled")
@@ -17,7 +17,7 @@ module Convey
17
17
  end
18
18
 
19
19
  meta = Convey::Compiler.process_file(path)
20
- local_path = meta[:path].gsub(base_path, "")
20
+ local_path = meta[:path].gsub(base_path, "")
21
21
 
22
22
  if meta[:path] != path
23
23
  puts "Compiled #{path.gsub(base_path, "")} to /compiled#{local_path}"
@@ -28,7 +28,7 @@ module Convey
28
28
  File.open("#{root}#{local_path}", 'w') {|f| f.write(meta[:data]) }
29
29
  end
30
30
  end
31
-
31
+
32
32
  def self.process_file(path)
33
33
  meta = {}
34
34
  if File.exists?(path)
@@ -54,9 +54,9 @@ module Convey
54
54
  else
55
55
  raise "Path '#{path}' doesn't exist."
56
56
  end
57
-
57
+
58
58
  return meta
59
59
  end
60
-
60
+
61
61
  end
62
62
  end
@@ -1,14 +1,14 @@
1
1
  module Convey
2
- VERSION = "0.1"
3
-
4
- def coffee_installed?
2
+ VERSION = "0.2"
3
+
4
+ def coffee_installed?
5
5
  begin
6
6
  `coffee -v`
7
7
  rescue
8
8
  return false
9
9
  end
10
-
10
+
11
11
  return true
12
12
  end
13
-
13
+
14
14
  end
@@ -3,22 +3,26 @@ require 'sinatra/base'
3
3
  module Convey
4
4
  class Server < Sinatra::Base
5
5
  include Convey
6
-
7
- set :public, Dir.pwd
8
-
9
- get '/|*.html|css|js' do
6
+
7
+ set :public_folder, Dir.pwd
8
+
9
+ get "/hello" do
10
+ "hey!"
11
+ end
12
+
13
+ get '/*' do
10
14
  if env["PATH_INFO"] == '/'
11
15
  env["PATH_INFO"] = '/index.html'
12
16
  end
13
-
17
+
14
18
  path = Dir.pwd + env["PATH_INFO"]
15
19
  path.gsub!(".html", ".haml")
16
20
  path.gsub!(".css", ".sass")
17
21
  path.gsub!(".js", ".coffee")
18
-
22
+
19
23
  meta = Convey::Compiler.process_file(path)
20
24
  content_type "text/#{meta[:type]}"
21
25
  return meta[:data]
22
- end
26
+ end
23
27
  end
24
- end
28
+ end
metadata CHANGED
@@ -1,59 +1,56 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: convey
3
- version: !ruby/object:Gem::Version
4
- hash: 9
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.2'
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- version: "0.1"
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Ashley Williams
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-05-31 00:00:00 +01:00
18
- default_executable: convey
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- prerelease: false
22
- type: :runtime
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
32
- version_requirements: *id001
12
+ date: 2011-10-23 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
33
15
  name: sinatra
34
- - !ruby/object:Gem::Dependency
16
+ requirement: &70308648349260 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - =
20
+ - !ruby/object:Gem::Version
21
+ version: 1.3.1
22
+ type: :runtime
35
23
  prerelease: false
24
+ version_requirements: *70308648349260
25
+ - !ruby/object:Gem::Dependency
26
+ name: haml
27
+ requirement: &70308648348760 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
36
33
  type: :runtime
37
- requirement: &id002 !ruby/object:Gem::Requirement
34
+ prerelease: false
35
+ version_requirements: *70308648348760
36
+ - !ruby/object:Gem::Dependency
37
+ name: mime-types
38
+ requirement: &70308648348180 !ruby/object:Gem::Requirement
38
39
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
46
- version_requirements: *id002
47
- name: haml
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70308648348180
48
47
  description:
49
- email:
50
- executables:
48
+ email: hi@ashleyw.co.uk
49
+ executables:
51
50
  - convey
52
51
  extensions: []
53
-
54
52
  extra_rdoc_files: []
55
-
56
- files:
53
+ files:
57
54
  - bin/convey
58
55
  - lib/convey/compiler.rb
59
56
  - lib/convey/main.rb
@@ -66,39 +63,28 @@ files:
66
63
  - LICENSE
67
64
  - NOTICE
68
65
  - README.md
69
- has_rdoc: true
70
66
  homepage: http://ashleyw.co.uk/
71
67
  licenses: []
72
-
73
68
  post_install_message:
74
69
  rdoc_options: []
75
-
76
- require_paths:
70
+ require_paths:
77
71
  - lib
78
- required_ruby_version: !ruby/object:Gem::Requirement
72
+ required_ruby_version: !ruby/object:Gem::Requirement
79
73
  none: false
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- hash: 3
84
- segments:
85
- - 0
86
- version: "0"
87
- required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
79
  none: false
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- hash: 3
93
- segments:
94
- - 0
95
- version: "0"
80
+ requirements:
81
+ - - ! '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
96
84
  requirements: []
97
-
98
85
  rubyforge_project:
99
- rubygems_version: 1.4.2
86
+ rubygems_version: 1.8.7
100
87
  signing_key:
101
88
  specification_version: 3
102
- summary: "Convey: Haml, Sass and CoffeeScript prototyping"
89
+ summary: ! 'Convey: Simple Haml, Sass and CoffeeScript prototyping'
103
90
  test_files: []
104
-