edango 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/README.rdoc +3 -2
- data/lib/edango.rb +1 -1
- data/lib/edango/context/parameters.rb +2 -1
- data/lib/edango/context/services.rb +7 -0
- data/lib/edango/site/core.rb +6 -6
- data/lib/edango/site/public/images/logo.png +0 -0
- data/lib/edango/site/public/styles/layout.css +1 -1
- data/lib/edango/starter.rb +20 -8
- metadata +2 -2
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -28,9 +28,10 @@ You can install the application and all its dependencies with the following comm
|
|
28
28
|
gem install edango
|
29
29
|
|
30
30
|
Now you need to add at least one account specifications to the application configuration file.
|
31
|
-
This can be done with the
|
31
|
+
This can be done with the <tt>-a</tt> or <tt>--account</tt> flags passed with the specs
|
32
|
+
to the application starter script.
|
32
33
|
|
33
|
-
edango --
|
34
|
+
edango --account "URL_REGEX, TICKET_LINK_REGEX, PASSKEY[, LOGIN:PASSWORD[, LOGIN_URL]]"
|
34
35
|
|
35
36
|
=== Other Installation Methods
|
36
37
|
|
data/lib/edango.rb
CHANGED
@@ -22,10 +22,11 @@ module EDango
|
|
22
22
|
asset :options, :file => FILES[:options] do
|
23
23
|
{:environment => :production,
|
24
24
|
:server_logging => true,
|
25
|
-
:time_limit =>
|
25
|
+
:time_limit => 100,
|
26
26
|
:servers => ['thin', 'mongrel', 'webrick'],
|
27
27
|
:host => '0.0.0.0',
|
28
28
|
:port => 6666,
|
29
|
+
:proxy => false,
|
29
30
|
:sites => []}
|
30
31
|
end
|
31
32
|
|
@@ -97,6 +97,13 @@ module EDango
|
|
97
97
|
WWW::Mechanize.new do |agent|
|
98
98
|
agent.user_agent_alias = 'Windows Mozilla'
|
99
99
|
agent.history.max_size = 0
|
100
|
+
|
101
|
+
proxy = EDango::PARAMETERS[:options][:proxy]
|
102
|
+
|
103
|
+
if proxy
|
104
|
+
agent.set_proxy(*proxy) unless proxy[0].nil_or_empty? or
|
105
|
+
proxy[1].nil_or_empty?
|
106
|
+
end
|
100
107
|
end
|
101
108
|
end
|
102
109
|
end
|
data/lib/edango/site/core.rb
CHANGED
@@ -56,22 +56,22 @@ module EDango
|
|
56
56
|
self.class.set(param, value)
|
57
57
|
end
|
58
58
|
|
59
|
-
set :
|
59
|
+
set :errors_list, {}
|
60
60
|
end
|
61
61
|
|
62
62
|
helpers do
|
63
63
|
def error(key, value = nil)
|
64
|
-
value ? options.
|
64
|
+
value ? options.errors_list[key] = value : options.errors_list[key]
|
65
65
|
end
|
66
66
|
alias err error
|
67
67
|
|
68
68
|
def error?(key)
|
69
|
-
options.
|
69
|
+
options.errors_list[key] ? true : false
|
70
70
|
end
|
71
71
|
alias err? error?
|
72
72
|
|
73
73
|
def clear_errors
|
74
|
-
options.
|
74
|
+
options.errors_list.clear()
|
75
75
|
end
|
76
76
|
|
77
77
|
def current_jlib
|
@@ -148,7 +148,7 @@ module EDango
|
|
148
148
|
|
149
149
|
@tickets = extract_tickets(url, passkey)
|
150
150
|
|
151
|
-
unless options.
|
151
|
+
unless options.errors_list.empty?
|
152
152
|
response.set_cookie('url', url)
|
153
153
|
|
154
154
|
redirect('/')
|
@@ -166,7 +166,7 @@ module EDango
|
|
166
166
|
error :in_process, [[t(:specified_file), t(:file_not_found)]]
|
167
167
|
end
|
168
168
|
|
169
|
-
unless options.
|
169
|
+
unless options.errors_list.empty?
|
170
170
|
redirect('/')
|
171
171
|
else
|
172
172
|
send_file(file)
|
Binary file
|
data/lib/edango/starter.rb
CHANGED
@@ -22,13 +22,15 @@ module EDango
|
|
22
22
|
|
23
23
|
class Starter
|
24
24
|
SPECS =
|
25
|
-
{:
|
26
|
-
['-
|
27
|
-
'Adds
|
25
|
+
{:account_flag =>
|
26
|
+
['-a', '--account URL_REGEX,TICKET_LINK_REGEX,PASSKEY[,LOGIN:PASSWORD[,LOGIN_URL]]',
|
27
|
+
'Adds account specifications used to obtain a ticket.'],
|
28
28
|
:clear_flag =>
|
29
|
-
['-c', '--clear', 'Clear all
|
30
|
-
:
|
31
|
-
['-
|
29
|
+
['-c', '--clear', 'Clear all account specifications from the configuration.'],
|
30
|
+
:server_flag =>
|
31
|
+
['-s', '--server NAME:VALUE[,NAME:VALUE]', 'Specifies parameters for the "Sinatra" library.'],
|
32
|
+
:proxy_flag =>
|
33
|
+
['-p', '--proxy HOST:PORT[:USER:PASSWORD]', 'Specifies proxy server parameters.'],
|
32
34
|
:version_flag =>
|
33
35
|
['-v', '--version', 'Displays version information and exits.'],
|
34
36
|
:help_flag =>
|
@@ -95,7 +97,7 @@ module EDango
|
|
95
97
|
@modes[:debug] = true
|
96
98
|
end
|
97
99
|
|
98
|
-
on_argument(:
|
100
|
+
on_argument(:account_flag) do |specs|
|
99
101
|
specs = specs.split(',').map(&:strip) rescue []
|
100
102
|
|
101
103
|
url_regex, ticket_link_regex, passkey, account, login_url = specs
|
@@ -110,7 +112,7 @@ module EDango
|
|
110
112
|
@options[:sites] = []
|
111
113
|
end
|
112
114
|
|
113
|
-
on_argument(:
|
115
|
+
on_argument(:server_flag) do |params|
|
114
116
|
params = Hash[*params.split(',').map { |item| item.split(':').map(&:strip) }.flatten] rescue nil
|
115
117
|
params.try(:intern_keys!)
|
116
118
|
|
@@ -118,6 +120,16 @@ module EDango
|
|
118
120
|
@options[:parameters] << params if params
|
119
121
|
end
|
120
122
|
|
123
|
+
on_argument(:proxy_flag) do |specs|
|
124
|
+
specs = specs.split(':') rescue nil
|
125
|
+
|
126
|
+
@options[:proxy] = nil
|
127
|
+
if specs
|
128
|
+
@options[:proxy] = specs unless specs[0].nil_or_empty? or
|
129
|
+
specs[1].nil_or_empty?
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
121
133
|
@parser.parse!(@environment.arguments)
|
122
134
|
@environment.save_options(:all)
|
123
135
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edango
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toksaitov Dmitrii Alexandrovich
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-11 00:00:00 +06:00
|
13
13
|
default_executable: edango
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|