RubyApp 0.0.91 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. data/.gitignore +0 -1
  2. data/.rvmrc +56 -1
  3. data/Gemfile.lock +22 -22
  4. data/bin/console.rb +9 -1
  5. data/bin/ruby_app +2 -24
  6. data/features/default.feature +1 -0
  7. data/features/elements/input.feature +2 -0
  8. data/features/elements/page.feature +0 -9
  9. data/features/step_definitions/default_macros.rb +1 -4
  10. data/features/step_definitions/default_steps.rb +1 -1
  11. data/lib/ruby_app.rb +8 -1
  12. data/lib/ruby_app/application.rb +5 -67
  13. data/lib/ruby_app/configuration.rb +2 -3
  14. data/lib/ruby_app/configuration.ru +32 -0
  15. data/lib/ruby_app/configuration.yml +28 -0
  16. data/lib/ruby_app/element.rb +12 -6
  17. data/lib/ruby_app/elements.rb +50 -0
  18. data/lib/ruby_app/elements/base/base_mail.rb +2 -2
  19. data/lib/ruby_app/elements/base/base_page.html.haml +1 -1
  20. data/lib/ruby_app/elements/base/base_page.js.haml +3 -3
  21. data/lib/ruby_app/elements/base/base_page.rb +2 -2
  22. data/lib/ruby_app/elements/dialogs/base/base_ok_dialog.rb +0 -1
  23. data/lib/ruby_app/elements/dialogs/blank_dialog.rb +1 -1
  24. data/lib/ruby_app/elements/dialogs/exception_dialog.rb +1 -2
  25. data/lib/ruby_app/elements/navigation/back_button.rb +1 -1
  26. data/lib/ruby_app/elements/navigation/base/base_breadcrumbs.rb +1 -0
  27. data/lib/ruby_app/elements/navigation/page_link.rb +1 -0
  28. data/lib/ruby_app/elements/pages/authentication/open_id/ax_authentication_page.rb +1 -1
  29. data/lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.rb +1 -3
  30. data/lib/ruby_app/elements/pages/authentication/open_id/email_authentication_page.rb +1 -1
  31. data/lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb +1 -1
  32. data/lib/ruby_app/elements/pages/base/base_blank_page.rb +0 -1
  33. data/lib/ruby_app/elements/pages/default_page.rb +2 -1
  34. data/lib/ruby_app/elements/pages/quit_page.html.haml +0 -3
  35. data/lib/ruby_app/elements/pages/quit_page.rb +0 -2
  36. data/lib/ruby_app/elements/pages/settings_page.rb +2 -1
  37. data/lib/ruby_app/elements/pages/test_pages.rb +9 -0
  38. data/lib/ruby_app/elements/pages/test_pages/button_test_page.rb +3 -5
  39. data/lib/ruby_app/elements/pages/test_pages/default_test_page.rb +10 -15
  40. data/lib/ruby_app/elements/pages/test_pages/dialog_test_page.rb +2 -8
  41. data/lib/ruby_app/elements/pages/test_pages/input_test_page.rb +2 -9
  42. data/lib/ruby_app/elements/pages/test_pages/link_test_page.rb +3 -5
  43. data/lib/ruby_app/elements/pages/test_pages/linked_test_page.rb +1 -2
  44. data/lib/ruby_app/elements/pages/test_pages/list_test_page.rb +4 -8
  45. data/lib/ruby_app/elements/pages/test_pages/markdown_test_page.rb +3 -4
  46. data/lib/ruby_app/elements/pages/test_pages/test_page.rb +3 -8
  47. data/lib/ruby_app/exceptions.rb +2 -0
  48. data/lib/ruby_app/exceptions/base/base_exception.rb +1 -1
  49. data/lib/ruby_app/language.rb +9 -15
  50. data/lib/ruby_app/log.rb +32 -28
  51. data/lib/ruby_app/mixins.rb +7 -0
  52. data/lib/ruby_app/mixins/configuration_mixin.rb +1 -1
  53. data/lib/ruby_app/mixins/delegate_mixin.rb +1 -1
  54. data/lib/ruby_app/mixins/hash_mixin.rb +1 -1
  55. data/lib/ruby_app/mixins/render_mixin.rb +37 -39
  56. data/lib/ruby_app/mixins/route_mixin.rb +1 -5
  57. data/lib/ruby_app/mixins/template_mixin.rb +4 -12
  58. data/lib/ruby_app/mixins/translate_mixin.rb +2 -2
  59. data/lib/ruby_app/rack.rb +8 -0
  60. data/lib/ruby_app/rack/application.rb +9 -5
  61. data/lib/ruby_app/rack/duration.rb +22 -0
  62. data/lib/ruby_app/rack/language.rb +26 -0
  63. data/lib/ruby_app/rack/memory.rb +22 -0
  64. data/lib/ruby_app/rack/request.rb +27 -0
  65. data/lib/ruby_app/rack/response.rb +26 -0
  66. data/lib/ruby_app/rack/route.rb +24 -87
  67. data/lib/ruby_app/rack/session.rb +31 -0
  68. data/lib/ruby_app/request.rb +4 -55
  69. data/lib/ruby_app/response.rb +58 -0
  70. data/lib/ruby_app/session.rb +102 -35
  71. data/lib/ruby_app/templates/application/Rakefile +1 -1
  72. data/lib/ruby_app/templates/application/configuration.ru +41 -0
  73. data/lib/ruby_app/templates/application/configuration.yml +16 -0
  74. data/lib/ruby_app/templates/application/console.rb +15 -10
  75. data/lib/ruby_app/templates/application/lib/_APPLICATION_DOWNCODE_.rb +3 -0
  76. data/lib/ruby_app/templates/application/lib/_APPLICATION_DOWNCODE_/application.rb +3 -3
  77. data/lib/ruby_app/templates/application/lib/_APPLICATION_DOWNCODE_/elements/pages/default_page.rb +1 -1
  78. data/lib/ruby_app/templates/application/lib/_APPLICATION_DOWNCODE_/session.rb +3 -3
  79. data/lib/ruby_app/templates/application/spec/application_spec.rb +17 -0
  80. data/lib/ruby_app/templates/application/spec/request_spec.rb +18 -0
  81. data/lib/ruby_app/templates/application/spec/support/shared.rb +34 -9
  82. data/lib/ruby_app/themes/mobile.rb +1 -17
  83. data/lib/ruby_app/themes/mobile/base/base_page.html.haml +1 -1
  84. data/lib/ruby_app/translations/en.yml +133 -144
  85. data/lib/ruby_app/version.rb +1 -1
  86. data/rakefile +1 -16
  87. data/spec/application_spec.rb +5 -13
  88. data/spec/elements/base_element.html.haml +5 -0
  89. data/spec/elements/container_element.html.haml +6 -0
  90. data/spec/elements/derived_element.html.haml +5 -0
  91. data/spec/elements/element_spec.rb +101 -0
  92. data/spec/request_spec.rb +6 -13
  93. data/spec/support/shared.rb +14 -6
  94. metadata +95 -125
  95. data/features/elements/pages/quit_page.feature +0 -8
  96. data/lib/ruby_app/config.ru +0 -25
  97. data/lib/ruby_app/config.yml +0 -16
  98. data/lib/ruby_app/elements/pages/test_pages/select_test_page.rb +0 -44
  99. data/lib/ruby_app/templates/application/config.ru +0 -40
  100. data/lib/ruby_app/templates/application/config.yml +0 -1
  101. data/lib/ruby_app/templates/page/_PAGE_DOWNCODE_.css.haml +0 -3
  102. data/lib/ruby_app/templates/page/_PAGE_DOWNCODE_.html.haml +0 -4
  103. data/lib/ruby_app/templates/page/_PAGE_DOWNCODE_.js.haml +0 -3
  104. data/lib/ruby_app/templates/page/_PAGE_DOWNCODE_.rb +0 -14
  105. data/spec/configuration_spec.rb +0 -25
  106. data/spec/element_spec.rb +0 -72
  107. data/spec/elements/navigation/breadcrumbs_spec.rb +0 -62
  108. data/spec/elements/page_spec.rb +0 -20
  109. data/spec/language_spec.rb +0 -25
  110. data/spec/log_spec.rb +0 -25
  111. data/spec/mixins/configuration_mixin_spec.rb +0 -24
  112. data/spec/mixins/delegate_mixin_spec.rb +0 -28
  113. data/spec/mixins/hash_mixin_spec.rb +0 -39
  114. data/spec/mixins/render_mixin_spec.rb +0 -127
  115. data/spec/mixins/route_mixin_spec.rb +0 -60
  116. data/spec/mixins/template_mixin_spec.rb +0 -78
  117. data/spec/mixins/test_a.css.haml +0 -4
  118. data/spec/mixins/test_a.html.haml +0 -2
  119. data/spec/mixins/test_a.js.haml +0 -4
  120. data/spec/mixins/test_b.css.haml +0 -4
  121. data/spec/mixins/test_b.html.haml +0 -3
  122. data/spec/mixins/test_b.js.haml +0 -4
  123. data/spec/mixins/test_c.css.haml +0 -4
  124. data/spec/mixins/test_c.html.haml +0 -2
  125. data/spec/mixins/test_c.js.haml +0 -4
  126. data/spec/mixins/translate_mixin_spec.rb +0 -25
  127. data/spec/session_spec.rb +0 -39
data/.gitignore CHANGED
@@ -1,5 +1,4 @@
1
1
  .bundle
2
- .cache
3
2
  .DS_Store
4
3
  .idea
5
4
  .sass-cache
data/.rvmrc CHANGED
@@ -1 +1,56 @@
1
- rvm ruby-1.8.7-p352@RubyApp
1
+ #!/usr/bin/env bash
2
+
3
+ # This is an RVM Project .rvmrc file, used to automatically load the ruby
4
+ # development environment upon cd'ing into the directory
5
+
6
+ # First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
7
+ # environment_id="ruby-1.9.3-p125@RubyApp"
8
+ environment_id="ruby-1.8.7-p352@RubyApp"
9
+
10
+ #
11
+ # Uncomment following line if you want options to be set only for given project.
12
+ #
13
+ # PROJECT_JRUBY_OPTS=( --1.9 )
14
+
15
+ #
16
+ # First we attempt to load the desired environment directly from the environment
17
+ # file. This is very fast and efficient compared to running through the entire
18
+ # CLI and selector. If you want feedback on which environment was used then
19
+ # insert the word 'use' after --create as this triggers verbose mode.
20
+ #
21
+ if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
22
+ && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
23
+ then
24
+ \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
25
+
26
+ if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
27
+ then
28
+ . "${rvm_path:-$HOME/.rvm}/hooks/after_use"
29
+ fi
30
+ else
31
+ # If the environment file has not yet been created, use the RVM CLI to select.
32
+ if ! rvm --create "$environment_id"
33
+ then
34
+ echo "Failed to create RVM environment '${environment_id}'."
35
+ exit 1
36
+ fi
37
+ fi
38
+
39
+ #
40
+ # If you use an RVM gemset file to install a list of gems (*.gems), you can have
41
+ # it be automatically loaded. Uncomment the following and adjust the filename if
42
+ # necessary.
43
+ #
44
+ # filename=".gems"
45
+ # if [[ -s "$filename" ]]
46
+ # then
47
+ # rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
48
+ # fi
49
+
50
+ # If you use bundler, this might be useful to you:
51
+ # if command -v bundle && [[ -s Gemfile ]]
52
+ # then
53
+ # bundle install
54
+ # fi
55
+
56
+
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- RubyApp (0.0.91)
4
+ RubyApp (0.2.0)
5
5
  BlueCloth
6
6
  chronic
7
7
  chronic_duration
@@ -22,7 +22,7 @@ GEM
22
22
  remote: http://rubygems.org/
23
23
  specs:
24
24
  BlueCloth (1.0.1)
25
- addressable (2.2.6)
25
+ addressable (2.2.7)
26
26
  builder (3.0.0)
27
27
  capybara (1.1.2)
28
28
  mime-types (>= 1.16)
@@ -31,15 +31,15 @@ GEM
31
31
  rack-test (>= 0.5.4)
32
32
  selenium-webdriver (~> 2.0)
33
33
  xpath (~> 0.1.4)
34
- childprocess (0.3.0)
34
+ childprocess (0.3.1)
35
35
  ffi (~> 1.0.6)
36
36
  chronic (0.6.7)
37
37
  chronic_duration (0.9.6)
38
38
  numerizer (~> 0.1.1)
39
- cucumber (1.1.4)
39
+ cucumber (1.1.9)
40
40
  builder (>= 2.1.2)
41
41
  diff-lcs (>= 1.1.2)
42
- gherkin (~> 2.7.1)
42
+ gherkin (~> 2.9.0)
43
43
  json (>= 1.4.6)
44
44
  term-ansicolor (>= 1.0.6)
45
45
  diff-lcs (1.1.3)
@@ -47,15 +47,15 @@ GEM
47
47
  ffi (1.0.11)
48
48
  fileutils (0.7)
49
49
  rmagick (>= 2.13.1)
50
- gherkin (2.7.6)
50
+ gherkin (2.9.1)
51
51
  json (>= 1.4.6)
52
52
  haml (3.1.4)
53
53
  json (1.6.5)
54
- launchy (2.0.5)
54
+ launchy (2.1.0)
55
55
  addressable (~> 2.2.6)
56
56
  mime-types (1.17.2)
57
- multi_json (1.0.4)
58
- nokogiri (1.5.0)
57
+ multi_json (1.1.0)
58
+ nokogiri (1.5.2)
59
59
  numerizer (0.1.1)
60
60
  r18n-core (0.4.14)
61
61
  rack (1.4.1)
@@ -63,22 +63,22 @@ GEM
63
63
  rack (>= 1.0)
64
64
  rake (0.9.2.2)
65
65
  rmagick (2.13.1)
66
- rspec (2.8.0)
67
- rspec-core (~> 2.8.0)
68
- rspec-expectations (~> 2.8.0)
69
- rspec-mocks (~> 2.8.0)
70
- rspec-core (2.8.0)
71
- rspec-expectations (2.8.0)
72
- diff-lcs (~> 1.1.2)
73
- rspec-mocks (2.8.0)
66
+ rspec (2.9.0)
67
+ rspec-core (~> 2.9.0)
68
+ rspec-expectations (~> 2.9.0)
69
+ rspec-mocks (~> 2.9.0)
70
+ rspec-core (2.9.0)
71
+ rspec-expectations (2.9.0)
72
+ diff-lcs (~> 1.1.3)
73
+ rspec-mocks (2.9.0)
74
74
  ruby-event (1.0.0)
75
75
  ruby-openid (2.1.8)
76
- rubyzip (0.9.5)
77
- sass (3.1.12)
78
- selenium-webdriver (2.18.0)
76
+ rubyzip (0.9.6.1)
77
+ sass (3.1.15)
78
+ selenium-webdriver (2.20.0)
79
79
  childprocess (>= 0.2.5)
80
- ffi (~> 1.0.9)
81
- multi_json (~> 1.0.4)
80
+ ffi (~> 1.0)
81
+ multi_json (~> 1.0)
82
82
  rubyzip
83
83
  term-ansicolor (1.0.7)
84
84
  xpath (0.1.4)
@@ -1,8 +1,16 @@
1
1
  require 'rubygems'
2
2
  require 'bundler/setup'
3
3
 
4
- require 'ruby_app/application'
4
+ require 'ruby_app'
5
5
 
