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 CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.5.2 / 2010-01-11
2
+
3
+ * Proxy support was added
4
+
1
5
  === 0.5.1 / 2010-01-10
2
6
 
3
7
  * 1 major enhancement
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 -s or --site flags passed with the specs to the application starter script.
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 --site "URL_REGEX, TICKET_LINK_REGEX, PASSKEY[, LOGIN:PASSWORD[, LOGIN_URL]]"
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
@@ -25,7 +25,7 @@ $LOAD_PATH.unshift(current_dir) unless $LOAD_PATH.include?(current_dir) or
25
25
  module EDango
26
26
  FULL_NAME = 'EDango'
27
27
  UNIX_NAME = 'edango'
28
- VERSION = '0.5.1'
28
+ VERSION = '0.5.2'
29
29
 
30
30
  AUTHOR = 'Toksaitov Dmitrii Alexandrovich'
31
31
 
@@ -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 => 10,
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
@@ -56,22 +56,22 @@ module EDango
56
56
  self.class.set(param, value)
57
57
  end
58
58
 
59
- set :errors, {}
59
+ set :errors_list, {}
60
60
  end
61
61
 
62
62
  helpers do
63
63
  def error(key, value = nil)
64
- value ? options.errors[key] = value : options.errors[key]
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.errors[key] ? true : false
69
+ options.errors_list[key] ? true : false
70
70
  end
71
71
  alias err? error?
72
72
 
73
73
  def clear_errors
74
- options.errors.clear()
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.errors.empty?
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.errors.empty?
169
+ unless options.errors_list.empty?
170
170
  redirect('/')
171
171
  else
172
172
  send_file(file)
Binary file
@@ -108,7 +108,7 @@ fieldset
108
108
 
109
109
  #title
110
110
  {
111
- padding: 182px 0 0 250px;
111
+ padding: 182px 0 0 300px;
112
112
  }
113
113
 
114
114
  #title #app-name
@@ -22,13 +22,15 @@ module EDango
22
22
 
23
23
  class Starter
24
24
  SPECS =
25
- {:site_flag =>
26
- ['-s', '--site URL_REGEX,TICKET_LINK_REGEX,PASSKEY[,LOGIN:PASSWORD[,LOGIN_URL]]',
27
- 'Adds site specifications used to obtain a ticket.'],
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 site specifications from the configuration.'],
30
- :parameters_flag =>
31
- ['-p', '--parameters NAME:VALUE[,NAME:VALUE]', 'Specifies parameters for the Sinatra library.'],
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(:site_flag) do |specs|
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(:parameters_flag) do |params|
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.1
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-10 00:00:00 +06:00
12
+ date: 2010-01-11 00:00:00 +06:00
13
13
  default_executable: edango
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency