ramaze 2012.04.14 → 2012.12.08b
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.
- data/.gems +28 -35
- data/.gitignore +4 -0
- data/.travis.yml +3 -3
- data/Gemfile +3 -0
- data/README.md +1 -5
- data/Rakefile +9 -20
- data/examples/app/blog/app.rb +5 -14
- data/examples/app/todolist/start.rb +1 -5
- data/guide/AUTHORS +8 -3
- data/guide/CHANGELOG +587 -0
- data/guide/general/cache.md +1 -0
- data/guide/general/configuration.md +2 -1
- data/guide/general/contributing.md +1 -0
- data/guide/general/controllers.md +105 -10
- data/guide/general/helpers.md +6 -7
- data/guide/general/installation.md +2 -1
- data/guide/general/logging.md +1 -4
- data/guide/general/middlewares.md +15 -23
- data/guide/general/models.md +1 -0
- data/guide/general/principles.md +1 -0
- data/guide/general/ramaze_command.md +9 -54
- data/guide/general/routes.md +1 -0
- data/guide/general/sessions.md +3 -2
- data/guide/general/special_thanks.md +1 -0
- data/guide/general/testing.md +1 -0
- data/guide/general/views.md +35 -22
- data/lib/proto/Gemfile +4 -0
- data/lib/proto/README.md +35 -0
- data/lib/proto/Rakefile +1 -0
- data/lib/proto/app.rb +2 -6
- data/lib/proto/spec/helper.rb +39 -0
- data/lib/proto/task/ramaze.rake +57 -0
- data/lib/ramaze.rb +12 -39
- data/lib/ramaze/bin/create.rb +1 -3
- data/lib/ramaze/bin/runner.rb +0 -14
- data/lib/ramaze/cache.rb +21 -0
- data/lib/ramaze/cache/memcache.rb +1 -3
- data/lib/ramaze/cache/redis.rb +2 -4
- data/lib/ramaze/cache/sequel.rb +4 -5
- data/lib/ramaze/controller.rb +10 -3
- data/lib/ramaze/default_middleware.rb +24 -0
- data/lib/ramaze/files.rb +5 -5
- data/lib/ramaze/gestalt.rb +10 -10
- data/lib/ramaze/helper/blue_form.rb +33 -6
- data/lib/ramaze/helper/csrf.rb +22 -30
- data/lib/ramaze/helper/flash.rb +1 -1
- data/lib/ramaze/helper/upload.rb +5 -3
- data/lib/ramaze/helper/user.rb +1 -0
- data/lib/ramaze/log.rb +0 -5
- data/lib/ramaze/log/informer.rb +3 -3
- data/lib/ramaze/log/logging.rb +4 -4
- data/lib/ramaze/log/syslog.rb +2 -2
- data/lib/ramaze/response.rb +1 -1
- data/lib/ramaze/snippets.rb +0 -20
- data/lib/ramaze/spec/bacon.rb +5 -13
- data/lib/ramaze/version.rb +1 -1
- data/lib/ramaze/view/erector.rb +1 -3
- data/lib/ramaze/view/erubis.rb +1 -3
- data/lib/ramaze/view/ezamar.rb +1 -3
- data/lib/ramaze/view/haml.rb +1 -4
- data/lib/ramaze/view/liquid.rb +1 -3
- data/lib/ramaze/view/lokar.rb +1 -3
- data/lib/ramaze/view/mustache.rb +1 -3
- data/lib/ramaze/view/nagoro.rb +1 -4
- data/lib/ramaze/view/remarkably.rb +1 -4
- data/lib/ramaze/view/sass.rb +2 -5
- data/lib/ramaze/view/slim.rb +1 -3
- data/lib/ramaze/view/slippers.rb +1 -3
- data/lib/ramaze/view/tagz.rb +1 -3
- data/lib/ramaze/view/tenjin.rb +1 -3
- data/ramaze.gemspec +45 -16
- data/spec/helper.rb +0 -1
- data/spec/ramaze/cache/localmemcache.rb +0 -4
- data/spec/ramaze/controller/mapping.rb +17 -0
- data/spec/ramaze/dispatcher/directory.rb +6 -5
- data/spec/ramaze/dispatcher/file.rb +7 -4
- data/spec/ramaze/files.rb +0 -2
- data/spec/ramaze/helper/csrf.rb +0 -26
- data/spec/ramaze/helper/upload.rb +1 -0
- data/spec/ramaze/helper/user.rb +12 -0
- data/spec/ramaze/log/syslog.rb +5 -1
- data/spec/ramaze/view/lokar.rb +1 -1
- data/spec/ramaze/view/nagoro.rb +1 -1
- data/tasks/bacon.rake +1 -1
- data/tasks/gems.rake +15 -0
- data/tasks/release.rake +37 -8
- metadata +106 -139
- data/guide/_static/ramaze_console.png +0 -0
- data/guide/tutorials/introduction.md +0 -263
- data/lib/proto/model/init.rb +0 -6
- data/lib/proto/public/.htaccess +0 -24
- data/lib/proto/public/dispatch.fcgi +0 -11
- data/lib/proto/spec/main.rb +0 -20
- data/lib/proto/start.rb +0 -20
- data/lib/ramaze/app_graph.rb +0 -105
- data/lib/ramaze/bin/console.rb +0 -87
- data/lib/ramaze/bin/helper.rb +0 -107
- data/lib/ramaze/bin/restart.rb +0 -95
- data/lib/ramaze/bin/start.rb +0 -221
- data/lib/ramaze/bin/status.rb +0 -152
- data/lib/ramaze/bin/stop.rb +0 -112
- data/lib/ramaze/dependencies.rb +0 -84
- data/lib/ramaze/helper/disqus.rb +0 -27
- data/lib/ramaze/helper/ultraviolet.rb +0 -49
- data/lib/ramaze/log/analogger.rb +0 -50
- data/lib/ramaze/log/growl.rb +0 -55
- data/lib/ramaze/log/knotify.rb +0 -31
- data/lib/ramaze/log/xosd.rb +0 -94
- data/lib/ramaze/middleware_compiler.rb +0 -36
- data/lib/ramaze/plugin.rb +0 -69
- data/lib/ramaze/setup.rb +0 -210
- data/lib/ramaze/snippets/array/put_within.rb +0 -38
- data/lib/ramaze/snippets/binding/locals.rb +0 -20
- data/lib/ramaze/snippets/fiber.rb +0 -41
- data/lib/ramaze/snippets/kernel/pretty_inspect.rb +0 -18
- data/lib/ramaze/snippets/metaid.rb +0 -17
- data/lib/ramaze/snippets/numeric/filesize_format.rb +0 -30
- data/lib/ramaze/snippets/numeric/time.rb +0 -59
- data/lib/ramaze/snippets/object/instance_variable_defined.rb +0 -16
- data/lib/ramaze/snippets/object/pretty.rb +0 -12
- data/lib/ramaze/snippets/object/scope.rb +0 -16
- data/lib/ramaze/snippets/ordered_set.rb +0 -51
- data/lib/ramaze/snippets/proc/locals.rb +0 -19
- data/lib/ramaze/snippets/ramaze/acquire.rb +0 -32
- data/lib/ramaze/snippets/ramaze/dictionary.rb +0 -400
- data/lib/ramaze/snippets/ramaze/fiber.rb +0 -24
- data/lib/ramaze/snippets/ramaze/struct.rb +0 -43
- data/lib/ramaze/snippets/string/end_with.rb +0 -17
- data/lib/ramaze/snippets/string/ord.rb +0 -16
- data/lib/ramaze/snippets/string/start_with.rb +0 -14
- data/lib/ramaze/snippets/thread/into.rb +0 -16
- data/lib/ramaze/spec.rb +0 -4
- data/spec/ramaze/bin/start.rb +0 -34
- data/spec/ramaze/log/growl.rb +0 -45
- data/spec/ramaze/struct.rb +0 -50
- data/spec/snippets/array/put_within.rb +0 -38
- data/spec/snippets/binding/locals.rb +0 -12
- data/spec/snippets/numeric/filesize_format.rb +0 -15
- data/spec/snippets/numeric/time.rb +0 -15
- data/spec/snippets/ordered_set.rb +0 -66
- data/spec/snippets/ramaze/acquire.rb +0 -80
- data/spec/snippets/ramaze/dictionary.rb +0 -113
- data/spec/snippets/ramaze/struct.rb +0 -15
- data/spec/snippets/thread/into.rb +0 -12
- data/tasks/gem.rake +0 -21
- data/tasks/setup.rake +0 -14
data/lib/ramaze/bin/status.rb
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
module Ramaze
|
|
2
|
-
#:nodoc:
|
|
3
|
-
module Bin
|
|
4
|
-
##
|
|
5
|
-
# The status command can be used to show the details, such as the PID and
|
|
6
|
-
# the CPU usage, of a running Ramaze application.
|
|
7
|
-
#
|
|
8
|
-
# Usage:
|
|
9
|
-
#
|
|
10
|
-
# ramaze status
|
|
11
|
-
# ramaze status /home/projects/ramaze/ramaze.pid
|
|
12
|
-
#
|
|
13
|
-
# @author Yorick Peterse
|
|
14
|
-
# @author TJ Vanderpoel
|
|
15
|
-
# @since 21-07-2011
|
|
16
|
-
#
|
|
17
|
-
class Status
|
|
18
|
-
include Ramaze::Bin::Helper
|
|
19
|
-
|
|
20
|
-
# Description of this command, displayed in the glboal help message.
|
|
21
|
-
Description = 'Shows the status of a running Ramaze application'
|
|
22
|
-
|
|
23
|
-
# The banner of this command, displayed when the -h or --help option is
|
|
24
|
-
# specified.
|
|
25
|
-
Banner = <<-TXT.strip
|
|
26
|
-
Shows the status of a running Ramaze application. If a PID is specified this
|
|
27
|
-
command will use that PID, otherwise it will try to look for a PID in the
|
|
28
|
-
current directory.
|
|
29
|
-
|
|
30
|
-
Usage:
|
|
31
|
-
ramaze status [PID] [OPTIONS]
|
|
32
|
-
|
|
33
|
-
Example:
|
|
34
|
-
ramaze status blog/blog.pid
|
|
35
|
-
TXT
|
|
36
|
-
|
|
37
|
-
# String containing the message that's used to display all statistics
|
|
38
|
-
Statistics = <<-TXT.strip
|
|
39
|
-
Ramaze is running!
|
|
40
|
-
Name: %s
|
|
41
|
-
Command Line: %s
|
|
42
|
-
Virtual Size: %s
|
|
43
|
-
Started: %s
|
|
44
|
-
Exec Path: %s
|
|
45
|
-
Status: %s
|
|
46
|
-
TXT
|
|
47
|
-
|
|
48
|
-
##
|
|
49
|
-
# Creates a new instance of the command and sets all the option parser
|
|
50
|
-
# options.
|
|
51
|
-
#
|
|
52
|
-
# @author Yorick Peterse
|
|
53
|
-
# @since 21-07-2011
|
|
54
|
-
#
|
|
55
|
-
def initialize
|
|
56
|
-
@options = OptionParser.new do |opt|
|
|
57
|
-
opt.banner = Banner
|
|
58
|
-
opt.summary_indent = ' '
|
|
59
|
-
|
|
60
|
-
opt.separator "\nOptions:\n"
|
|
61
|
-
|
|
62
|
-
opt.on('-h', '--help', 'Shows this help message') do
|
|
63
|
-
puts @options
|
|
64
|
-
exit
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
##
|
|
70
|
-
# Runs the command based on the given command line arguments.
|
|
71
|
-
#
|
|
72
|
-
# @author Yorick Peterse
|
|
73
|
-
# @author TJ Vanderpoel
|
|
74
|
-
# @since 21-07-2011
|
|
75
|
-
# @param [Array] argv Array containing all teh command line arguments.
|
|
76
|
-
#
|
|
77
|
-
def run(argv = [])
|
|
78
|
-
@options.parse!(argv)
|
|
79
|
-
|
|
80
|
-
pid_path = argv.delete_at(0)
|
|
81
|
-
dirname = Pathname.new('.').realpath.basename.to_s
|
|
82
|
-
pid_path = File.join(Dir.pwd, dirname + '.pid') if pid_path.nil?
|
|
83
|
-
|
|
84
|
-
# Is it a directory?
|
|
85
|
-
if File.directory?(pid_path)
|
|
86
|
-
pid_path = File.join(pid_path, File.basename(pid_path) + '.pid')
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
pid_path = Pathname.new(pid_path).expand_path.to_s
|
|
90
|
-
|
|
91
|
-
if !File.exist?(pid_path)
|
|
92
|
-
abort "The PID #{pid_path} does not exist"
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
# Is the app running?
|
|
96
|
-
unless is_running?(pid_path)
|
|
97
|
-
abort "The Ramaze application for #{pid_path} isn't running"
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
pid = File.read(pid_path).to_i
|
|
101
|
-
|
|
102
|
-
# Gather various statistics about the process
|
|
103
|
-
if is_windows?
|
|
104
|
-
wmi = WIN32OLE.connect("winmgmts://")
|
|
105
|
-
ours = []
|
|
106
|
-
processes = wmi.ExecQuery(
|
|
107
|
-
"select * from win32_process where ProcessId = #{pid}"
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
processes.each do |p|
|
|
111
|
-
ours << [
|
|
112
|
-
p.Name,
|
|
113
|
-
p.CommandLine,
|
|
114
|
-
p.VirtualSize,
|
|
115
|
-
p.CreationDate,
|
|
116
|
-
p.ExecutablePath,
|
|
117
|
-
p.Status
|
|
118
|
-
]
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
puts Statistics % ours.first
|
|
122
|
-
# Unix like systems
|
|
123
|
-
else
|
|
124
|
-
if File.directory?(proc_dir = Pathname.new('/proc'))
|
|
125
|
-
proc_dir = proc_dir.join(pid.to_s)
|
|
126
|
-
# If we have a "stat" file, we'll assume linux and get as much info
|
|
127
|
-
# as we can
|
|
128
|
-
if File.file?(stat_file = proc_dir.join("stat"))
|
|
129
|
-
stats = File.read(stat_file).split
|
|
130
|
-
|
|
131
|
-
puts Statistics % [
|
|
132
|
-
nil,
|
|
133
|
-
File.read(proc_dir.join("cmdline")).split("\000").join(" "),
|
|
134
|
-
"%s k" % (stats[22].to_f / 1024),
|
|
135
|
-
File.mtime(proc_dir),
|
|
136
|
-
File.readlink(proc_dir.join("exe")),
|
|
137
|
-
stats[2]
|
|
138
|
-
]
|
|
139
|
-
end
|
|
140
|
-
# /proc does not exist, use "ps"
|
|
141
|
-
else
|
|
142
|
-
begin
|
|
143
|
-
puts %x{ps l #{pid}}
|
|
144
|
-
rescue
|
|
145
|
-
puts "Sadly no more information is available"
|
|
146
|
-
end
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
end
|
|
150
|
-
end # Status
|
|
151
|
-
end # Bin
|
|
152
|
-
end # Ramaze
|
data/lib/ramaze/bin/stop.rb
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
module Ramaze
|
|
2
|
-
#:nodoc:
|
|
3
|
-
module Bin
|
|
4
|
-
##
|
|
5
|
-
# Stops a running instance of Ramaze by killing it's process. The PID of
|
|
6
|
-
# this process can be supplied via the command line. If no PID is given this
|
|
7
|
-
# command tries to find it in the current directory. If the latter is the
|
|
8
|
-
# case this command tries to find a file of which the name matches the name
|
|
9
|
-
# of the current directory.
|
|
10
|
-
#
|
|
11
|
-
# Usage:
|
|
12
|
-
#
|
|
13
|
-
# ramaze stop
|
|
14
|
-
# ramaze stop /home/foobar/projects/ramaze/ramaze.pid
|
|
15
|
-
#
|
|
16
|
-
# @author Yorick Peterse
|
|
17
|
-
# @author TJ Vanderpoel
|
|
18
|
-
# @since 21-07-2011
|
|
19
|
-
#
|
|
20
|
-
class Stop
|
|
21
|
-
include Ramaze::Bin::Helper
|
|
22
|
-
|
|
23
|
-
# The description of this command, shown when the global help menu is
|
|
24
|
-
# displayed.
|
|
25
|
-
Description = 'Stops a running instance of Ramaze'
|
|
26
|
-
|
|
27
|
-
# The banner of this command.
|
|
28
|
-
Banner = <<-TXT.strip
|
|
29
|
-
Stops a running instance of Ramaze by killing it's process using a PID. If no
|
|
30
|
-
PID is given this command tries to look for it in the current directory.
|
|
31
|
-
|
|
32
|
-
Usage:
|
|
33
|
-
ramaze stop [PID] [OPTIONS]
|
|
34
|
-
|
|
35
|
-
Example:
|
|
36
|
-
ramaze stop /home/foobar/projects/ramaze/ramaze.pid
|
|
37
|
-
TXT
|
|
38
|
-
|
|
39
|
-
##
|
|
40
|
-
# Creates a new instance of the command and sets all the OptionParser
|
|
41
|
-
# options.
|
|
42
|
-
#
|
|
43
|
-
# @author Yorick Peterse
|
|
44
|
-
# @since 21-07-2011
|
|
45
|
-
#
|
|
46
|
-
def initialize
|
|
47
|
-
@options = OptionParser.new do |opt|
|
|
48
|
-
opt.banner = Banner
|
|
49
|
-
opt.summary_indent = ' '
|
|
50
|
-
|
|
51
|
-
opt.separator "\nOptions:\n"
|
|
52
|
-
|
|
53
|
-
opt.on('-h', '--help', 'Shows this help message') do
|
|
54
|
-
puts @options
|
|
55
|
-
exit
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
##
|
|
61
|
-
# Runs the command based on the specified command line arguments.
|
|
62
|
-
#
|
|
63
|
-
# @author Yorick Peterse
|
|
64
|
-
# @author TJ Vanderpoel
|
|
65
|
-
# @since 21-07-2011
|
|
66
|
-
# @param [Array] argv Array containing all the command line arguments.
|
|
67
|
-
#
|
|
68
|
-
def run(argv = [])
|
|
69
|
-
@options.parse!(argv)
|
|
70
|
-
|
|
71
|
-
pid_path = argv.delete_at(0)
|
|
72
|
-
dirname = Pathname.new('.').expand_path.basename.to_s
|
|
73
|
-
pid_path = File.join(Dir.pwd, dirname + '.pid') if pid_path.nil?
|
|
74
|
-
|
|
75
|
-
if File.directory?(pid_path)
|
|
76
|
-
pid_path = File.join(pid_path, File.basename(pid_path) + '.pid')
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
pid_path = Pathname.new(pid_path).expand_path.to_s
|
|
80
|
-
|
|
81
|
-
if !File.exist?(pid_path)
|
|
82
|
-
abort "The PID #{pid_path} does not exist"
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
pid = File.read(pid_path).to_i
|
|
86
|
-
puts 'Stopping the process using SIGINT'
|
|
87
|
-
|
|
88
|
-
begin
|
|
89
|
-
Process.kill('INT', pid)
|
|
90
|
-
rescue => e
|
|
91
|
-
abort "Failed to kill the process: #{e.message}"
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
sleep(2)
|
|
95
|
-
|
|
96
|
-
# Verify that the process has been killed
|
|
97
|
-
if is_running?(pid_path)
|
|
98
|
-
$stderr.puts "The process is still running, let's kill it with -9"
|
|
99
|
-
|
|
100
|
-
begin
|
|
101
|
-
Process.kill(9, pid)
|
|
102
|
-
rescue => e
|
|
103
|
-
abort "Failed to kill the process: #{e.message}"
|
|
104
|
-
end
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
File.unlink(pid_path) if File.exist?(pid_path)
|
|
108
|
-
puts 'Ramazement has ended, go in peace.'
|
|
109
|
-
end
|
|
110
|
-
end # Stop
|
|
111
|
-
end # Bin
|
|
112
|
-
end # Ramaze
|
data/lib/ramaze/dependencies.rb
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
module Ramaze
|
|
2
|
-
# Array containing gems that aren't supported for certain reasons. The gems
|
|
3
|
-
# that are in this array by default will be removed if the current setup
|
|
4
|
-
# *does* support them.
|
|
5
|
-
UNSUPPORTED_GEMS = [
|
|
6
|
-
'lokar',
|
|
7
|
-
'localmemcache',
|
|
8
|
-
'ruby-growl',
|
|
9
|
-
'nagoro',
|
|
10
|
-
'syslog'
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
# Array containing the names and versions of all the gems required by Ramaze
|
|
14
|
-
# along with the name of how the gem should be required.
|
|
15
|
-
DEPENDENCIES = [
|
|
16
|
-
{:name => 'innate', :version => ['>= 2012.03']}
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
# Array containing all the development dependencies.
|
|
20
|
-
DEVELOPMENT_DEPENDENCIES = [
|
|
21
|
-
{:name => 'bacon' , :version => ['>= 1.1.0']},
|
|
22
|
-
{:name => 'dalli' , :version => ['>= 1.0.5']},
|
|
23
|
-
{:name => 'erector' , :version => ['>= 0.8.2']},
|
|
24
|
-
{:name => 'erubis' , :version => ['>= 2.7.0']},
|
|
25
|
-
{:name => 'ezamar' , :version => ['>= 2009.06']},
|
|
26
|
-
{:name => 'sass' , :version => ['>= 3.1.4']},
|
|
27
|
-
{:name => 'haml' , :version => ['>= 3.1.2']},
|
|
28
|
-
{:name => 'hpricot' , :version => ['>= 0.8.4']},
|
|
29
|
-
{:name => 'liquid' , :version => ['>= 2.2.2']},
|
|
30
|
-
{:name => 'locale' , :version => ['>= 2.0.5']},
|
|
31
|
-
{:name => 'maruku' , :version => ['>= 0.6.0']},
|
|
32
|
-
{:name => 'mustache' , :version => ['>= 0.99.4']},
|
|
33
|
-
{:name => 'rack-contrib', :version => ['>= 1.1.0'], :lib => 'rack/contrib'},
|
|
34
|
-
{:name => 'rack-test' , :version => ['>= 0.6.0'], :lib => 'rack/test'},
|
|
35
|
-
{:name => 'Remarkably' , :version => ['>= 0.6.1'], :lib => 'remarkably'},
|
|
36
|
-
{:name => 'sequel' , :version => ['>= 3.25.0']},
|
|
37
|
-
{:name => 'slippers' , :version => ['>= 0.0.14']},
|
|
38
|
-
{:name => 'sqlite3' , :version => ['>= 1.3.3']},
|
|
39
|
-
{:name => 'tagz' , :version => ['>= 9.0.0']},
|
|
40
|
-
{:name => 'tenjin' , :version => ['>= 0.6.1']},
|
|
41
|
-
{:name => 'yard' , :version => ['>= 0.7.2']},
|
|
42
|
-
{:name => 'redis' , :version => ['>= 2.2.2']},
|
|
43
|
-
{:name => 'rdiscount' , :version => ['>= 1.6.8']},
|
|
44
|
-
{:name => 'slim' , :version => ['>= 1.1.0']}
|
|
45
|
-
]
|
|
46
|
-
|
|
47
|
-
# Lokar requires Ruby >= 1.9
|
|
48
|
-
if RUBY_VERSION.to_f >= 1.9
|
|
49
|
-
DEVELOPMENT_DEPENDENCIES.push({:name => 'lokar', :version => ['>= 0.2.1']})
|
|
50
|
-
UNSUPPORTED_GEMS.delete('lokar')
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
# LocalMemcache doesn't work on Mac OS X or jruby.
|
|
54
|
-
if !RUBY_DESCRIPTION.include?('jruby') and !RUBY_PLATFORM.include?('darwin')
|
|
55
|
-
DEVELOPMENT_DEPENDENCIES.push(
|
|
56
|
-
{:name => 'localmemcache', :version => ['>= 0.4.4']}
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
UNSUPPORTED_GEMS.delete('localmemcache')
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# Ruby-growl, requiring Growl, only works on Mac OS X.
|
|
63
|
-
if RUBY_PLATFORM.include?('darwin')
|
|
64
|
-
DEVELOPMENT_DEPENDENCIES.push(
|
|
65
|
-
{:name => 'ruby-growl', :version => ['>= 3.0']}
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
UNSUPPORTED_GEMS.delete('ruby-growl')
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
# Nagoro doesn't seem to work on Rbx
|
|
72
|
-
if !RUBY_DESCRIPTION.include?('rubinius')
|
|
73
|
-
DEVELOPMENT_DEPENDENCIES.push(
|
|
74
|
-
{:name => 'nagoro', :version => ['>= 2009.05']}
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
UNSUPPORTED_GEMS.delete('nagoro')
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
# Syslog uses forking which apparently isn't available on jruby.
|
|
81
|
-
if !RUBY_DESCRIPTION.include?('jruby')
|
|
82
|
-
UNSUPPORTED_GEMS.delete('syslog')
|
|
83
|
-
end
|
|
84
|
-
end # Ramaze
|
data/lib/ramaze/helper/disqus.rb
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
require 'disqus'
|
|
2
|
-
require 'disqus/view_helpers'
|
|
3
|
-
|
|
4
|
-
module Ramaze
|
|
5
|
-
module Helper
|
|
6
|
-
##
|
|
7
|
-
# Provides shortcuts via Disqus::ViewHelpers.
|
|
8
|
-
#
|
|
9
|
-
# Make sure that you set your disqus credentials when using this helper:
|
|
10
|
-
# Disqus::defaults[:account] = "my_disqus_account"
|
|
11
|
-
# And optionally, only if you're using the API
|
|
12
|
-
# Disqus::defaults[:api_key] = "my_disqus_api_key"
|
|
13
|
-
#
|
|
14
|
-
# Available methods are:
|
|
15
|
-
#
|
|
16
|
-
# disqus_combo
|
|
17
|
-
# disqus_comment_counts
|
|
18
|
-
# disqus_popular_threads
|
|
19
|
-
# disqus_recent_comments
|
|
20
|
-
# disqus_thread
|
|
21
|
-
# disqus_top_commenters
|
|
22
|
-
#
|
|
23
|
-
module Disqus
|
|
24
|
-
include ::Disqus::ViewHelpers
|
|
25
|
-
end # Disqus
|
|
26
|
-
end # Helper
|
|
27
|
-
end # Ramaze
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
module Ramaze
|
|
2
|
-
module Helper
|
|
3
|
-
module Ultraviolet
|
|
4
|
-
include Innate::Traited
|
|
5
|
-
|
|
6
|
-
trait :ultraviolet => {
|
|
7
|
-
:output => 'xhtml',
|
|
8
|
-
:syntax => nil, # syntax_name, nil|false indicates automatic detection
|
|
9
|
-
:line_numbers => false,
|
|
10
|
-
:style => 'classic', # render_style
|
|
11
|
-
:headers => false, # ouput document with all headers
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
##
|
|
15
|
-
# Parse and output the file at the given path.
|
|
16
|
-
# Please head over to the Ultraviolet documentation for more information
|
|
17
|
-
# on possible options.
|
|
18
|
-
#
|
|
19
|
-
def ultraviolet(path, options = {})
|
|
20
|
-
o = ancestral_trait[:ultraviolet].merge(options)
|
|
21
|
-
output, syntax, lines, style, headers =
|
|
22
|
-
o.values_at(:output, :syntax, :line_numbers, :style, :headers)
|
|
23
|
-
|
|
24
|
-
syntax ||= Uv.syntax_for_file(path).first.first
|
|
25
|
-
code = File.read(path)
|
|
26
|
-
|
|
27
|
-
p [code, output, syntax, lines, style, headers]
|
|
28
|
-
Uv.parse(code, output, syntax, lines, style, headers)
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
##
|
|
32
|
-
# Return absolute path to the css of given name.
|
|
33
|
-
#
|
|
34
|
-
# Usually this will point to somewhere in the gem tree.
|
|
35
|
-
#
|
|
36
|
-
# It seems like Uv will add support for user-defined PATH in the future,
|
|
37
|
-
# so we will, to be future-proof, traverse the Uv.path even though it
|
|
38
|
-
# currently will only have one directory.
|
|
39
|
-
#
|
|
40
|
-
def ultraviolet_css(theme)
|
|
41
|
-
Uv.path.each do |path|
|
|
42
|
-
Dir[path/"render/xhtml/files/css/*.css"].each do |css|
|
|
43
|
-
return css if File.basename(css, '.css') == theme
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end # UltraViolet
|
|
48
|
-
end # Helper
|
|
49
|
-
end # Ramaze
|
data/lib/ramaze/log/analogger.rb
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
|
-
|
|
4
|
-
require 'swiftcore/Analogger/Client'
|
|
5
|
-
|
|
6
|
-
module Ramaze
|
|
7
|
-
module Logger
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
# Informer for the Swiftcore Analogger logging system.
|
|
11
|
-
#
|
|
12
|
-
# You can find it at http://analogger.swiftcore.org and install with
|
|
13
|
-
# gem install analogger
|
|
14
|
-
#
|
|
15
|
-
class Analogger < ::Swiftcore::Analogger::Client
|
|
16
|
-
include Logging
|
|
17
|
-
|
|
18
|
-
# identifier for your application
|
|
19
|
-
trait :name => 'walrus'
|
|
20
|
-
|
|
21
|
-
# Host analogger runs on
|
|
22
|
-
trait :host => '127.0.0.1'
|
|
23
|
-
|
|
24
|
-
# Port analogger runs on
|
|
25
|
-
trait :port => 6766
|
|
26
|
-
|
|
27
|
-
##
|
|
28
|
-
# Create a new instance, parameters default to the traits.
|
|
29
|
-
#
|
|
30
|
-
# @param [String] name The name of the logging system (can be anything you like).
|
|
31
|
-
# @param [String] host The IP/hostname on which the logging system is running.
|
|
32
|
-
# @param [Integer] port The port of the logging system.
|
|
33
|
-
#
|
|
34
|
-
def initialize(name = class_trait[:name], host = class_trait[:host],
|
|
35
|
-
port = class_trait[:port])
|
|
36
|
-
super
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
##
|
|
40
|
-
# Integration to Logging
|
|
41
|
-
#
|
|
42
|
-
# @param [String] tag
|
|
43
|
-
# @param [Hash] args
|
|
44
|
-
#
|
|
45
|
-
def log(tag, *args)
|
|
46
|
-
super(tag, args.join("\n"))
|
|
47
|
-
end
|
|
48
|
-
end # Analogger
|
|
49
|
-
end # Log
|
|
50
|
-
end # Ramaze
|