6
6
  puts "Running #{__FILE__.inspect}"
7
7
 
8
+ RubyApp::Configuration.load!([File.join(RubyApp::ROOT, %w[configuration.yml])])
9
+ RubyApp::Log.open!
8
10
  RubyApp::Application.create!
11
+
12
+ at_exit do
13
+ RubyApp::Application.destroy!
14
+ RubyApp::Log.close!
15
+ RubyApp::Configuration.unload!
16
+ end
@@ -17,9 +17,8 @@ usage: ruby_app <command> <arguments>
17
17
 
18
18
  Available commands include:
19
19
  create application Create a basic application in the current folder named <arguments>.
20
- create page DISABLED: Create a baisc page consisting of .rb, .html, .css. and .js files (not implemented)
21
20
  console Open an interactive console
22
- run Run the application identified by the config.ru in <arguments>
21
+ run Run the application identified by the configuration.ru in <arguments>
23
22
 
24
23
  USAGE
25
24
  end
@@ -101,25 +100,6 @@ def create_application
101
100
  copy_folder(source, full_folder, replacements)
102
101
  end
103
102
 
104
- #def create_page
105
- # argument = $*[2]
106
- # folder = File.dirname(File.join(File.join(FileUtils.pwd, %w[elements arguments]), downcode(argument).split('/')))
107
- # namespace_class = "#{upcode(File.basename(FileUtils.pwd))}::Elements::Pages::#{upcode(argument)}"
108
- # _class = namespace_class.split('::').last
109
- # replacements = [
110
- # {
111
- # :pattern => /_PAGE_DOWNCODE_/,
112
- # :text => downcode(_class)
113
- # },
114
- # {
115
- # :pattern => /_PAGE_UPCODE_/,
116
- # :text => _class
117
- # }
118
- # ]
119
- # source = File.join(File.dirname(__FILE__), %w[.. lib ruby_app templates argument])
120
- # copy_folder(source, folder, replacements)
121
- #end
122
-
123
103
  def console
124
104
  argument = $*[1]
125
105
  system("irb --back-trace-limit 100 -r #{argument || ( File.exists?(File.join(FileUtils.pwd, %w[console.rb])) ? File.join(FileUtils.pwd, %w[console.rb]) : File.join(File.dirname(__FILE__), %w[console.rb]) )}")
@@ -127,7 +107,7 @@ end
127
107
 
128
108
  def run
129
109
  argument = $*[1]
130
- Rack::Server.start(:config => argument || File.join(FileUtils.pwd, %w[config.ru]))
110
+ Rack::Server.start(:config => argument || File.join(FileUtils.pwd, %w[configuration.ru]))
131
111
  end
132
112
 
133
113
  def downcode(value)
@@ -151,8 +131,6 @@ else
151
131
  case $*[1].downcase
152
132
  when 'application'
153
133
  create_application
154
- # when 'page'
155
- # create_page
156
134
  else
157
135
  puts "Blank or unrecognized command '#{$*[1].downcase}'"
158
136
  puts usage
@@ -3,3 +3,4 @@ Feature: Default Page
3
3
  Scenario: View the default page
4
4
  Given I am viewing "/"
5
5
  Then I should see "Click here to go to the test pages"
6
+ Then I quit
@@ -56,3 +56,5 @@ Feature: Input elements
56
56
  When I click "Close"
57
57
  And I uncheck the "ToggleInput" field
58
58
  Then I should see "You input 'false'"
59
+ Then I click "Close"
60
+ Then I quit
@@ -21,12 +21,3 @@ Feature: A page
21
21
  And I click "_TestPage"
22
22
  Then I should see "The cookie value is 'value'."
23
23
  Then I quit
24
-
25
- Scenario Outline: Loading the home page
26
- Given I am viewing "/"
27
- And I should see "Loaded"
28
-
29
- Scenarios: Count
30
- | count |
31
- | X |
32
- | X |
@@ -8,9 +8,6 @@ end
8
8
 
