enigmamachine 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +3 -3
- data/VERSION +1 -1
- data/enigmamachine.gemspec +3 -2
- data/lib/enigmamachine.rb +20 -9
- data/lib/generators/config.yml +3 -0
- metadata +5 -4
data/README.rdoc
CHANGED
@@ -109,8 +109,8 @@ eats your mother.
|
|
109
109
|
== Installation
|
110
110
|
|
111
111
|
Enigmamachine is written in Ruby and uses the Sinatra web framework, the
|
112
|
-
Datamapper ORM library,
|
113
|
-
you're not a Ruby person, you don't need to care about any of this.
|
112
|
+
Datamapper ORM library, the Eventmachine event-processing library, and the Thin
|
113
|
+
webserver. If you're not a Ruby person, you don't need to care about any of this.
|
114
114
|
Enigmamachine can be triggered by any language that can send a POST request -
|
115
115
|
so all you PHPistas, python-lovers, droopy-moustachists, or blue-suited
|
116
116
|
java types can all use it just as easy as us fashionable-haircut-language
|
@@ -131,7 +131,7 @@ You'll need to add the following line to your ~/.bashrc file, as well:
|
|
131
131
|
|
132
132
|
export PATH=/var/lib/gems/1.8/bin:$PATH
|
133
133
|
|
134
|
-
Then
|
134
|
+
Then <i>gem install enigmamachine</i> should theoretically work. You'll also need a copy of
|
135
135
|
ffmpeg installed and available in your path. On Mac OS X, rubygems should
|
136
136
|
already be installed, although you'll need to have a C compiler available
|
137
137
|
(make sure you install the developer tools that came with your operating
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/enigmamachine.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{enigmamachine}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["dave"]
|
12
|
-
s.date = %q{2010-07-
|
12
|
+
s.date = %q{2010-07-09}
|
13
13
|
s.default_executable = %q{enigmamachine}
|
14
14
|
s.description = %q{A RESTful video encoder which you can use as either a front-end to ffmpeg or headless on a server.}
|
15
15
|
s.email = %q{dave@caprica}
|
@@ -64,6 +64,7 @@ Gem::Specification.new do |s|
|
|
64
64
|
"lib/enigmamachine/views/videos/video.erb",
|
65
65
|
"lib/ext/array_ext.rb",
|
66
66
|
"lib/ext/partials.rb",
|
67
|
+
"lib/generators/config.yml",
|
67
68
|
"test/helper.rb",
|
68
69
|
"test/support/afile.mpg",
|
69
70
|
"test/support/blueprints.rb",
|
data/lib/enigmamachine.rb
CHANGED
@@ -43,6 +43,8 @@ class EnigmaMachine < Sinatra::Base
|
|
43
43
|
configure :test do
|
44
44
|
db = "sqlite3::memory:"
|
45
45
|
DataMapper.setup(:default, db)
|
46
|
+
@@username = 'admin'
|
47
|
+
@@password = 'admin'
|
46
48
|
end
|
47
49
|
|
48
50
|
configure :production, :test, :development do
|
@@ -53,6 +55,12 @@ class EnigmaMachine < Sinatra::Base
|
|
53
55
|
|
54
56
|
configure :production, :development do
|
55
57
|
DataMapper.auto_upgrade!
|
58
|
+
unless File.exist? File.join(Dir.getwd, 'config.yml')
|
59
|
+
FileUtils.cp(File.dirname(__FILE__) + '/generators/config.yml', Dir.getwd)
|
60
|
+
end
|
61
|
+
raw_config = File.read(Dir.getwd + "/config.yml")
|
62
|
+
@@username = YAML.load(raw_config)['username']
|
63
|
+
@@password = YAML.load(raw_config)['password']
|
56
64
|
end
|
57
65
|
|
58
66
|
# Set the views to the proper path inside the gem
|
@@ -72,15 +80,6 @@ class EnigmaMachine < Sinatra::Base
|
|
72
80
|
alias_method :h, :escape_html
|
73
81
|
end
|
74
82
|
|
75
|
-
# Set up Rack authentication
|
76
|
-
#
|
77
|
-
# I'm going to disable this for now, although later this might be a good way
|
78
|
-
# of providing security for shared hosts. TODO: figure out how to secure the
|
79
|
-
# app for use on shared hosts.
|
80
|
-
#
|
81
|
-
# use Rack::Auth::Basic do |username, password|
|
82
|
-
# [username, password] == ['admin', 'admin']
|
83
|
-
# end
|
84
83
|
|
85
84
|
# Include flash notices
|
86
85
|
#
|
@@ -91,6 +90,7 @@ class EnigmaMachine < Sinatra::Base
|
|
91
90
|
# main Sinatra/thin thread once the periodic timer is added.
|
92
91
|
#
|
93
92
|
configure do
|
93
|
+
|
94
94
|
Video.reset_encoding_videos
|
95
95
|
Thread.new do
|
96
96
|
until EM.reactor_running?
|
@@ -100,6 +100,17 @@ class EnigmaMachine < Sinatra::Base
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
+
# Set up Rack authentication
|
104
|
+
#
|
105
|
+
# I'm going to disable this for now, although later this might be a good way
|
106
|
+
# of providing security for shared hosts. TODO: figure out how to secure the
|
107
|
+
# app for use on shared hosts.
|
108
|
+
#
|
109
|
+
use Rack::Auth::Basic do |username, password|
|
110
|
+
[username, password] == [@@username, @@password]
|
111
|
+
end
|
112
|
+
|
113
|
+
|
103
114
|
# Shows the enigma status page.
|
104
115
|
#
|
105
116
|
get '/' do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enigmamachine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- dave
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-09 00:00:00 +01:00
|
19
19
|
default_executable: enigmamachine
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -193,6 +193,7 @@ files:
|
|
193
193
|
- lib/enigmamachine/views/videos/video.erb
|
194
194
|
- lib/ext/array_ext.rb
|
195
195
|
- lib/ext/partials.rb
|
196
|
+
- lib/generators/config.yml
|
196
197
|
- test/helper.rb
|
197
198
|
- test/support/afile.mpg
|
198
199
|
- test/support/blueprints.rb
|