eve 1.0.2 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +43 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +109 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +24 -3
- data/Rakefile +26 -117
- data/eve.gemspec +35 -0
- data/lib/eve.rb +5 -10
- data/lib/eve/api.rb +3 -1
- data/lib/eve/api/response/inspection.rb +1 -1
- data/lib/eve/api/response/rowsets.rb +1 -1
- data/lib/eve/dependencies.rb +42 -12
- data/lib/eve/deprecation.rb +3 -0
- data/lib/eve/javascript_helper.rb +196 -0
- data/lib/eve/trust.rb +1 -2
- data/lib/eve/trust/controller_helpers.rb +62 -66
- data/lib/eve/trust/igb_interface.rb +14 -10
- data/lib/eve/version.rb +8 -0
- data/spec/controllers/controller_helpers_spec.rb +91 -0
- data/spec/{lib/eve/helpers → helpers}/javascript_helper_spec.rb +2 -2
- data/spec/helpers/view_helper_spec.rb +7 -0
- data/spec/lib/eve/api/calls/eve/character_id_spec.rb +8 -8
- data/spec/lib/eve/api/calls/server_status_spec.rb +4 -0
- data/spec/lib/eve/api/request_spec.rb +1 -0
- data/spec/lib/eve/trust/igb_interface_spec.rb +5 -5
- data/spec/spec_helper.rb +42 -1
- data/spec/support/controllers/trust_controller.rb +18 -1
- data/spec/support/mock_api_helpers.rb +6 -1
- data/spec/support/views/trust/html_and_igb.html.erb +1 -0
- data/spec/support/views/trust/html_and_igb.igb.erb +1 -0
- data/spec/support/views/trust/html_only.html.erb +1 -0
- data/spec/support/views/trust/igb_only.igb.erb +1 -0
- metadata +226 -169
- data/Manifest.txt +0 -174
- data/PostInstall.txt +0 -6
- data/features/support/env.rb +0 -1
- data/lib/eve/core_extensions.rb +0 -3
- data/lib/eve/core_extensions/hash.rb +0 -51
- data/lib/eve/core_extensions/string.rb +0 -11
- data/lib/eve/helpers.rb +0 -12
- data/lib/eve/helpers/javascript_helper.rb +0 -198
- data/lib/eve/helpers/view_helper.rb +0 -13
- data/script/console +0 -10
- data/script/console.cmd +0 -1
- data/script/destroy +0 -14
- data/script/destroy.cmd +0 -1
- data/script/generate +0 -14
- data/script/generate.cmd +0 -1
- data/spec/lib/eve/helpers/view_helper_spec.rb +0 -12
- data/spec/lib/eve/trust/controller_helpers_spec.rb +0 -70
data/script/console
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# File: script/console
|
3
|
-
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
-
|
5
|
-
libs = " -r irb/completion"
|
6
|
-
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
-
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
-
libs << " -r #{File.dirname(__FILE__) + '/../lib/eve.rb'}"
|
9
|
-
puts "Loading eve gem"
|
10
|
-
exec "#{irb} #{libs} --simple-prompt"
|
data/script/console.cmd
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
@ruby script/console %*
|
data/script/destroy
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/destroy'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/destroy.cmd
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
@ruby script/destroy %*
|
data/script/generate
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/generate'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Generate.new.run(ARGV)
|
data/script/generate.cmd
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
@ruby script/generate %*
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Eve::Helpers::ViewHelper do
|
4
|
-
subject do
|
5
|
-
env = Rack::MockRequest.env_for("/").merge('REQUEST_URI' => '', 'HTTP_USER_AGENT' => 'eve-minibrowser')
|
6
|
-
ActionView::Base.new([], {}, TrustController.call(env).template.controller)
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should delegate #igb into #controller" do
|
10
|
-
subject.igb.should be_kind_of(Eve::Trust::IgbInterface)
|
11
|
-
end
|
12
|
-
end
|
@@ -1,70 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Eve::Trust::ControllerHelpers do
|
4
|
-
subject do
|
5
|
-
subject = TrustController.call(@rack_env)
|
6
|
-
if exception = subject.template.instance_variable_get("@exception")
|
7
|
-
raise exception
|
8
|
-
end
|
9
|
-
subject
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should not consider the helper methods to be actions" do
|
13
|
-
TrustController.action_methods.sort.should == %w(index)
|
14
|
-
end
|
15
|
-
|
16
|
-
context "from the IGB" do
|
17
|
-
before :all do
|
18
|
-
@rack_env = Rack::MockRequest.env_for("/").merge('REQUEST_URI' => '', 'HTTP_USER_AGENT' => 'eve-minibrowser')
|
19
|
-
end
|
20
|
-
|
21
|
-
context "without trust" do
|
22
|
-
it "should require trust" do
|
23
|
-
subject.headers['eve.trustme'].should_not be_blank
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
context "with trust" do
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
context "and an IGB template exists" do
|
32
|
-
before(:all) { @rack_env.merge!('mock_methods' => { :default_template_exists? => true }) }
|
33
|
-
it "responds with an IGB-specific page" do
|
34
|
-
subject.template.template_format.should == :igb
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
context "and an IGB template does not exist" do
|
39
|
-
before(:all) { @rack_env.merge!('mock_methods' => { :default_template_exists? => false }) }
|
40
|
-
it "does not respond with an IGB-specific page" do
|
41
|
-
subject.template.template_format.should_not == :igb
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
context "from any other browser" do
|
47
|
-
before :all do
|
48
|
-
@rack_env = Rack::MockRequest.env_for("/").merge('REQUEST_URI' => '',
|
49
|
-
'HTTP_USER_AGENT' => 'Mozilla/5.001 (windows; U; NT4.0; en-US; rv:1.0) Gecko/25250101')
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should not require trust" do
|
53
|
-
subject.headers['eve.trustme'].should be_blank
|
54
|
-
end
|
55
|
-
|
56
|
-
context "and an IGB template exists" do
|
57
|
-
before(:all) { @rack_env.merge!('mock_methods' => { :default_template_exists? => true }) }
|
58
|
-
it "does not respond with an IGB-specific page" do
|
59
|
-
subject.template.template_format.should_not == :igb
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
context "and an IGB template does not exist" do
|
64
|
-
before(:all) { @rack_env.merge!('mock_methods' => { :default_template_exists? => false }) }
|
65
|
-
it "does not respond with an IGB-specific page" do
|
66
|
-
subject.template.template_format.should_not == :igb
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|