9
9
  Then /^I quit$/ do
10
10
  steps %Q{
11
- When I click "Settings"
12
- Then I should see "Quit the session"
13
- When I click "Quit"
14
- Then I should see "Click here to go to the test pages"
11
+ Given I am viewing "/quit"
15
12
  }
16
13
  end
@@ -1,5 +1,5 @@
1
1
  Given /^I am viewing "([^"]*)"$/ do |url|
2
- visit("#{url}?event_error=false")
2
+ visit("#{url}?_event_error=false")
3
3
  end
4
4
 
5
5
  When /^I refresh the page$/ do
@@ -1 +1,8 @@
1
- require "ruby_app/version"
1
+ require 'ruby_app/application'
2
+ require 'ruby_app/configuration'
3
+ require 'ruby_app/language'
4
+ require 'ruby_app/log'
5
+ require 'ruby_app/request'
6
+ require 'ruby_app/response'
7
+ require 'ruby_app/session'
8
+ require 'ruby_app/version'
@@ -4,22 +4,15 @@ require 'bundler/setup'
4
4
  require 'fileutils'
5
5
 
6
6
  module RubyApp
7
- require 'ruby_app/configuration'
8
- require 'ruby_app/log'
9
- require 'ruby_app/mixins/configuration_mixin'
10
- require 'ruby_app/mixins/delegate_mixin'
11
- require 'ruby_app/mixins/hash_mixin'
12
- require 'ruby_app/session'
13
- require 'ruby_app/version'
7
+ require 'ruby_app/mixins'
14
8
 
15
9
  class Application
10
+ extend RubyApp::Mixins::ConfigurationMixin
16
11
  extend RubyApp::Mixins::DelegateMixin
17
- include RubyApp::Mixins::ConfigurationMixin
18
12
 
19
13
  attr_reader :options, :environment
20
14
 
21
- def initialize(options)
22
- @options = options
15
+ def initialize
23
16
  @environment = {}
24
17
  end
25
18
 
@@ -27,69 +20,14 @@ module RubyApp
27
20
  @@_application ||= nil
28
21
  end
29
22
 
30
- def self.create!(options = {})
31
- _options = { :application_class => RubyApp::Application,
32
- :session_class => RubyApp::Session,
33
- :log_path => File.join(RubyApp::ROOT, %w[process log application.log]),
34
- :configuration_paths => [],
35
- :default_language => :en,
36
- :translations_paths => [] }.merge(options)
37
- _options[:configuration_paths] = [File.join(RubyApp::ROOT, %w[config.yml])] + ( _options[:configuration_paths].is_a?(Array) ? _options[:configuration_paths] : [_options[:configuration_paths]] )
38
- _options[:translations_paths] = [File.join(RubyApp::ROOT, %w[translations])] + ( _options[:translations_paths].is_a?(Array) ? _options[:translations_paths] : [_options[:translations_paths]] )
39
- RubyApp::Log.open!(_options[:log_path])
40
- RubyApp::Configuration.load!(_options[:configuration_paths])
41
- @@_application = _options[:application_class].new(_options)
23
+ def self.create!
24
+ @@_application = ( Kernel.eval(RubyApp::Application.configuration._class) ).new
42
25
  end
43
26
 
44
27
  def self.destroy!
45
- RubyApp::Configuration.unload!
46
- RubyApp::Log.close!
47
28
  @@_application = nil
48
29
  end
49
30
 
