eve 1.0.2 → 2.0.1

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.
Files changed (50) hide show
  1. data/.gitignore +43 -0
  2. data/Gemfile +17 -0
  3. data/Gemfile.lock +109 -0
  4. data/LICENSE.txt +20 -0
  5. data/README.rdoc +24 -3
  6. data/Rakefile +26 -117
  7. data/eve.gemspec +35 -0
  8. data/lib/eve.rb +5 -10
  9. data/lib/eve/api.rb +3 -1
  10. data/lib/eve/api/response/inspection.rb +1 -1
  11. data/lib/eve/api/response/rowsets.rb +1 -1
  12. data/lib/eve/dependencies.rb +42 -12
  13. data/lib/eve/deprecation.rb +3 -0
  14. data/lib/eve/javascript_helper.rb +196 -0
  15. data/lib/eve/trust.rb +1 -2
  16. data/lib/eve/trust/controller_helpers.rb +62 -66
  17. data/lib/eve/trust/igb_interface.rb +14 -10
  18. data/lib/eve/version.rb +8 -0
  19. data/spec/controllers/controller_helpers_spec.rb +91 -0
  20. data/spec/{lib/eve/helpers → helpers}/javascript_helper_spec.rb +2 -2
  21. data/spec/helpers/view_helper_spec.rb +7 -0
  22. data/spec/lib/eve/api/calls/eve/character_id_spec.rb +8 -8
  23. data/spec/lib/eve/api/calls/server_status_spec.rb +4 -0
  24. data/spec/lib/eve/api/request_spec.rb +1 -0
  25. data/spec/lib/eve/trust/igb_interface_spec.rb +5 -5
  26. data/spec/spec_helper.rb +42 -1
  27. data/spec/support/controllers/trust_controller.rb +18 -1
  28. data/spec/support/mock_api_helpers.rb +6 -1
  29. data/spec/support/views/trust/html_and_igb.html.erb +1 -0
  30. data/spec/support/views/trust/html_and_igb.igb.erb +1 -0
  31. data/spec/support/views/trust/html_only.html.erb +1 -0
  32. data/spec/support/views/trust/igb_only.igb.erb +1 -0
  33. metadata +226 -169
  34. data/Manifest.txt +0 -174
  35. data/PostInstall.txt +0 -6
  36. data/features/support/env.rb +0 -1
  37. data/lib/eve/core_extensions.rb +0 -3
  38. data/lib/eve/core_extensions/hash.rb +0 -51
  39. data/lib/eve/core_extensions/string.rb +0 -11
  40. data/lib/eve/helpers.rb +0 -12
  41. data/lib/eve/helpers/javascript_helper.rb +0 -198
  42. data/lib/eve/helpers/view_helper.rb +0 -13
  43. data/script/console +0 -10
  44. data/script/console.cmd +0 -1
  45. data/script/destroy +0 -14
  46. data/script/destroy.cmd +0 -1
  47. data/script/generate +0 -14
  48. data/script/generate.cmd +0 -1
  49. data/spec/lib/eve/helpers/view_helper_spec.rb +0 -12
  50. data/spec/lib/eve/trust/controller_helpers_spec.rb +0 -70
@@ -1,13 +0,0 @@
1
- module Eve
2
- module Helpers
3
- # Provides various IGB-specific helper methods.
4
- module ViewHelper
5
- def self.included(base)
6
- base.instance_eval do
7
- delegate :igb, :to => :controller
8
- delegate :igb?, :to => :igb
9
- end
10
- end
11
- end
12
- end
13
- end
@@ -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"
@@ -1 +0,0 @@
1
- @ruby script/console %*
@@ -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)
@@ -1 +0,0 @@
1
- @ruby script/destroy %*
@@ -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)
@@ -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