50
- def self.create_cache(path, root)
51
- RubyApp::Application.create!
52
- begin
53
- Dir.glob(File.join(path, %w[** *.rb])).each do |element_file|
54
- RubyApp::Request.create!
55
- begin
56
- require element_file
57
- element_class = element_file.gsub(root, '')
58
- element_class = element_class.gsub(/^\//, '')
59
- element_class = element_class.gsub(/\.rb$/, '')
60
- element_class = RubyApp::Application.upcode(element_class)
61
- begin
62
- element_class = eval(element_class)
63
- [:css, :js].each do |format|
64
- begin
65
- element_class.render(format, true)
66
- rescue Exception => exception
67
- puts "#{element_class}.render(#{format.inspect}) exception=#{exception.message}"
68
- end
69
- end
70
- rescue Exception => exception
71
- puts exception.message
72
- end
73
- ensure
74
- RubyApp::Request.destroy!
75
- end
76
- end
77
- ensure
78
- RubyApp::Application.destroy!
79
- end
80
- end
81
-
82
- def self.destroy_cache(path)
83
- Dir.glob(File.join(path, %w[** .cache])).each do |directory|
84
- FileUtils.rm_r(directory)
85
- end
86
- end
87
-
88
- def self.upcode(value)
89
- value = value.gsub(/\/(.?)/) { "::#{$1.upcase}" }
90
- value.gsub(/(?:^|_)(.)/) { $1.upcase }
91
- end
92
-
93
31
  end
94
32
 
95
33
  end
@@ -1,8 +1,7 @@
1
1
  require 'yaml'
2
2
 
3
3
  module RubyApp
4
- require 'ruby_app/mixins/delegate_mixin'
5
- require 'ruby_app/mixins/hash_mixin'
4
+ require 'ruby_app/mixins'
6
5
 
7
6
  class Configuration
8
7
  extend RubyApp::Mixins::DelegateMixin
@@ -10,7 +9,7 @@ module RubyApp
10
9
  attr_reader :document
11
10
 
12
11
  def self.get
13
- @@_configuration
12
+ @@_configuration ||= nil
14
13
  end
15
14
 
16
15
  def self.load!(paths)
@@ -0,0 +1,32 @@
1
+ #\ --warn --port 8008 --pid ./rack.pid --debug true
2
+ require 'rubygems'
3
+ require 'bundler/setup'
4
+
5
+ require 'rack'
6
+
7
+ require 'ruby_app'
8
+ require 'ruby_app/rack'
9
+
10
+ use Rack::ShowExceptions
11
+ use Rack::Reloader
12
+
13
+ #use RubyApp::Rack::Duration
14
+ #use RubyApp::Rack::Memory
15
+
16
+ use RubyApp::Rack::Application, :configuration_paths => [File.join(RubyApp::ROOT, %w[configuration.yml])]
17
+
18
+ map '/ruby_app/resources' do
19
+ run Rack::File.new(File.join(RubyApp::ROOT, %w[resources]))
20
+ end
21
+
22
+ map '/favicon.ico' do
23
+ run Rack::File.new(File.join(RubyApp::ROOT, %w[resources favicon.ico]))
24
+ end
25
+
26
+ map '/' do
27
+ use RubyApp::Rack::Request
28
+ use RubyApp::Rack::Response
29
+ use RubyApp::Rack::Language
30
+ use RubyApp::Rack::Session
31
+ run RubyApp::Rack::Route.new
32
+ end
@@ -0,0 +1,28 @@
1
+ default:
2
+ ruby_app:
3
+ application:
4
+ _class: "RubyApp::Application"
5
+ language:
6
+ default: "en"
7
+ paths:
8
+ - "#{RubyApp::ROOT}/translations"
9
+ log:
10
+ path: "#{RubyApp::ROOT}/process/log/application.log"
11
+ session:
12
+ _class: "RubyApp::Session"
13
+ expires: 60
14
+ interval: 15
15
+ elements:
16
+ pages:
17
+ authentication:
18
+ open_id:
19
+ google_authentication_page:
20
+ attributes:
21
+ email: "http://schema.openid.net/contact/email"
22
+ identifier: "https://www.google.com/accounts/o8/id"
23
+ my_open_id_authentication_page:
24
+ identifier: "http://myopenid.com"
25
+ yahoo_authentication_page:
26
+ attributes:
27
+ email: "http://axschema.org/contact/email"
28
+ identifier: "https://www.yahoo.com"